Use replicated CVars for max chat message length.

This commit is contained in:
Pieter-Jan Briers
2021-07-17 14:34:18 +02:00
parent b7dc3c81ae
commit 97a3866a40
4 changed files with 14 additions and 63 deletions

View File

@@ -1,29 +0,0 @@
using Lidgren.Network;
using Robust.Shared.Network;
namespace Content.Shared.Chat
{
/// <summary>
/// This message is sent by the server to let clients know what is the chat's character limit for this server.
/// It is first sent by the client as a request
/// </summary>
public sealed class ChatMaxMsgLengthMessage : NetMessage
{
public override MsgGroups MsgGroup => MsgGroups.Command;
/// <summary>
/// The max length a player-sent message can get
/// </summary>
public int MaxMessageLength { get; set; }
public override void ReadFromBuffer(NetIncomingMessage buffer)
{
MaxMessageLength = buffer.ReadInt32();
}
public override void WriteToBuffer(NetOutgoingMessage buffer)
{
buffer.Write(MaxMessageLength);
}
}
}