mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-16 16:15:24 +00:00
21 lines
388 B
C#
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;
|
|
}
|
|
}
|
|
}
|