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(); } }
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); }
protected override void OnModuleCreated() { m_server = PacketObject.Create <ScWorldServerInfo>(); }