Skip to content

Commit

Permalink
Why do people try to kick themselves
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleF3lix committed Aug 30, 2024
1 parent ac4cfdd commit da5334f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ public async Task packetReceived(Client sender, ClientPacket packet) {
break;
case KickPlayerPacket kickPlayerPacket:
if (sender.player.username == this.gameData.host) {
if (sender.player.username == kickPlayerPacket.username) {
await sender.sendMessage(new ActionFailedPacket { reason = "Why are you trying to kick yourself? Sounds painful." });
return;
}

// Search for the correct client and kick them
foreach (Client client in this.connectedClients) {
if (client.player != null && client.player.username == kickPlayerPacket.username) {
Expand Down

0 comments on commit da5334f

Please sign in to comment.