Exemplo n.º 1
0
    /// <summary>
    /// 初始化网络模块
    /// </summary>
    public void InitNetWork()
    {
        if (mbNetInit)
        {
            mClientNet.ShutDown();
            mClientNet.UnInit();
        }

        try
        {
            InitVerify();

            mbNetInit   = mClientNet.Init(GlobalData.mDeviceMac, null, null);
            mGameSock   = mClientNet.GetGameSock();
            mGameClient = mClientNet.GetGameClient();
            mGameRecv   = mGameSock.GetGameReceiver();
            mGameSender = mGameSock.GetGameSender();
            GameCommand.SetSender(mGameSender);
        }
        catch (System.Exception e)
        {
            LogSystem.LogError("InitNetWork::", e.ToString());
        }
    }