public static ChatServerData read(BinaryReader binaryReader) { var newObj = new ChatServerData(); newObj.cbSize = binaryReader.ReadUInt32(); newObj.m_blobType = (ChatNetworkBlobType)binaryReader.ReadUInt32(); newObj.m_blobDispatchType = (AsyncMethodID)binaryReader.ReadUInt32(); newObj.m_targetType = binaryReader.ReadUInt32(); // Always 1 in pcaps newObj.m_targetID = binaryReader.ReadUInt32(); newObj.m_transportType = binaryReader.ReadUInt32(); // Pcaps contain either a 0 or a 1 (Perhaps ChatEventType?) newObj.m_transportID = binaryReader.ReadUInt32(); newObj.m_cookie = binaryReader.ReadUInt32(); // Always 0 in pcaps if (newObj.m_blobType == ChatNetworkBlobType.NETBLOB_EVENT_BINARY) // Server to client { newObj.sendToRoomChatEvent = SendToRoomChatEvent.read(binaryReader); } else if (newObj.m_blobType == ChatNetworkBlobType.NETBLOB_REQUEST_BINARY) // Client to server { newObj.request = Request.read(binaryReader, newObj.m_blobDispatchType); } else if (newObj.m_blobType == ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY) // Server to client acknowledgement { newObj.response = Response.read(binaryReader); } return(newObj); }
public static ChatServerData read(BinaryReader binaryReader) { var newObj = new ChatServerData(); newObj.Size = binaryReader.ReadUInt32(); newObj.TurbineChatType = binaryReader.ReadUInt32(); newObj.Unknown_1 = binaryReader.ReadUInt32(); newObj.Unknown_2 = binaryReader.ReadUInt32(); newObj.Unknown_3 = binaryReader.ReadUInt32(); newObj.Unknown_4 = binaryReader.ReadUInt32(); newObj.Unknown_5 = binaryReader.ReadUInt32(); newObj.Unknown_6 = binaryReader.ReadUInt32(); newObj.PayloadSize = binaryReader.ReadUInt32(); if (newObj.TurbineChatType == 0x01) { newObj.Channel = binaryReader.ReadUInt32(); var messageLen = binaryReader.ReadByte(); var messageBytes = binaryReader.ReadBytes(messageLen * 2); newObj.SenderName = Encoding.Unicode.GetString(messageBytes); messageLen = binaryReader.ReadByte(); messageBytes = binaryReader.ReadBytes(messageLen * 2); newObj.Message = Encoding.Unicode.GetString(messageBytes); newObj.Unknown01_1 = binaryReader.ReadUInt32(); newObj.Sender = binaryReader.ReadUInt32(); newObj.Unknown01_2 = binaryReader.ReadUInt32(); newObj.Unknown01_3 = binaryReader.ReadUInt32(); } else if (newObj.TurbineChatType == 0x03) { newObj.Unknown03_1 = binaryReader.ReadUInt32(); newObj.Unknown03_2 = binaryReader.ReadUInt32(); newObj.Unknown03_3 = binaryReader.ReadUInt32(); newObj.OutChannel = binaryReader.ReadUInt32(); var messageLen = binaryReader.ReadByte(); var messageBytes = binaryReader.ReadBytes(messageLen * 2); newObj.OutText = Encoding.Unicode.GetString(messageBytes); newObj.Unknown03_4 = binaryReader.ReadUInt32(); newObj.OutSender = binaryReader.ReadUInt32(); newObj.Unknown03_5 = binaryReader.ReadUInt32(); newObj.Unknown03_6 = binaryReader.ReadUInt32(); } else if (newObj.TurbineChatType == 0x05) { newObj.Unknown05_1 = binaryReader.ReadUInt32(); newObj.Unknown05_2 = binaryReader.ReadUInt32(); newObj.Unknown05_3 = binaryReader.ReadUInt32(); newObj.Unknown05_4 = binaryReader.ReadUInt32(); } return(newObj); }
public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView) { bool handled = true; PacketOpcode opcode = Util.readOpcode(messageDataReader); switch (opcode) { case PacketOpcode.Evt_Admin__ChatServerData_ID: // 0xF7DE { var message = ChatServerData.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } default: { handled = false; break; } } return(handled); }