Esempio n. 1
0
        public PlayerNet()
        {
            mxReciver = new PlayerReciver(this);
            mxSender  = new PlayerSender(this);
            mxNet     = new AFCNet();

            mxReciver.Init();
        }
Esempio n. 2
0
        private void EGMI_ACK_SELECT_SERVER(MsgHead head, MemoryStream stream)
        {
            AFMsg.AckEventResult xData = new AFMsg.AckEventResult();
            xData = AFMsg.AckEventResult.Parser.ParseFrom(stream);
            //ReceiveMsg(stream, ref xData);

            if (xData.EventCode == EGameEventCode.EgecSelectserverSuccess)
            {
                PlayerSender sender = mxPlayerNet.mxSender;
                if (null != sender)
                {
                    sender.RequireRoleList(mxPlayerNet.strAccount, mxPlayerNet.nServerID);
                }
            }
        }
Esempio n. 3
0
        private void EGMI_ACK_CONNECT_KEY(MsgHead head, MemoryStream stream)
        {
            AFMsg.AckEventResult xData = new AFMsg.AckEventResult();
            xData = AFMsg.AckEventResult.Parser.ParseFrom(stream);
            //ReceiveMsg(stream, ref xData);

            if (xData.EventCode == EGameEventCode.EgecVerifyKeySuccess)
            {
                //验证成功
                mxPlayerNet.ChangePlayerState(PlayerNet.PLAYER_STATE.E_VERIFY_KEY_SUCCESS_FULL);
                mxPlayerNet.nMainRoleID = PBToAF(xData.EventObject);

                //申请世界内的服务器列表
                PlayerSender sender = mxPlayerNet.mxSender;
                if (null != sender)
                {
                    sender.RequireServerList();
                }
            }
        }