Esempio n. 1
0
    public void AddMatchingPlayer(Conn conn, int uid, int roleID)
    {
        match_Queue.Add(new MatchUserInfo(uid, roleID, conn));

        if (match_Queue.Count >= ServerConfig.BattleUserNum)
        {
            List <MatchUserInfo> group = new List <MatchUserInfo>();
            for (int i = 0; i < ServerConfig.BattleUserNum; i++)
            {
                group.Add(match_Queue[0]);
                match_Queue.RemoveAt(0);
            }

            AddAction(() =>
            {
                battleMgr.CreateBattle(group);
            });
        }
    }