Skip to content

Commit

Permalink
fix: Restrictions on /invite
Browse files Browse the repository at this point in the history
- Don't allow a player to be invited if they exist in a different game
  mode.
- Restrict party size to 4 if gamemode is bitterblack maze.
  • Loading branch information
pacampbell committed Nov 9, 2024
1 parent d92b0b5 commit 490d605
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Arrowgene.Ddon.GameServer.Characters;
using Arrowgene.Ddon.GameServer.Handler;
using Arrowgene.Ddon.Shared.Entity.PacketStructure;
using Arrowgene.Ddon.Shared.Model;
using Arrowgene.Ddon.Shared.Network;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -43,6 +44,12 @@ public override void Execute(string[] command, GameClient client, ChatMessage me
return;
}

if (client.GameMode == GameMode.BitterblackMaze && client.Party.Members.Count >= 4)
{
responses.Add(ChatResponse.CommandError(client, "This game mode only supports 4 players."));
return;
}

if (!client.Party.GetPlayerPartyMember(client).IsLeader)
{
responses.Add(ChatResponse.CommandError(client, "Only the party leader can invite."));
Expand Down Expand Up @@ -112,6 +119,12 @@ public override void Execute(string[] command, GameClient client, ChatMessage me
return;
}

if (targetClient.GameMode != client.GameMode)
{
responses.Add(ChatResponse.CommandError(client, "You cannot invite players which are in different game modes."));
return;
}

if (client.Party.Contains(targetClient.Character))
{
responses.Add(ChatResponse.CommandError(client, "The party already contains that player."));
Expand Down

0 comments on commit 490d605

Please sign in to comment.