Exemple #1
0
        private void OnDisconnect(MobaMessage msg)
        {
            PeerDisconnectedMessage peerDisconnectedMessage = msg.Param as PeerDisconnectedMessage;
            MobaPeerType            peerType = peerDisconnectedMessage.PeerType;

            this.OnDisconnectServer(peerType);
        }
 protected override void OnConnectServer(MobaPeerType type)
 {
     base.OnConnectServer(type);
     if (type == MobaPeerType.C2PvpServer)
     {
         PvpStartGameInfo loginInfo = Singleton <PvpManager> .Instance.LoginInfo;
         if (Singleton <PvpManager> .Instance.IsObserver)
         {
             PvpStateBase.LogState("send C2P_LoginAsViewer");
             SendMsgManager.Instance.SendPvpLoginMsgBase <C2PLoginAsViewer>(PvpCode.C2P_LoginAsViewer, new C2PLoginAsViewer
             {
                 newUid = int.Parse(ModelManager.Instance.Get_userData_X().UserId),
                 roomId = loginInfo.roomId
             }, loginInfo.roomId);
         }
         else
         {
             PvpStateBase.LogState("send C2P_LoginFight");
             SendMsgManager.Instance.SendPvpLoginMsgBase <C2PLoginFight>(PvpCode.C2P_LoginFight, new C2PLoginFight
             {
                 roomId = loginInfo.roomId,
                 newUid = loginInfo.newUid,
                 newkey = loginInfo.newKey
             }, loginInfo.roomId);
         }
     }
 }
 protected override void OnDisconnectServer(MobaPeerType type)
 {
     base.OnDisconnectServer(type);
     if (type == MobaPeerType.C2PvpServer)
     {
     }
 }
 protected override void OnDisconnectServer(MobaPeerType type)
 {
     base.OnDisconnectServer(type);
     if (type == MobaPeerType.C2GateServer)
     {
         PvpStateManager.Instance.ChangeState(new PvpStateRecover(PvpStateCode.PvpInQueue));
     }
 }
Exemple #5
0
 public MobaPeer(ConnectionProtocol protocolType, PhotonClient client, MobaPeerType peerType) : base(protocolType)
 {
     this.mClient         = client;
     this.mPeerType       = peerType;
     this.mEventHandles   = new Dictionary <byte, INetEventHandleBase>();
     this.mConnectedTimes = 0;
     this.mIsReconnect    = false;
     this.ServerConnected = false;
 }
Exemple #6
0
 protected override void OnDisconnectServer(MobaPeerType type)
 {
     if (GameManager.Instance.ReplayController.IsReplayStart)
     {
         return;
     }
     base.OnDisconnectServer(type);
     if (type == MobaPeerType.C2PvpServer)
     {
         PvpStateManager.Instance.ChangeState(new PvpStateRecover(PvpStateCode.PvpLoad));
     }
 }
 protected override void OnDisconnectServer(MobaPeerType type)
 {
     base.OnDisconnectServer(type);
     if (this._isGsConnected && type == MobaPeerType.C2GateServer)
     {
         PvpStateManager.Instance.ChangeState(new PvpStateRecover(PvpStateCode.PvpSelectHero));
     }
     if (!this._isGsConnected && type == MobaPeerType.C2PvpServer)
     {
         PvpStateManager.Instance.ChangeState(new PvpStateRecover(PvpStateCode.PvpLoad));
     }
 }
Exemple #8
0
        private void OnConnect(MobaMessage msg)
        {
            PeerConnectedMessage peerConnectedMessage = msg.Param as PeerConnectedMessage;
            MobaPeerType         peerType             = peerConnectedMessage.PeerType;

            if (peerConnectedMessage.ConnectedType == MobaConnectedType.ExceptionOnConnect)
            {
                return;
            }
            if (peerConnectedMessage.PeerType == MobaPeerType.C2GateServer)
            {
                return;
            }
            this.OnConnectServer(peerType);
        }
