Finish ban implementation

This commit is contained in:
Sanae 2022-06-17 21:18:08 -06:00
parent 561d633e40
commit 1f5ea97272
2 changed files with 3 additions and 5 deletions

View File

@ -16,6 +16,9 @@ DiscordBot bot = new DiscordBot();
bot.Run();
server.ClientJoined += (c, _) => {
if (Settings.Instance.BanList.Enabled && (Settings.Instance.BanList.Players.Contains(c.Id) || Settings.Instance.BanList.IpAddresses.Contains(
((IPEndPoint)c.Socket!.RemoteEndPoint!).Address.ToString())))
throw new Exception($"Banned player attempted join: {c.Name}");
c.Metadata["shineSync"] = new ConcurrentBag<int>();
c.Metadata["loadedSave"] = false;
c.Metadata["scenario"] = (byte?)0;

View File

@ -56,11 +56,6 @@ public class Settings {
public bool MergeEnabled { get; set; } = false;
}
public class HiddenPlayers {
public bool Enabled { get; set; } = false;
public List<Guid> Players { get; set; } = new List<Guid>();
}
public class BannedPlayers {
public bool Enabled { get; set; } = false;
public List<Guid> Players { get; set; } = new List<Guid>();