Exemplo n.º 1
0
        public void SendToSocketServer(byte tid, byte gid, byte uid, byte[] body)
        {
            if (Config.Detail_Debug_Log())
            {
                Debug.Log("---------send to socket server 1->" + tid + "^" + gid + "^" + uid + "^" + (body == null ? -1 : body.Length));
            }
            if (socketStatus != SocketStatus.Ready)
            {
                Debugger.LogError("socket is not connected");
                return;
            }

            byte[] dataBytes = adapter.Serialize(tid, gid, uid, body);
            if (Config.Detail_Debug_Log())
            {
                Debug.Log("---------send to socket server 2->" + (dataBytes == null ? -1 : dataBytes.Length));
            }
            SendData(dataBytes);
        }
Exemplo n.º 2
0
 public void Send(byte tid, byte gid, byte uid, byte[] data)
 {
     byte[] dataBytes = adapter.Serialize(tid, gid, uid, data);
     if (dataBytes != null && dataBytes.Length > 0)
     {
         if (netNode != null)
         {
             netNode.ReceiveData(dataBytes);
         }
     }
     else
     {
         Debugger.Log("tcp send msg is null");
     }
 }