Beispiel #1
0
        //移除玩家的排队信息
        public void Remove(ulong guid, eLeaveMatchingType type)
        {
            var result = QueueManager.Characters.Remove(guid);

            PlayerLog.WriteLog((int)LogType.QueueMessage, "Remove().Matching remove id={0},type={1},result={2}", guid,
                               type, result);
            TeamServer.Instance.ServerControl.TeamServerMessage(guid, (int)type, string.Empty);
        }
Beispiel #2
0
        public void Pop(QueueLogic _this, QueueCharacter character, eLeaveMatchingType type)
        {
            _this.mCharacters.Remove(character);
#if DEBUG
            PlayerLog.WriteLog((int)LogType.QueueMessage, "Pop mCharacters.Remove c={0}, ids={1}, type={2}",
                               character.Guid, character.mDatas.Select(d => d.Id).GetDataString(), type);
#endif
            if (_this.mCharacters.Count == 0)
            {
                StopTrigger(_this);
            }
        }
Beispiel #3
0
        //压到队伍前列
        public void PushFront(QueueResultBase _this, eLeaveMatchingType type = eLeaveMatchingType.Unknow)
        {
            foreach (var team in _this.mTeamList)          //所有队伍 -》临时队伍
            {
                foreach (var character in team)            //临时队伍-》单独排队
                {
                    foreach (var data in character.mDatas) //单独排队 -》 一个玩家
                    {
                        if (type != eLeaveMatchingType.Unknow)
                        {
                            TeamServer.Instance.ServerControl.TeamServerMessage(data.Id, (int)type, string.Empty);
                        }
                    }

                    _this.mQueue.PushFront(character);
                }
            }
        }
Beispiel #4
0
 //移除玩家的排队信息
 public static void Remove(ulong guid, eLeaveMatchingType type)
 {
     mStaticImpl.Remove(guid, type);
 }
Beispiel #5
0
 //结束排队
 public static void Pop(ulong guid, eLeaveMatchingType type)
 {
     mStaticImpl.Pop(guid, type);
 }
Beispiel #6
0
        //结束排队
        public void Pop(ulong guid, eLeaveMatchingType type)
        {
            PlayerLog.WriteLog((int)LogType.QueueMessage, "Pop  character={0},type={1}", guid, type);
            var character = GetMatchingCharacter(guid);

            if (character == null)
            {
                return;
            }
            if (type != eLeaveMatchingType.Success)
            {
                if (character.result != null)
                {
                    character.result.StopTrigger();
                    character.result.RemoveCharacterOne(character);
                }
            }
            switch (type)
            {
            case eLeaveMatchingType.Unknow:
                break;

            case eLeaveMatchingType.TimeOut:
                break;

            case eLeaveMatchingType.TeamOther:
                break;

            case eLeaveMatchingType.Refuse:
            {
                foreach (var matchingCharacter in character.mDatas)
                {
                    //characters.Remove(matchingCharacter.Id);
                    if (matchingCharacter.Id == guid)
                    {
                        Remove(matchingCharacter.Id, eLeaveMatchingType.Refuse);
                        //TeamServer.Instance.ServerControl.TeamServerMessage(guid, (int)eLeaveMatchingType.Refuse, TeamServer.Instance);
                    }
                    else
                    {
                        Remove(matchingCharacter.Id, eLeaveMatchingType.TeamRefuse);
                        //TeamServer.Instance.ServerControl.TeamServerMessage(matchingCharacter.Id, (int)eLeaveMatchingType.TeamRefuse, TeamServer.Instance);
                    }
                }
            }
            break;

            case eLeaveMatchingType.TeamRefuse:
                break;

            case eLeaveMatchingType.Cannel:
            case eLeaveMatchingType.PushCannel:
            case eLeaveMatchingType.MatchingBackCannel:
            {
#if DEBUG
                PlayerLog.WriteLog((int)LogType.QueueMessage,
                                   "Pop().Matching remove character={0} c={1} ids={2} type={3}",
                                   guid, character.Guid, character.mDatas.Select(d => d.Id).GetDataString(), type);
#endif
                QueueManager.Characters.Remove(guid);
                foreach (var matchingCharacter in character.mDatas)
                {
                    if (matchingCharacter.Id != guid)
                    {
                        Remove(matchingCharacter.Id, eLeaveMatchingType.TeamCannel);
                    }
                }
            }
            break;

            case eLeaveMatchingType.TeamCannel:
                break;

            case eLeaveMatchingType.TeamChange:
                foreach (var matchingCharacter in character.mDatas)
                {
                    Remove(matchingCharacter.Id, eLeaveMatchingType.TeamChange);
                }
                break;

            case eLeaveMatchingType.InTemp:
                break;

            case eLeaveMatchingType.Onlost:
#if DEBUG
                PlayerLog.WriteLog((int)LogType.QueueMessage,
                                   "Pop().Matching remove character={0} c={1} ids={2} type={3}",
                                   guid, character.Guid, character.mDatas.Select(d => d.Id).GetDataString(), type);
#endif
                QueueManager.Characters.Remove(guid);
                break;

            case eLeaveMatchingType.OtherRefuse:
                break;

            case eLeaveMatchingType.Success:
                foreach (var matchingCharacter in character.mDatas)
                {
                    Remove(matchingCharacter.Id, type);
                    //characters.Remove(matchingCharacter.Id);
                }
                break;

            default:
                throw new ArgumentOutOfRangeException("type");
            }
            character.mLogic.Pop(character, type);
        }
Beispiel #7
0
 //压到队伍前列
 public void PushFront(eLeaveMatchingType type = eLeaveMatchingType.Unknow)
 {
     mImpl.PushFront(this, type);
 }
Beispiel #8
0
 public void Pop(QueueCharacter character, eLeaveMatchingType type)
 {
     mImpl.Pop(this, character, type);
 }