mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-13 07:14:19 +00:00
remove OnlySendToSpecific, just use uint.MaxValue to denote no ForId
This commit is contained in:
parent
4b4c142e20
commit
45537b8636
@ -65,7 +65,7 @@ namespace QSB.Events
|
||||
{
|
||||
_eventHandler.SendToHost(message);
|
||||
}
|
||||
else if (message.OnlySendToSpecific)
|
||||
else if (message.ForId != uint.MaxValue)
|
||||
{
|
||||
_eventHandler.SendTo(message.ForId, message);
|
||||
}
|
||||
|
@ -22,14 +22,11 @@ namespace QSB.Messaging
|
||||
public bool OnlySendToHost { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, only send this message to ForId
|
||||
/// The Player ID that this message is for.
|
||||
/// By default, this is uint.MaxValue,
|
||||
/// which means this is ignored and the message is sent to all clients
|
||||
/// </summary>
|
||||
public bool OnlySendToSpecific { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The Player ID that this message is for
|
||||
/// </summary>
|
||||
public uint ForId { get; set; }
|
||||
public uint ForId { get; set; } = uint.MaxValue;
|
||||
|
||||
public override void Deserialize(QNetworkReader reader)
|
||||
{
|
||||
@ -38,11 +35,7 @@ namespace QSB.Messaging
|
||||
OnlySendToHost = reader.ReadBoolean();
|
||||
if (!OnlySendToHost)
|
||||
{
|
||||
OnlySendToSpecific = reader.ReadBoolean();
|
||||
if (OnlySendToSpecific)
|
||||
{
|
||||
ForId = reader.ReadUInt32();
|
||||
}
|
||||
reader.ReadUInt32();
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,13 +45,9 @@ namespace QSB.Messaging
|
||||
writer.Write(AboutId);
|
||||
writer.Write(OnlySendToHost);
|
||||
if (!OnlySendToHost)
|
||||
{
|
||||
writer.Write(OnlySendToSpecific);
|
||||
if (OnlySendToSpecific)
|
||||
{
|
||||
writer.Write(ForId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user