quantum-space-buddies/QSB/API/Messages/AddonCustomDataSyncMessage.cs

12 lines
441 B
C#
Raw Normal View History

using QSB.Messaging;
using QSB.Player;
using QSB.Utility;
namespace QSB.API.Messages;
public class AddonCustomDataSyncMessage : QSBMessage<(uint playerId, string key, byte[] data)>
{
public AddonCustomDataSyncMessage(uint playerId, string key, object data) : base((playerId, key, data.ToBytes())) { }
public override void OnReceiveRemote() => QSBPlayerManager.GetPlayer(Data.playerId).SetCustomData(Data.key, Data.data.ToObject());
}