quantum-space-buddies/QSB/Player/Messages/PlayerHeartbeatMessage.cs
2022-08-24 18:28:42 -07:00

21 lines
388 B
C#

using QSB.Messaging;
namespace QSB.Player.Messages;
internal class PlayerHeartbeatMessage : QSBMessage
{
public override void OnReceiveRemote()
{
if (!QSBCore.IsHost)
{
// send a response back to the host
new PlayerHeartbeatMessage { To = 0 }.Send();
}
else
{
// note that we got a response
QSBPlayerManager.GetPlayer(From).HeartbeatReceived = true;
}
}
}