Пример #1
0
    // 匹配对手
    public void CombatMatching()
    {
        m_IsMatching            = true;
        m_StartMatchTime        = Time.time;
        m_BtnMatch.interactable = false;
        m_BtnCancel.gameObject.SetActive(true);
        m_TxtLog.gameObject.SetActive(true);
        m_TxtLog.text = TimeFormat(0);
        var combatMatch = new CombatMatch {
        };
        var id          = (Int16)ProtocType.CombatMatch;

        NetManager.Send(id, combatMatch);
    }
Пример #2
0
        /// <summary>
        /// Begins a combat match between the attackers and defenders.
        /// </summary>
        /// <param name="attackers">The first collection of combatants.</param>
        /// <param name="defenders">The second collection of combatants.</param>
        public static void BeginMatch(IAvatar[] attackers, IAvatar[] defenders)
        {
            var match = new CombatMatch(attackers, defenders);

            match.Completed += (e) =>
            {
                lock (_matches)
                {
                    _matches.Remove(e.ID);
                }
            };
            lock (_matches)
            {
                _matches.Add(match.ID, match);
            }
            match.Start();
        }
Пример #3
0
 private void CombatMatch(Socket cfd, CombatMatch combatMatch)
 {
     m_SysCombatRoom.JoinCombatMatch(cfd);
 }