From 89decdb122e719bf7b86b1ad526486e45f6053d6 Mon Sep 17 00:00:00 2001 From: ScalyChimp <72841710+scaly-chimp@users.noreply.github.com> Date: Mon, 17 Jan 2022 19:24:09 +0000 Subject: [PATCH] you can now only put up to 500 characters into a page of paper (#6213) --- Content.Server/Paper/PaperComponent.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Content.Server/Paper/PaperComponent.cs b/Content.Server/Paper/PaperComponent.cs index 1611f24c0e..6d771f4929 100644 --- a/Content.Server/Paper/PaperComponent.cs +++ b/Content.Server/Paper/PaperComponent.cs @@ -27,6 +27,10 @@ namespace Content.Server.Paper [DataField("content")] public string Content { get; set; } = ""; + [DataField("contentSize")] + public int ContentSize { get; set; } = 500; + + [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(PaperUiKey.Key); protected override void Initialize() @@ -44,6 +48,7 @@ namespace Content.Server.Paper public void SetContent(string content) { + Content = content + '\n'; UpdateUserInterface(); @@ -93,7 +98,9 @@ namespace Content.Server.Paper if (string.IsNullOrEmpty(msg.Text)) return; - Content += msg.Text + '\n'; + + if (msg.Text.Length + Content.Length <= ContentSize) + Content += msg.Text + '\n'; if (_entMan.TryGetComponent(Owner, out AppearanceComponent? appearance)) {