(61d00a474) v0.9.7.1

This commit is contained in:
Regalis
2020-03-04 13:04:10 +01:00
parent 3c50efa5c9
commit 3c09ebe02f
5086 changed files with 786063 additions and 295871 deletions
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Barotrauma.Networking
{
partial class BannedPlayer
{
public string Name;
public string IP; public bool IsRangeBan;
public UInt64 SteamID;
public string Reason;
public DateTime? ExpirationTime;
public UInt16 UniqueIdentifier;
}
partial class BanList
{
private readonly List<BannedPlayer> bannedPlayers;
public IEnumerable<string> BannedNames
{
get { return bannedPlayers.Select(bp => bp.Name); }
}
public IEnumerable<string> BannedIPs
{
get { return bannedPlayers.Select(bp => bp.IP); }
}
partial void InitProjectSpecific();
public BanList()
{
bannedPlayers = new List<BannedPlayer>();
InitProjectSpecific();
}
public static string ToRange(string ip)
{
for (int i = ip.Length - 1; i > 0; i--)
{
if (ip[i] == '.')
{
ip = ip.Substring(0, i) + ".x";
break;
}
}
return ip;
}
}
}