Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'staging' of https://github.com/TorchAPI/Essentials into…
… staging

# Conflicts:
#	Essentials/Commands/PlayerModule.cs
  • Loading branch information
jimmble committed Sep 23, 2017
commit 905d17e380b0698031a505b8dc06ff3d804bb48e
7 changes: 4 additions & 3 deletions Essentials/Commands/PlayerModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public void Ban(string playerName)
var steamUserId = 0ul;
if (player == null)
{

if (!ulong.TryParse(playerName, out steamUserId) || playerName.Length != 17)
{
Context.Respond("Player not found. Use !ban <steamID> to ban offline players.");
Expand All @@ -119,7 +120,7 @@ public void Ban(string playerName)
Context.Respond("Player is already banned.");
return;
}
Context.Torch.Multiplayer.BanPlayer(steamUserId);
Context.Torch.CurrentSession?.Managers?.GetManager<IMultiplayerManagerServer>()?.BanPlayer(steamUserId);
Context.Respond($"Player '{player?.DisplayName ?? steamUserId.ToString()}' banned.");
}

Expand All @@ -132,9 +133,9 @@ public void Unban(string steamIdStr)
Context.Respond($"Usage: !unban <steamID>");
return;
}
if (Context.Torch.Multiplayer.BannedPlayers.Contains(steamUserId))
if (Context.Torch.CurrentSession?.Managers?.GetManager<IMultiplayerManagerServer>()?.BannedPlayers.Contains(steamUserId))
{
Context.Torch.Multiplayer.BanPlayer(steamUserId, false);
Context.Torch.CurrentSession?.Managers?.GetManager<IMultiplayerManagerServer>()?.BanPlayer(steamUserId, false);
Context.Respond($"Player '{steamUserId}' unbanned.");
}
else
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.