Skip to content

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Jul 30, 2024
1 parent 51977c4 commit 60b3cfa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/GameServer/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,21 @@ public async ValueTask<bool> DisconnectPlayerAsync(string playerName)
return false;
}

/// <inheritdoc />
public async ValueTask<bool> DisconnectAccountAsync(string accountName)
{
var players = await this._gameContext.GetPlayersAsync().ConfigureAwait(false);
var player = players.FirstOrDefault(p => p.Account?.LoginName == accountName);
if (player != null)
{
await player.InvokeViewPlugInAsync<IShowMessagePlugIn>(p => p.ShowMessageAsync("You got disconnected by an administrator.", MessageType.BlueNormal)).ConfigureAwait(false);
await player.DisconnectAsync().ConfigureAwait(false);
return true;
}

return false;
}

/// <inheritdoc />
public async ValueTask<bool> BanPlayerAsync(string playerName)
{
Expand Down

0 comments on commit 60b3cfa

Please sign in to comment.