* fix borg (#719) * Automatic changelog update * Переводы снаряжения и прочей мелочи в стартовом меню (#720) * Сумки, мешки и прочее * Перевод снаряжения * перевод черт персонажа * Добавлено ничего * Automatic changelog update * Фикс отображения потери мастера для импланта подчинения (#721) * фикс отображения * brain damage is real * я блять запустил райдер ради рефактора одного ифа * а лучше даже так * Automatic changelog update * add coderabbitai config (#722) * fix (#723) * Шприц теперь является оружием массового поражения (#724) * Automatic changelog update * Пиздец (#725) Я на это потратил 2 недели * Automatic changelog update * Honk FM (#136) (#726) * Fix Cosmic Temperance и новые песенки в jukebox * Новая музыка в jucebox x2 Co-authored-by: Vorge7 <vorge228@gmail.com> * Automatic changelog update * Флаф (fluff) мне (big_zi_348) (#727) * Заработал * brain damage * fuck (#729) * Automatic changelog update * FUCKERS (#732) * Удаление ненужных суффиксов (#731) * Перевод захардкукоженной строки (#728) * Пластырь поможет * очапятка * Перевод ревенанта * Карповый перекат * Create shakeable-component.ftl * Криогеника * Хранилища скафандров * Update autotranslate-14.ftl * Update Cyborgs.xml * Комоды * Кредиты * Удалил дубликат * Информация * Пластырь миму и клоуну * Переводы всего * Перевод аплинка * Удалил ненужные суффиксы * Revert "Удалил ненужные суффиксы" This reverts commit d82f05f30c37ec2c11e5736b91239fe9dd1a4d17. * Удаление ненужных суффиксов * Перевод реагентовых слизней * Перевод аномалий * Перевод маяков * Перевод различной мелочи * Automatic changelog update * Переводы и правки Гайдов (#730) * Automatic changelog update * aaaaa (#733) --------- Co-authored-by: RavmorganButOnCocaine <valtos@nextmail.ru> Co-authored-by: BIGZi0348 <118811750+BIGZi0348@users.noreply.github.com> Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com> Co-authored-by: Vorge7 <vorge228@gmail.com> Co-authored-by: Valtos <valtos@spaces.ru> Co-authored-by: haiwwkes <49613070+rhailrake@users.noreply.github.com>
81 lines
2.0 KiB
C#
81 lines
2.0 KiB
C#
using System.IO;
|
|
using System.Text.Json.Serialization;
|
|
using Lidgren.Network;
|
|
using Robust.Shared.Network;
|
|
using Robust.Shared.Serialization;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Content.Shared._White.Sponsors;
|
|
|
|
public enum WhiteSponsorTier
|
|
{
|
|
DJ = 5,
|
|
ROBUSTER = 4,
|
|
CLOWN = 3,
|
|
PRIKOLIST = 2,
|
|
MEATYORE = 1
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class SponsorInfo
|
|
{
|
|
[JsonPropertyName("tier")]
|
|
public int? Tier { get; set; }
|
|
|
|
[JsonPropertyName("oocColor")]
|
|
public string? OOCColor { get; set; }
|
|
|
|
[JsonPropertyName("priorityJoin")]
|
|
public bool HavePriorityJoin { get; set; } = false;
|
|
|
|
[JsonPropertyName("allowedMarkings")]
|
|
public string[] AllowedMarkings { get; set; } = Array.Empty<string>();
|
|
|
|
[JsonPropertyName("extraSlots")]
|
|
public int ExtraSlots { get; set; }
|
|
|
|
[JsonPropertyName("MeatyOreCoin")]
|
|
public int MeatyOreCoin { get; set; }
|
|
|
|
[JsonPropertyName("antagChance")]
|
|
public int AntagChance { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Server sends sponsoring info to client on connect only if user is sponsor
|
|
/// </summary>
|
|
public sealed class MsgSponsorInfo : NetMessage
|
|
{
|
|
public override MsgGroups MsgGroup => MsgGroups.Command;
|
|
|
|
public SponsorInfo? Info;
|
|
|
|
public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer)
|
|
{
|
|
var isSponsor = buffer.ReadBoolean();
|
|
buffer.ReadPadBits();
|
|
|
|
if (!isSponsor)
|
|
return;
|
|
|
|
var length = buffer.ReadVariableInt32();
|
|
using var stream = new MemoryStream(length);
|
|
buffer.ReadAlignedMemory(stream, length);
|
|
serializer.DeserializeDirect(stream, out Info);
|
|
}
|
|
|
|
public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer)
|
|
{
|
|
buffer.Write(Info != null);
|
|
buffer.WritePadBits();
|
|
|
|
if (Info == null)
|
|
return;
|
|
|
|
var stream = new MemoryStream();
|
|
serializer.SerializeDirect(stream, Info);
|
|
buffer.WriteVariableInt32((int) stream.Length);
|
|
buffer.Write(stream.AsSpan());
|
|
}
|
|
}
|