예제 #1
0
 public Match(Clan clan)
 {
     this.clan = clan;
     for (int i = 0; i < 8; i++)
     {
         slots[i] = new SlotMatch(i);
     }
 }
예제 #2
0
 public Account GetPlayerBySlot(SlotMatch slot)
 {
     try
     {
         long id = slot.playerId;
         return(id > 0 ? AccountManager.GetAccount(id, true) : null);
     }
     catch
     {
         return(null);
     }
 }
예제 #3
0
 public bool GetSlot(int slotId, out SlotMatch slot)
 {
     lock (slots)
     {
         slot = null;
         if (slotId >= 0 && slotId < 16)
         {
             slot = slots[slotId];
         }
         return(slot != null);
     }
 }
예제 #4
0
 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);
 }