Exemple #9
0
 protected override void OnConnectServer(MobaPeerType type)
 {
     base.OnConnectServer(type);
     if (type == MobaPeerType.C2PvpServer)
     {
         PvpStartGameInfo loginInfo = Singleton <PvpManager> .Instance.LoginInfo;
         PvpStateBase.LogState("newbie send C2P_LoginFight");
         SendMsgManager.Instance.SendPvpLoginMsgBase <C2PLoginFight>(PvpCode.C2P_LoginFight, new C2PLoginFight
         {
             roomId = loginInfo.roomId,
             newUid = loginInfo.newUid,
             newkey = loginInfo.newKey
         }, loginInfo.roomId);
     }
 }
        protected override void OnConnectServer(MobaPeerType type)
        {
            string curLevelId = LevelManager.CurLevelId;

            base.OnConnectServer(type);
            if (type == MobaPeerType.C2PvpServer)
            {
                List <EntityVo>      heroes   = LevelManager.GetHeroes(TeamType.LM);
                int                  battleId = int.Parse(curLevelId);
                List <PvePlayerInfo> list     = new List <PvePlayerInfo>();
                foreach (EntityVo current in heroes)
                {
                    HeroInfoData hero = new HeroInfoData
                    {
                        EpMagic   = string.Empty,
                        ModelId   = current.npc_id,
                        SkillList = null,
                        Skins     = string.Empty
                    };
                    HeroInfo heroInfo = new HeroInfo
                    {
                        heroId = current.npc_id,
                        Hero   = hero
                    };
                    PvePlayerInfo item = new PvePlayerInfo
                    {
                        heroInfo       = heroInfo,
                        heroSkinId     = string.Empty,
                        selfDefSkillId = string.Empty,
                        talentInfo     = null,
                        userName       = current.npc_id
                    };
                    list.Add(item);
                }
                SendMsgManager.Instance.SendPvpLoginMsgBase <C2PLoginPve>(PvpCode.C2P_LoginPve, new C2PLoginPve
                {
                    battleId  = battleId,
                    pvePlayer = list,
                    roomId    = this._roomId
                }, this._roomId);
            }
        }
 protected override void OnConnectServer(MobaPeerType type)
 {
     base.OnConnectServer(type);
     if (this._resend)
     {
         if (type == MobaPeerType.C2PvpServer)
         {
             PvpStartGameInfo loginInfo = Singleton <PvpManager> .Instance.LoginInfo;
             base.SayHelloToPs((!Singleton <PvpManager> .Instance.IsObserver) ? PvpCode.C2P_BackGame : PvpCode.C2P_LoginAsViewer);
         }
         else
         {
             base.QueryGsPvpState();
         }
     }
     else if (type == MobaPeerType.C2PvpServer)
     {
         PvpStartGameInfo loginInfo2 = Singleton <PvpManager> .Instance.LoginInfo;
         base.SayHelloToPs((!Singleton <PvpManager> .Instance.IsObserver) ? PvpCode.C2P_BackGame : PvpCode.C2P_LoginAsViewer);
     }
 }
 public LoginStateBase(LoginStateCode code, MobaPeerType peer)
 {
     this.LoginCode = code;
     this.PeerType  = peer;
 }
 protected override void OnDisconnectServer(MobaPeerType type)
 {
     this._resend = ((type == MobaPeerType.C2PvpServer && base.CurrentLink == PvpStateRecoverBase.ActiveLink.PvpServer) || (type == MobaPeerType.C2GateServer && base.CurrentLink == PvpStateRecoverBase.ActiveLink.GateServer));
 }
Exemple #14
0
 public PeerConnectedMessage(MobaPeerType pType, MobaConnectedType cType)
 {
     this.PeerType      = pType;
     this.ConnectedType = cType;
 }
Exemple #15
0
 protected virtual void OnDisconnectServer(MobaPeerType type)
 {
 }
 public PeerStatusChangedMessage(MobaPeerType pType, StatusCode sCode)
 {
     this.PeerType = pType;
     this.StatCode = sCode;
 }
Exemple #17
0
 protected override void OnDisconnectServer(MobaPeerType type)
 {
     base.OnDisconnectServer(type);
 }
 public PeerDisconnectedMessage(MobaPeerType pType, MobaDisconnectedType dType)
 {
     this.PeerType         = pType;
     this.DisconnectedType = dType;
 }
 protected override void OnConnectServer(MobaPeerType type)
 {
     base.OnConnectServer(type);
     this.SendQuery();
 }