Exemplo n.º 1
0
        //登录服消息返回
        private void SC_LoginRst(WfPacket packet)
        {
            //获取登录服务器信息
            SC_LoginRst pak = PooledClassManagerHF <SC_LoginRst> .CreateClass();

            pak.DeSerialize(packet);
            int result = pak.m_rst;

            if (result == 0)
            {
                m_Login.m_GameServers.Clear();
                GameServerInfo info = new GameServerInfo();
                info.m_szIp      = m_Login.m_LoginInfo.m_szIp;
                info.m_iPort     = 24000;
                info.m_SessionId = pak.m_sessionid;
                m_Login.m_GameServers.Add(info);
                Debug.Log("获取服务器信息成功:" + info.m_SessionId);

                m_LoginRst = emLoginResult.emLoginResult_OK;
                CGameProcedure.SetProcedureStatus((int)LoginStatus.LoginRst_Ok);

                //连接游戏服务器
                //StartLoginGame();
            }
            else
            {
                m_LoginRst = emLoginResult.emLoginResult_Failed;
                CGameProcedure.SetProcedureStatus((int)LoginStatus.LoginRst_Ok);
                Debug.LogError("登录失败");
            }

            pak.DestroyClass();
        }
Exemplo n.º 2
0
 public override void Update()
 {
     if (msg == null)
     {
         msg = new SC_LoginRst();
     }
     if (m_count < 10)
     {
         m_count++;
         return;
     }
     m_count = 0;
     for (int i = 0; i < 10; ++i)
     {
         //NetworkManagerHF.SendPacketToMe(msg, (ushort)emPacket_Login.EM_SC_LoginRst);
     }
 }