/// <summary> /// 记录接收服务器的消息数据 /// </summary> /// <param name='id'> /// 消息类型 /// </param> /// <param name='bytes'> /// 消息的字节数组 /// </param> public static void NetworkServer(ushort id, byte[] bytes) { if (MsgID.SkipLog(id)) { return; } string s = MsgID.ToString(id); s += (" 长度: " + bytes.Length); s += " 数据:"; for (int i = 0; i < bytes.Length; ++i) { s += (" " + bytes[i].ToString("X2")); } //Debug.Log(s); NetworkServer(s); }
/// <summary> /// 记录客户端发送的消息数据 /// </summary> /// <param name='id'> /// 消息类型 /// </param> /// <param name='bytes'> /// 消息的字节数组 /// </param> public static void NetworkClient(ushort id, byte[] bytes) { if (MsgID.SkipLog(id)) { //return; } string s = MsgID.ToString(id); s += (" 长度: " + bytes.Length); s += " 数据:"; for (int i = 0; i < bytes.Length; ++i) { s += (" " + bytes[i].ToString("X2")); } NetworkClient(s); }