Files
crystall-punk-14/Content.Shared/_CP14/Sponsor/CP14SharedSponsorManager.cs
Ed 39ca6175e6 Simple sponsorship system (#1189)
* simple sponsorship system

* priority Join

* OOC Sponsor Color

* Update CP14SponsorRolePrototype.cs

* loadout sponsorship

* bruh

* refactor to interfaces

* Update CP14ClientSponsorManager.cs

* finish loadout option

* role pass
2025-04-17 19:55:25 +03:00

36 lines
983 B
C#

using System.Diagnostics.CodeAnalysis;
using Lidgren.Network;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared._CP14.Sponsor;
public interface ICP14SponsorManager
{
public void Initialize();
public bool UserHasFeature(NetUserId userId,
ProtoId<CP14SponsorFeaturePrototype> feature,
bool ifDisabledSponsorhip = true);
public bool TryGetSponsorOOCColor(NetUserId userId, [NotNullWhen(true)] out Color? color);
}
public sealed class CP14SponsorRoleUpdate : NetMessage
{
public override MsgGroups MsgGroup => MsgGroups.Command;
public ProtoId<CP14SponsorRolePrototype> Role { get; set; }
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer)
{
Role = buffer.ReadString();
}
public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer)
{
buffer.Write(Role);
}
}