Class ChatMessageSerializer
Serializer for chat messages with binary data.
Implements
Namespace: TehGM.Wolfringo.Messages.Serialization
Assembly: Wolfringo.Core.dll
Syntax
public class ChatMessageSerializer : IMessageSerializer
Remarks
This special serializer populates chat message's binary data collection when serializing. When deserializing, it inserts data placeholders into payload body object, and adds it to serialized message's binary data.
Methods
| Improve this Doc View SourceDeserialize(String, SerializedMessageData)
Deserializes a message.
Declaration
public IWolfMessage Deserialize(string eventName, SerializedMessageData messageData)
Parameters
Type | Name | Description |
---|---|---|
String | eventName | Message command. |
SerializedMessageData | messageData | Serialized message data. |
Returns
Type | Description |
---|---|
IWolfMessage | Deserialized message. |
GetMessageType(JToken)
Determines which type of chat message it is.
Declaration
public static Type GetMessageType(JToken messageBody)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.Linq.JToken | messageBody | Raw body object of the message payload. |
Returns
Type | Description |
---|---|
Type | Type of the chat message. |
Serialize(IWolfMessage)
Serializes a message.
Declaration
public SerializedMessageData Serialize(IWolfMessage message)
Parameters
Type | Name | Description |
---|---|---|
IWolfMessage | message | Message to serialize. |
Returns
Type | Description |
---|---|
SerializedMessageData | Serialized message data. |