quantum-space-buddies/QSB/ConversationSync/Events/ConversationMessage.cs

28 lines
659 B
C#
Raw Normal View History

2020-09-22 20:11:29 +00:00
using QSB.Messaging;
using QuantumUNET.Transport;
2020-09-22 20:11:29 +00:00
2020-11-03 17:56:48 +00:00
namespace QSB.ConversationSync.Events
2020-09-22 20:11:29 +00:00
{
2020-12-02 21:23:01 +00:00
public class ConversationMessage : PlayerMessage
{
public ConversationType Type { get; set; }
public int ObjectId { get; set; }
public string Message { get; set; }
2020-09-22 20:11:29 +00:00
2020-12-04 09:23:27 +00:00
public override void Deserialize(QSBNetworkReader reader)
2020-12-02 21:23:01 +00:00
{
base.Deserialize(reader);
ObjectId = reader.ReadInt32();
Type = (ConversationType)reader.ReadInt32();
Message = reader.ReadString();
}
2020-09-22 20:11:29 +00:00
2020-12-04 09:23:27 +00:00
public override void Serialize(QSBNetworkWriter writer)
2020-12-02 21:23:01 +00:00
{
base.Serialize(writer);
writer.Write(ObjectId);
writer.Write((int)Type);
writer.Write(Message);
}
}
2020-12-03 08:28:05 +00:00
}