Skip to content

Commit 73d150d

Browse files
committed
Removed unused code
1 parent a01113f commit 73d150d

File tree

13 files changed

+13
-553
lines changed

13 files changed

+13
-553
lines changed

SysBot.Base/Util/RecordUtil.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ private static LoggingConfiguration GetConfig()
2929
}
3030

3131
// ReSharper disable once StaticMemberInGenericType
32+
#pragma warning disable CS0618 // Type or member is obsolete
3233
private static readonly ILogger Logger = new LogFactory(GetConfig()).GetCurrentClassLogger();
34+
#pragma warning restore CS0618 // Type or member is obsolete
3335
public static void Record(string message) => Logger.Log(LogLevel.Info, message);
3436
}
3537
}

SysBot.NET.sln

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ Global
5050
{2B520A84-74AF-40EC-9B10-A9FCF950D02E}.Release|x86.ActiveCfg = Release|Any CPU
5151
{2B520A84-74AF-40EC-9B10-A9FCF950D02E}.Release|x86.Build.0 = Release|Any CPU
5252
{886B1440-B333-4095-8E44-D71D043D20A9}.Debug|Any CPU.ActiveCfg = Debug|x64
53+
{886B1440-B333-4095-8E44-D71D043D20A9}.Debug|Any CPU.Build.0 = Debug|x64
5354
{886B1440-B333-4095-8E44-D71D043D20A9}.Debug|x64.ActiveCfg = Debug|x64
5455
{886B1440-B333-4095-8E44-D71D043D20A9}.Debug|x64.Build.0 = Debug|x64
5556
{886B1440-B333-4095-8E44-D71D043D20A9}.Debug|x86.ActiveCfg = Debug|x86
5657
{886B1440-B333-4095-8E44-D71D043D20A9}.Debug|x86.Build.0 = Debug|x86
57-
{886B1440-B333-4095-8E44-D71D043D20A9}.Release|Any CPU.ActiveCfg = Release|x86
58+
{886B1440-B333-4095-8E44-D71D043D20A9}.Release|Any CPU.ActiveCfg = Release|x64
59+
{886B1440-B333-4095-8E44-D71D043D20A9}.Release|Any CPU.Build.0 = Release|x64
5860
{886B1440-B333-4095-8E44-D71D043D20A9}.Release|x64.ActiveCfg = Release|x64
5961
{886B1440-B333-4095-8E44-D71D043D20A9}.Release|x64.Build.0 = Release|x64
6062
{886B1440-B333-4095-8E44-D71D043D20A9}.Release|x86.ActiveCfg = Release|x86
@@ -72,11 +74,13 @@ Global
7274
{C4BE4124-C1CF-4A81-AA7C-DE96A169CF1D}.Release|x86.ActiveCfg = Release|Any CPU
7375
{C4BE4124-C1CF-4A81-AA7C-DE96A169CF1D}.Release|x86.Build.0 = Release|Any CPU
7476
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Debug|Any CPU.ActiveCfg = Debug|x64
77+
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Debug|Any CPU.Build.0 = Debug|x64
7578
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Debug|x64.ActiveCfg = Debug|x64
7679
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Debug|x64.Build.0 = Debug|x64
7780
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Debug|x86.ActiveCfg = Debug|x86
7881
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Debug|x86.Build.0 = Debug|x86
79-
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Release|Any CPU.ActiveCfg = Release|x86
82+
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Release|Any CPU.ActiveCfg = Release|x64
83+
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Release|Any CPU.Build.0 = Release|x64
8084
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Release|x64.ActiveCfg = Release|x64
8185
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Release|x64.Build.0 = Release|x64
8286
{C0525606-4ED4-4998-9AF3-31E2DE65717A}.Release|x86.ActiveCfg = Release|x86

SysBot.Pokemon.Discord/Helpers/DiscordManager.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public class DiscordManager
1212

1313
public RemoteControlAccessList SudoDiscord => Config.GlobalSudoList;
1414
public RemoteControlAccessList SudoRoles => Config.RoleSudo;
15-
public RemoteControlAccessList RolesRemoteControl => Config.RoleRemoteControl;
1615

1716
public bool CanUseSudo(ulong uid) => SudoDiscord.Contains(uid);
1817
public bool CanUseSudo(IEnumerable<string> roles) => roles.Any(SudoRoles.Contains);
@@ -27,10 +26,6 @@ public bool GetHasRoleAccess(string type, IEnumerable<string> roles)
2726
return (set.AllowIfEmpty && set.List.Count == 0) || roles.Any(set.Contains);
2827
}
2928

30-
private RemoteControlAccessList GetSet(string type) => type switch
31-
{
32-
nameof(RolesRemoteControl) => RolesRemoteControl,
33-
_ => throw new ArgumentOutOfRangeException(nameof(type)),
34-
};
29+
private RemoteControlAccessList GetSet(string type) => throw new ArgumentOutOfRangeException(nameof(type));
3530
}
3631
}

