private void Initialize() { if (m_instance == null) { m_instance = this; new NetMsgDispatch(); new ProtocolMgr().RegAssembly(typeof(STC_UserInfo).Assembly); new GameModuleMgr(); GameModuleMgr.MInstance.AddModule(new LoginModule()); GameModuleMgr.MInstance.AddModule(new HeartBeatModule()); new GameNet(); GameNet.MInstance.onConnected = OnConnectServerResult; GameNet.MInstance.SetIpPort("127.0.0.1", 12000); GameNet.MInstance.StartConnect(); } }
public void Clear() { GameNet.MInstance.Clear(); m_instance = null; }