using UnityEngine.Networking;
namespace Cyber.Networking.Messages {
///
/// Generic Text Message for chat etc.
/// To be removed later when no longer necessary.
///
public class TextMessagePkt : MessageBase {
///
/// Message inside the Text Message. Does not container sender information.
///
public string Message;
///
/// Create a TextMessage containing the message to be sent.
///
/// Message to be sent.
public TextMessagePkt(string message) {
this.Message = message;
}
///
/// Parameter-less constructor using when deserializing the message.
///
public TextMessagePkt() {
}
///
/// Used to deserialize a message received via networking.
///
///
public override void Deserialize(NetworkReader reader) {
Message = reader.ReadString();
}
///
/// Used to serialize the message before it is sent.
///
///
public override void Serialize(NetworkWriter writer) {
writer.Write(Message);
}
}
}