Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin-Tel committed Oct 1, 2023
2 parents 3f55870 + fb9eaeb commit 531d423
Show file tree
Hide file tree
Showing 11 changed files with 3,731 additions and 4,109 deletions.
2 changes: 1 addition & 1 deletion Content.Client/MassMedia/Ui/NewsWriteBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void OnShareButtonPressed()
var stringName = _menu.NameInput.Text;
var name = (stringName.Length <= 25 ? stringName.Trim() : $"{stringName.Trim().Substring(0, 25)}...");
article.Name = name;
article.Content = stringContent;
article.Content = stringContent.Substring(0, Math.Min(stringContent.Length, 32768));
article.ShareTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan);

_menu.ContentInput.TextRope = new Rope.Leaf(string.Empty);
Expand Down
16 changes: 16 additions & 0 deletions Content.Server/MassMedia/Systems/NewsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using Content.Server.Administration.Logs;
using Content.Server.Chat.Managers;
using Content.Server.MassMedia.Components;
using Content.Server.PDA.Ringer;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.Database;
using Content.Shared.GameTicking;
using Content.Shared.MassMedia.Components;
using Content.Shared.MassMedia.Systems;
Expand All @@ -26,6 +29,8 @@ public sealed class NewsSystem : EntitySystem
[Dependency] private readonly CartridgeLoaderSystem? _cartridgeLoaderSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly IChatManager _chat = default!;

[Dependency] private readonly AccessReaderSystem _accessReader = default!;

Expand Down Expand Up @@ -113,6 +118,17 @@ public void OnWriteUiShareMessage(EntityUid uid, NewsWriteComponent component, N
&& _accessReader.FindAccessItemsInventory(author.Value, out var items)
&& _accessReader.FindStationRecordKeys(author.Value, out var stationRecordKeys, items))
{
if (article.Content.Length > 8192) {
if (article.Content.Length > 32768) {
_adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(author.Value):player} has sent a news article above the size limit ({article.Content.Length} > 32768 characters long).");
_chat.SendAdminAlert(author.Value, $"has sent a news article above the size limit ({article.Content.Length} > 32768 characters long).");
article.Content = msg.Article.Content.Substring(0, 32768);
}
else {
_adminLogger.Add(LogType.Action, LogImpact.High, $"{ToPrettyString(author.Value):player} has sent a large news article ({article.Content.Length} > 8192 characters long).");
_chat.SendAdminAlert(author.Value, $"has sent a large news article ({article.Content.Length} characters long).");
}
}
article.AuthorStationRecordKeyIds = stationRecordKeys;

foreach (var item in items)
Expand Down
12 changes: 12 additions & 0 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,15 @@ Entries:
message: 'Added Mr. Butlertron, the Roboisseur '
id: 65
time: '2023-09-22T03:04:34.0000000+00:00'
- author: Colin-Tel
changes:
- type: Tweak
message: Adjusted the rules. Rules rool!!1
id: 66
time: '2023-09-26T16:57:12.0000000+00:00'
- author: leonardo-dabepis
changes:
- type: Tweak
message: bees can now be put in inventory and ground up as a beverage/ingredient
id: 67
time: '2023-09-28T17:52:08.0000000+00:00'
7,039 changes: 3,540 additions & 3,499 deletions Resources/Maps/arena.yml

Large diffs are not rendered by default.

Loading

0 comments on commit 531d423

Please sign in to comment.