示例#1
0
        public void MatchOver(FightQueue _this)
        {
            //检查一次排队是否有问题
            var guids  = new List <ulong>();
            var isHave = new Dictionary <ulong, int>();

            foreach (var character in _this.tempTeam1)
            {
                foreach (var data in character.mDatas)
                {
                    isHave.modifyValue(data.Id, 1);
                    guids.Add(data.Id);
                }
            }

            foreach (var character in _this.tempTeam2)
            {
                foreach (var data in character.mDatas)
                {
                    isHave.modifyValue(data.Id, 1);
                    guids.Add(data.Id);
                }
            }
            PlayerLog.WriteLog((int)LogType.QueueLog, "MatchOver characterids={0}", guids.GetDataString());
            if (isHave.Count != _this.tbQueue.CountLimit * 2)
            {
                PlayerLog.WriteLog((int)LogType.QueueLog, "MatchOver CheckId Count={0}", isHave.Count);
                foreach (var i in isHave)
                {
                    PlayerLog.WriteLog((int)LogType.QueueLog, "cId={0},cValue={1}", i.Key, i.Value);
                    QueueManager.Pop(i.Key, eLeaveMatchingType.TeamChange);
                }
            }
            //执行完毕的结果
            foreach (var character in _this.tempTeam1)
            {
                _this.PushSuccessTime((int)DateTime.Now.GetDiffSeconds(character.StartTime));
                _this.mCharacters.Remove(character);
#if DEBUG
                PlayerLog.WriteLog((int)LogType.QueueMessage, "MatchOver mCharacters.Remove c={0}, ids={1}",
                                   character.Guid, character.mDatas.Select(d => d.Id).GetDataString());
#endif
            }
            foreach (var character in _this.tempTeam2)
            {
                _this.PushSuccessTime((int)DateTime.Now.GetDiffSeconds(character.StartTime));
                _this.mCharacters.Remove(character);
#if DEBUG
                PlayerLog.WriteLog((int)LogType.QueueMessage, "MatchOver mCharacters.Remove c={0}, ids={1}",
                                   character.Guid, character.mDatas.Select(d => d.Id).GetDataString());
#endif
            }
            var result = new QueueResult(_this);
            result.PushCharacter(_this.tempTeam1);
            result.PushCharacter(_this.tempTeam2);
            result.StartTrigger();
            //results.Add(result);
            _this.tempTeam1 = new List <QueueCharacter>();
            _this.tempTeam2 = new List <QueueCharacter>();
        }
示例#2
0
        //通知匹配成功
        public void MatchOver(FubenQueue _this)
        {
            foreach (var character in _this.tempTeam)
            {
                PlayerLog.WriteLog((int)LogType.QueueMessage, "MatchOver c={0} ids={1}", character.Guid,
                                   character.mDatas.Select(d => d.Id).GetDataString());
                _this.mCharacters.Remove(character);
                _this.PushSuccessTime((int)DateTime.Now.GetDiffSeconds(character.StartTime));
            }
            var result = new QueueResult(_this);

            result.PushCharacter(_this.tempTeam);
            result.StartTrigger();
            _this.tempTeam = new List <QueueCharacter>();
        }