Esempio n. 1
0
    public void Connect(ScWorldServerInfo server)
    {
        if (server == null)
        {
            Logger.LogError("Module_Chat::Connect: Invalid server!");
            return;
        }

        server.CopyTo(m_server);

        UpdateServer(m_server.host, m_server.port);

        session.RemoveEventListener(Events.SESSION_LOST_CONNECTION, OnLostConnection);

        m_useGameSession = false;
        if (host == session.host && port == session.port)
        {
            m_useGameSession = true;

            session.AddEventListener(Events.SESSION_LOST_CONNECTION, OnLostConnection);
            OnConnected();
        }
        else
        {
            Connect();
        }
    }
Esempio n. 2
0
 void _Packet(ScWorldServerInfo p)
 {
     moduleFriend.GetAllChatInfo = true;
     m_serverRoleId = 0;
     if (p.roleId == 0)
     {
         Logger.LogError("roleid is {0}", p.roleId);
     }
     m_serverRoleId = p.roleId;
     Connect(p);
 }
Esempio n. 3
0
 protected override void OnModuleCreated()
 {
     m_server = PacketObject.Create <ScWorldServerInfo>();
 }