Finish ban implementation
This commit is contained in:
parent
561d633e40
commit
1f5ea97272
|
@ -16,6 +16,9 @@ DiscordBot bot = new DiscordBot();
|
||||||
bot.Run();
|
bot.Run();
|
||||||
|
|
||||||
server.ClientJoined += (c, _) => {
|
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["shineSync"] = new ConcurrentBag<int>();
|
||||||
c.Metadata["loadedSave"] = false;
|
c.Metadata["loadedSave"] = false;
|
||||||
c.Metadata["scenario"] = (byte?)0;
|
c.Metadata["scenario"] = (byte?)0;
|
||||||
|
|
|
@ -56,11 +56,6 @@ public class Settings {
|
||||||
public bool MergeEnabled { get; set; } = false;
|
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 class BannedPlayers {
|
||||||
public bool Enabled { get; set; } = false;
|
public bool Enabled { get; set; } = false;
|
||||||
public List<Guid> Players { get; set; } = new List<Guid>();
|
public List<Guid> Players { get; set; } = new List<Guid>();
|
||||||
|
|
Loading…
Reference in New Issue