-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Friendlist update #7
Conversation
Reviewer's Guide by SourceryThis pull request introduces a friend list feature and a toggle for the field of view. It also includes several related commands and UI updates. Sequence diagram for Friend ManagementsequenceDiagram
actor User
participant Console
participant FriendSystem
participant Config
User->>Console: arabica.friend username
Console->>FriendSystem: Execute command
FriendSystem->>Config: Add to FriendsSet
Config-->>Console: Success/Error message
Console-->>User: Display result
User->>Console: arabica.unfriend username
Console->>FriendSystem: Execute command
FriendSystem->>Config: Remove from FriendsSet
Config-->>Console: Success/Error message
Console-->>User: Display result
Class diagram for new Friend CommandsclassDiagram
class IConsoleCommand {
<<interface>>
+string Command
+string Description
+string Help
+Execute(IConsoleShell, string, string[])
}
class ArabicaFriendCommand {
+string Command
+string Description
+string Help
+Execute()
}
class ArabicaUnfriendCommand {
+string Command
+string Description
+string Help
+Execute()
}
class ArabicaFriendList {
+string Command
+string Description
+string Help
+Execute()
}
IConsoleCommand <|-- ArabicaFriendCommand
IConsoleCommand <|-- ArabicaUnfriendCommand
IConsoleCommand <|-- ArabicaFriendList
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @noverd - I've reviewed your changes - here's some feedback:
Overall Comments:
- Add input validation for friend/unfriend commands to handle null/empty usernames and other edge cases
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
||
public void Execute(IConsoleShell shell, string argStr, string[] args) | ||
{ | ||
if (ArabicaConfig.FriendsSet.Add(args[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Add argument validation before accessing args array
Check args.Length > 0 before accessing args[0] to prevent IndexOutOfRangeException.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Он шарит в этой теме.
@sourcery-ai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @noverd - I've reviewed your changes - here's some feedback:
Overall Comments:
- The Discord integration automatically opens URLs and writes files without user consent. This is a security concern - consider making this opt-in and adding proper user confirmation before taking these actions.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟡 Security: 1 issue found
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
if (File.Exists(FilePath)) | ||
return; | ||
OpenDiscord(); | ||
File.WriteAllText(FilePath, DiscordUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 issue (security): Consider using a more secure approach for file operations
The current file operation could fail or be exploited. Consider using Path.Combine() with a known safe directory, adding try-catch blocks, and implementing proper file access controls.
using HarmonyLib; | ||
|
||
namespace ArabicaCliento.Patches; | ||
|
||
[HarmonyPatch("Robust.Client.Graphics.Clyde.Clyde", "DrawOcclusionDepth")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Use typeof() instead of string literal for patch target
String literals for type names are fragile. Consider using typeof() to make the patch more resilient to refactoring.
using HarmonyLib; | |
namespace ArabicaCliento.Patches; | |
[HarmonyPatch("Robust.Client.Graphics.Clyde.Clyde", "DrawOcclusionDepth")] | |
using HarmonyLib; | |
using Robust.Client.Graphics.Clyde; | |
namespace ArabicaCliento.Patches; | |
[HarmonyPatch(typeof(Clyde), nameof(Clyde.DrawOcclusionDepth))] |
Friend list & toggle fov
Summary by Sourcery
Add friend list functionality and a toggle for the field of view.
New Features:
Tests: