public Match(Clan clan) { this.clan = clan; for (int i = 0; i < 8; i++) { slots[i] = new SlotMatch(i); } }
public Account GetPlayerBySlot(SlotMatch slot) { try { long id = slot.playerId; return(id > 0 ? AccountManager.GetAccount(id, true) : null); } catch { return(null); } }
public bool GetSlot(int slotId, out SlotMatch slot) { lock (slots) { slot = null; if (slotId >= 0 && slotId < 16) { slot = slots[slotId]; } return(slot != null); } }
public bool AddPlayer(Account player) { lock (slots) { for (int i = 0; i < formação; i++) { SlotMatch slot = slots[i]; if (slot.playerId == 0 && slot.state == 0) { slot.playerId = player.playerId; slot.state = SlotMatchStateEnum.Normal; player.match = this; player.matchSlot = i; player.status.UpdateClanMatch((byte)friendId); player.SyncPlayerToClanMembers(); return(true); } } } return(false); }