banned player list made readonly, lobby fakes support

This commit is contained in:
Tomas Blaho
2017-09-20 17:16:15 +02:00
parent eb7f7f4244
commit 9c505c4f5d
3 changed files with 9 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ namespace Torch.API.Managers
/// <summary> /// <summary>
/// List of the banned SteamID's /// List of the banned SteamID's
/// </summary> /// </summary>
List<ulong> BannedPlayers { get; } IReadOnlyList<ulong> BannedPlayers { get; }
/// <summary> /// <summary>
/// Checks if the player with the given SteamID is banned. /// Checks if the player with the given SteamID is banned.

View File

@@ -10,8 +10,11 @@ using Torch.Managers;
namespace Torch.Client.Manager namespace Torch.Client.Manager
{ {
public class MultiplayerManagerLobby : MultiplayerManagerBase public class MultiplayerManagerLobby : MultiplayerManagerBase, IMultiplayerManagerServer
{ {
/// <inheritdoc />
public IReadOnlyList<ulong> BannedPlayers => new List<ulong>();
/// <inheritdoc /> /// <inheritdoc />
public MultiplayerManagerLobby(ITorchBase torch) : base(torch) { } public MultiplayerManagerLobby(ITorchBase torch) : base(torch) { }
@@ -21,6 +24,9 @@ namespace Torch.Client.Manager
/// <inheritdoc /> /// <inheritdoc />
public void BanPlayer(ulong steamId, bool banned = true) => Torch.Invoke(() => MyMultiplayer.Static.BanClient(steamId, banned)); public void BanPlayer(ulong steamId, bool banned = true) => Torch.Invoke(() => MyMultiplayer.Static.BanClient(steamId, banned));
/// <inheritdoc />
public bool IsBanned(ulong steamId) => false;
/// <inheritdoc/> /// <inheritdoc/>
public override void Attach() public override void Attach()
{ {

View File

@@ -32,7 +32,7 @@ namespace Torch.Server.Managers
#pragma warning restore 649 #pragma warning restore 649
/// <inheritdoc /> /// <inheritdoc />
public List<ulong> BannedPlayers => MySandboxGame.ConfigDedicated.Banned; public IReadOnlyList<ulong> BannedPlayers => MySandboxGame.ConfigDedicated.Banned;
private Dictionary<ulong, ulong> _gameOwnerIds = new Dictionary<ulong, ulong>(); private Dictionary<ulong, ulong> _gameOwnerIds = new Dictionary<ulong, ulong>();