v0.10.5.1
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Barotrauma.Steam;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -7,11 +8,17 @@ namespace Barotrauma.Networking
|
||||
partial class BannedPlayer
|
||||
{
|
||||
public string Name;
|
||||
public string IP; public bool IsRangeBan;
|
||||
public string EndPoint; public bool IsRangeBan;
|
||||
public UInt64 SteamID;
|
||||
public string Reason;
|
||||
public DateTime? ExpirationTime;
|
||||
public UInt16 UniqueIdentifier;
|
||||
|
||||
private void ParseEndPointAsSteamId()
|
||||
{
|
||||
ulong endPointAsSteamId = SteamManager.SteamIDStringToUInt64(EndPoint);
|
||||
if (endPointAsSteamId != 0 && SteamID == 0) { SteamID = endPointAsSteamId; }
|
||||
}
|
||||
}
|
||||
|
||||
partial class BanList
|
||||
@@ -22,9 +29,9 @@ namespace Barotrauma.Networking
|
||||
get { return bannedPlayers.Select(bp => bp.Name); }
|
||||
}
|
||||
|
||||
public IEnumerable<string> BannedIPs
|
||||
public IEnumerable<string> BannedEndPoints
|
||||
{
|
||||
get { return bannedPlayers.Select(bp => bp.IP); }
|
||||
get { return bannedPlayers.Select(bp => bp.EndPoint).Where(endPoint => !string.IsNullOrEmpty(endPoint)); }
|
||||
}
|
||||
|
||||
partial void InitProjectSpecific();
|
||||
@@ -38,6 +45,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
public static string ToRange(string ip)
|
||||
{
|
||||
if (SteamManager.SteamIDStringToUInt64(ip) != 0) { return ip; }
|
||||
for (int i = ip.Length - 1; i > 0; i--)
|
||||
{
|
||||
if (ip[i] == '.')
|
||||
|
||||
Reference in New Issue
Block a user