public static void DisbandParty(Party party) { rwLock.EnterWriteLock(); try { int partyIndex = parties.IndexOfValue(party); if (partyIndex > -1) { parties.RemoveAt(partyIndex); } } finally { rwLock.ExitWriteLock(); } foreach (Client client in party.GetOnlineMemberClients()) { if (client.IsPlaying()) { client.Player.RemoveExpKitModule(Enums.ExpKitModules.Party); client.Player.PartyID = null; Messenger.SendDisbandPartyTo(client); Messenger.PlayerMsg(client, "Your party has been disbanded!", Text.BrightRed); } } }
/// <summary> /// Removes a player from the index list based on the players index /// </summary> /// <param name="index">The index of the player to remove</param> public static void RemovePlayerFromIndexList(TcpClientIdentifier tcpID) { rwLock.EnterWriteLock(); try { int index = playerIDToTcpIDList.IndexOfValue(tcpID); if (index > -1) { playerIDToTcpIDList.RemoveAt(index); } } finally { rwLock.ExitWriteLock(); } }