add comments to playermessage, change OnlySendToServer to OnlySendToHost

This commit is contained in:
Mister_Nebula 2021-08-08 20:05:34 +01:00
parent 61ac35405e
commit 1d66baf1d8

View File

@ -5,22 +5,34 @@ namespace QSB.Messaging
{
public class PlayerMessage : QMessageBase
{
/// <summary>
/// The Player ID that is sending this message
/// </summary>
public uint FromId { get; set; }
/// <summary>
/// The Player ID that this message is about
/// </summary>
public uint AboutId { get; set; }
public bool OnlySendToServer { get; set; }
/// <summary>
/// If true, only send this message to the host of the current session
/// (OnReceiveLocal/Remote is not called on any other client)
/// </summary>
public bool OnlySendToHost { get; set; }
public override void Deserialize(QNetworkReader reader)
{
FromId = reader.ReadUInt32();
AboutId = reader.ReadUInt32();
OnlySendToServer = reader.ReadBoolean();
OnlySendToHost = reader.ReadBoolean();
}
public override void Serialize(QNetworkWriter writer)
{
writer.Write(FromId);
writer.Write(AboutId);
writer.Write(OnlySendToServer);
writer.Write(OnlySendToHost);
}
}
}