SysBot.Pokemon/BDSP/PokeRoutineExecutor8BS.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,6 @@ public async Task CleanExit(IBotStateSettings settings, CancellationToken token)
146146
await DetachController(token).ConfigureAwait(false);
147147
}
148148

149-
protected virtual async Task EnterLinkCode(int code, PokeBotHubConfig config, CancellationToken token)
150-
{
151-
// Default implementation to just press directional arrows. Can do via Hid keys, but users are slower than bots at even the default code entry.
152-
var keys = TradeUtil.GetPresses(code);
153-
foreach (var key in keys)
154-
{
155-
int delay = config.Timings.KeypressTime;
156-
await Click(key, delay, token).ConfigureAwait(false);
157-
}
158-
// Confirm Code outside of this method (allow synchronization)
159-
}
160-
161149
public async Task ReOpenGame(bool untiloverworld, PokeBotHubConfig config, CancellationToken token)
162150
{
163151
await CloseGame(config, token).ConfigureAwait(false);

SysBot.Pokemon/LGPE/Data/PokeDataPointers7B.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

SysBot.Pokemon/LGPE/PokeRoutineExecutor7B.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace SysBot.Pokemon
1616
/// </summary>
1717
public abstract class PokeRoutineExecutor7B : PokeRoutineExecutor<PB7>
1818
{
19-
private readonly PokeDataPointers7B Pointers = new();
2019
protected PokeRoutineExecutor7B(PokeBotState cfg) : base(cfg) { }
2120

2221
public override async Task<PB7> ReadPokemon(ulong offset, CancellationToken token)
@@ -106,17 +105,13 @@ public override async Task<PB7> ReadBoxPokemon(int box, int slot, CancellationTo
106105

107106
public async Task EditTextSpeed(TextSpeed speed, CancellationToken token) => await Connection.WriteBytesAsync(new byte[] {(byte)speed}, TextSpeedOffset, token).ConfigureAwait(false);
108107

109-
public async Task<uint> ReadSpeciesCombo(CancellationToken token) =>
110-
BitConverter.ToUInt16(await SwitchConnection.PointerPeek(2, Pointers.SpeciesComboPointer, token).ConfigureAwait(false), 0);
108+
public async Task<uint> ReadSpeciesCombo(CancellationToken token) => BitConverter.ToUInt16(await Connection.ReadBytesAsync(SpeciesCombo, 2, token).ConfigureAwait(false), 0);
111109

112-
public async Task<uint> ReadComboCount(CancellationToken token) =>
113-
BitConverter.ToUInt16(await SwitchConnection.PointerPeek(2, Pointers.CatchComboPointer, token).ConfigureAwait(false), 0);
110+
public async Task<uint> ReadComboCount(CancellationToken token) => BitConverter.ToUInt16(await Connection.ReadBytesAsync(CatchCombo, 2, token).ConfigureAwait(false), 0);
114111

115-
public async Task EditSpeciesCombo(uint species, CancellationToken token) =>
116-
await SwitchConnection.PointerPoke(BitConverter.GetBytes(species), Pointers.SpeciesComboPointer, token).ConfigureAwait(false);
112+
public async Task EditSpeciesCombo(uint species, CancellationToken token) => await Connection.WriteBytesAsync(BitConverter.GetBytes(species), SpeciesCombo, token).ConfigureAwait(false);
117113

118-
public async Task EditComboCount(uint count, CancellationToken token) =>
119-
await SwitchConnection.PointerPoke(BitConverter.GetBytes(count), Pointers.CatchComboPointer, token).ConfigureAwait(false);
114+
public async Task EditComboCount(uint count, CancellationToken token) => await Connection.WriteBytesAsync(BitConverter.GetBytes(count), CatchCombo, token).ConfigureAwait(false);
120115

121116
public async Task<long> CountMilliseconds(PokeBotHubConfig config, CancellationToken token)
122117
{

SysBot.Pokemon/Settings/Integrations/DiscordSettings.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ public class DiscordSettings
3333

3434
// Whitelists
3535

36-
[Category(Roles), Description("Users with this role are allowed to remotely control the console (if running as Remote Control Bot.")]
37-
public RemoteControlAccessList RoleRemoteControl { get; set; } = new() { AllowIfEmpty = false };
38-
3936
[Category(Roles), Description("Users with this role are allowed to bypass command restrictions.")]
4037
public RemoteControlAccessList RoleSudo { get; set; } = new() { AllowIfEmpty = false };
4138

SysBot.Pokemon/Structures/ConcurrentPriorityQueue.cs

Lines changed: 0 additions & 264 deletions
This file was deleted.

0 commit comments

Comments
 (0)