-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Content.Shared.Administration; | ||
using Robust.Shared.Console; | ||
|
||
namespace ArabicaCliento.Commands; | ||
|
||
[AnyCommand] | ||
public class ArabicaFriendCommand : IConsoleCommand | ||
{ | ||
public string Command => "arabica.friend"; | ||
public string Description => "Add username to friend-list"; | ||
public string Help => "arabica.friend <username>"; | ||
|
||
public void Execute(IConsoleShell shell, string argStr, string[] args) | ||
{ | ||
if (args.Length != 1) | ||
{ | ||
shell.WriteError("Invalid args count"); | ||
return; | ||
} | ||
|
||
if (ArabicaConfig.FriendsSet.Add(args[0])) | ||
shell.WriteLine("Username is successfully added"); | ||
else | ||
shell.WriteError("Username is already presented"); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Content.Shared.Administration; | ||
using Robust.Shared.Console; | ||
|
||
namespace ArabicaCliento.Commands; | ||
|
||
[AnyCommand] | ||
public class ArabicaFriendList : IConsoleCommand | ||
{ | ||
public string Command => "arabica.friend_list"; | ||
public string Description => "Output a friendlist"; | ||
public string Help => "arabica.friend_list"; | ||
|
||
public void Execute(IConsoleShell shell, string argStr, string[] args) | ||
{ | ||
foreach (var friend in ArabicaConfig.FriendsSet) | ||
{ | ||
shell.WriteLine(friend); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Content.Shared.Administration; | ||
using Robust.Shared.Console; | ||
|
||
namespace ArabicaCliento.Commands; | ||
|
||
[AnyCommand] | ||
public class ArabicaUnfriendCommand : IConsoleCommand | ||
{ | ||
public string Command => "arabica.unfriend"; | ||
public string Description => "Remove username from friend-list"; | ||
public string Help => "arabica.unfriend <username>"; | ||
|
||
public void Execute(IConsoleShell shell, string argStr, string[] args) | ||
{ | ||
if (args.Length != 1) | ||
{ | ||
shell.WriteError("Invalid args count"); | ||
return; | ||
} | ||
|
||
if (ArabicaConfig.FriendsSet.Remove(args[0])) | ||
shell.WriteLine("Username is successfully removed"); | ||
else | ||
shell.WriteError("Username is not presented in friend-list"); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using ArabicaCliento.Systems; | ||
using Content.Shared.Administration; | ||
using Robust.Shared.Console; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using ArabicaCliento.Systems; | ||
using Content.Shared.Administration; | ||
using Robust.Shared.Console; | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||||||||||||||||||||
using HarmonyLib; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
namespace ArabicaCliento.Patches; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
[HarmonyPatch("Robust.Client.Graphics.Clyde.Clyde", "DrawOcclusionDepth")] | ||||||||||||||||||||||||
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Suggested change
|
||||||||||||||||||||||||
internal static class DrawOcclusionDepthPatch | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
[HarmonyPrefix] | ||||||||||||||||||||||||
static bool Prefix() | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
return !ArabicaConfig.FOVDisable; | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Robust.Client.UserInterface; | ||
|
||
namespace ArabicaCliento.Systems; | ||
|
||
public class ArabicaDiscordSystem : EntitySystem | ||
{ | ||
private const string DiscordUrl = "https://discord.gg/BKucu6uFUH"; | ||
private const string FilePath = "arbc_ds_ws_pnd"; | ||
[Dependency] private readonly IUriOpener _uri = default!; | ||
|
||
public void OpenDiscord() | ||
{ | ||
_uri.OpenUri(DiscordUrl); | ||
} | ||
|
||
public override void Initialize() | ||
{ | ||
if (File.Exists(FilePath)) | ||
return; | ||
OpenDiscord(); | ||
File.WriteAllText(FilePath, DiscordUrl); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
using ArabicaCliento.Systems; | ||
using ArabicaCliento.UI.Controls; | ||
using Content.Client.Resources; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.ResourceManagement; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace ArabicaCliento.UI; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class CheatMenuWindow : ArabicaWindow | ||
{ | ||
[Dependency] private readonly IEntityManager _entMan = default!; | ||
|
||
private readonly ArabicaDiscordSystem? _arabicaDiscord; | ||
|
||
public CheatMenuWindow() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
IoCManager.InjectDependencies(this); | ||
_arabicaDiscord ??= _entMan.System<ArabicaDiscordSystem>(); | ||
TitleLabel.Text = "ArabicaCliento: Click GUI"; | ||
Ranged.Pressed = ArabicaConfig.RangedAimbotEnabled; | ||
Melee.Pressed = ArabicaConfig.MeleeAimbotEnabled; | ||
Autospin.Pressed = ArabicaConfig.SpinBotEnabled; | ||
Antislip.Pressed = ArabicaConfig.AntiSlipEnabled; | ||
//LogPlayers.Pressed = ArabicaConfig.LogPlayers; | ||
|
||
AutoSpin.Pressed = ArabicaConfig.SpinBotEnabled; | ||
AntiSlip.Pressed = ArabicaConfig.AntiSlipEnabled; | ||
SyndicateDetector.Pressed = ArabicaConfig.SyndicateDetector; | ||
DOD.Pressed = ArabicaConfig.FOVDisable; | ||
//LogPlayers.Pressed = ArabicaConfig.LogPlayers; | ||
|
||
Melee.OnToggled += args => ArabicaConfig.MeleeAimbotEnabled = args.Pressed; | ||
Ranged.OnToggled += args => ArabicaConfig.RangedAimbotEnabled = args.Pressed; | ||
Autospin.OnToggled += args => ArabicaConfig.SpinBotEnabled = args.Pressed; | ||
Antislip.OnToggled += args => ArabicaConfig.AntiSlipEnabled = args.Pressed; | ||
AutoSpin.OnToggled += args => ArabicaConfig.SpinBotEnabled = args.Pressed; | ||
AntiSlip.OnToggled += args => ArabicaConfig.AntiSlipEnabled = args.Pressed; | ||
SyndicateDetector.OnToggled += args => ArabicaConfig.SyndicateDetector = args.Pressed; | ||
DOD.OnToggled += args => ArabicaConfig.FOVDisable = args.Pressed; | ||
Discord.OnPressed += _ => _arabicaDiscord?.OpenDiscord(); | ||
//LogPlayers.OnToggled += args => ArabicaConfig.LogPlayers = args.Pressed; | ||
} | ||
} |
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.
Он шарит в этой теме.