Esempio n. 1
0
        public void SendLuaData(ushort protocol, byte[] data)
        {
#if UNITY_EDITOR
            if (GlobalConfig.Instance.IsDebugMode)
            {
                GameDebug.Log(string.Format("C------>S:{0},({1},{2}) ", protocol, mServerIP, mServerPort));
            }
#elif TEST_HOST && UNITY_ANDROID
            GameDebug.Log(string.Format("C------>S:{0},({1},{2}) ", protocol, mServerIP, mServerPort));
#endif
            var c2sPackBase = new C2SPackBase(protocol);
            var sendData    = c2sPackBase.SerializeLuaPack(data);
            SendData(sendData);

#if UNITY_STANDALONE_WIN
            Game.Instance.PackRecorder.RecordSendPack(protocol, sendData);
#endif
        }
Esempio n. 2
0
        public void SendData <T>(ushort protocol, T c2sPack)
        {
#if UNITY_EDITOR
            if (GlobalConfig.Instance.IsDebugMode)
            {
                GameDebug.Log(string.Format("C------>S:{0},({1},{2}) ", protocol, mServerIP, mServerPort));
            }
#elif TEST_HOST && UNITY_ANDROID
            var pack_recorder = xc.Game.Instance.PackRecorder;
            if (!pack_recorder.NotRecordDict.ContainsKey(protocol))
            {
                GameDebug.Log(string.Format("C------>S:{0},({1},{2}) ", protocol, mServerIP, mServerPort));
            }
#endif

            C2SPackBase c2sPackBase = new C2SPackBase(protocol);
            byte[]      sendData    = c2sPackBase.SerializePack(c2sPack);
            SendData(sendData);

#if UNITY_STANDALONE_WIN
            Game.Instance.PackRecorder.RecordSendPack(protocol, sendData);
#endif
        }