// Use this for initialization void Start() { CreateInstance(this); DontDestroyOnLoad(this); H5Manager.Instance().GetGameSessionResetCallBack().Add(OnGameSessionReset); if (H5Manager.Instance().GetGameSession() != null) { OnGameSessionReset(H5Manager.Instance().GetGameSession()); } }
public void OnLoginAckPlayerGameStart(byte[] pBuf) { GameProto.LoginAckPlayerGameStart oRet = GameProto.LoginAckPlayerGameStart.Parser.ParseFrom(pBuf); if (oRet == null) { H5Helper.H5LogStr("OnLoginAckPlayerGameStart error parse"); return; } H5Helper.H5LogStr("game start : " + oRet.DwResult.ToString()); H5Manager.Instance().ConnectGame(oRet.SzListenIp, (ushort)oRet.DwPlayerPort); }
public void OnDestroy() { if (m_pSession != null) { m_pSession.m_pfOnConnect.Remove(OnConnect); m_pSession.m_pfOnError.Remove(OnError); m_pSession.m_pfOnClose.Remove(OnClose); m_pSession.UnRegistMessage("GameProto.PlayerRequestGameTest"); } H5Manager.Instance().GetGameSessionResetCallBack().Remove(OnGameSessionReset); }
public void OnDestroy() { if (m_pSession != null) { m_pSession.m_pfOnConnect.Remove(OnConnect); m_pSession.m_pfOnError.Remove(OnError); m_pSession.m_pfOnClose.Remove(OnClose); m_pSession.UnRegistMessage("GameProto.LoginAckPlayerServerId"); m_pSession.UnRegistMessage("GameProto.LoginAckPlayerLoginResult"); m_pSession.UnRegistMessage("GameProto.LoginAckPlayerMakeTeam"); m_pSession.UnRegistMessage("GameProto.LoginAckPlayerGameStart"); } H5Manager.Instance().GetLoginSessionResetCallBack().Remove(OnLoginSessionReset); }
public void InvitePlayer() { GameProto.PlayerRequestLoginInviteTeam oTeam = new GameProto.PlayerRequestLoginInviteTeam(); oTeam.QwPlayerId = m_qwPlayerId; byte[] pData = new byte[1024]; FxNet.NetStream pStream = new FxNet.NetStream(FxNet.NetStream.ENetStreamType.ENetStreamType_Write, pData, 1024); pStream.WriteString("GameProto.PlayerRequestLoginInviteTeam"); byte[] pProto = new byte[oTeam.CalculateSize()]; Google.Protobuf.CodedOutputStream oStream = new Google.Protobuf.CodedOutputStream(pProto); oTeam.WriteTo(oStream); pStream.WriteData(pProto, (uint)pProto.Length); H5Manager.Instance().GetLoginSession().Send(pData, 1024 - pStream.GetLeftLen()); //m_pSession.Send(pData, 1024 - pStream.GetLeftLen()); }
public void OnLoginAckPlayerLoginResult(byte[] pBuf) { GameProto.LoginAckPlayerLoginResult oRet = GameProto.LoginAckPlayerLoginResult.Parser.ParseFrom(pBuf); if (oRet == null) { SampleDebuger.Log("OnTest error parse"); return; } SampleDebuger.Log("login ret : " + oRet.DwResult.ToString()); AssetBundleLoader.Instance().LoadLevelAsset(GameConstant.g_szLobbyScene, delegate() { if (!string.IsNullOrEmpty(PlayerData.Instance().proGameIp)) { H5Manager.Instance().ConnectGame(PlayerData.Instance().proGameIp, PlayerData.Instance().proGamePort); } } ); }
// Use this for initialization void Start() { H5Manager.Instance().GetLoginSessionResetCallBack().Add(OnLoginSessionReset); }
public void GameStart() { H5Manager.Instance().ConnectLogin(); }
public void GameStart() { GameInstance.Instance().SetServerInfo(m_pServerInfo); H5Manager.Instance().ConnectLogin(); }
// Use this for initialization void Start() { CreateInstance(this); DontDestroyOnLoad(this); H5Manager.Instance().GetLoginSessionResetCallBack().Add(OnLoginSessionReset); }
// Use this for initialization void Start() { DontDestroyOnLoad(this); H5Manager.Instance().GetGameSessionResetCallBack().Add(OnGameSessionReset); }