антики фантики фанфики - #566
Fooksy2304 wants to merge 4 commits into
Conversation
📝 WalkthroughWalkthroughДобавлена команда ChangesАнти-гостовой чат
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ChatManager
participant AntiGhostCommand
participant ChatSystem
participant Recipients
ChatManager->>AntiGhostCommand: Выполняет antighost с текстом
AntiGhostCommand->>ChatSystem: Вызывает TrySendAntiGhostMessage
ChatSystem->>ChatSystem: Проверяет, фильтрует и форматирует сообщение
ChatSystem->>Recipients: Отправляет anti-ghost сообщение выбранным получателям
🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.cs`:
- Around line 19-38: Разделите проверки и выполнение в
ChatSystem.TrySendAntiGhostMessage: добавьте публичный Can-метод с bool quiet =
false, выполняющий только проверки HasComp<GhostComponent>, CanSendInGame, rate
limit и AttachedEntity без изменения состояния, а Try-метод должен вызывать его,
затем обрабатывать сообщение и возвращать bool об успехе. Сохраните отправку в
отдельном Do-методе согласно цепочке OnEvent → TryDo → CanDo → Do и добавьте ///
<summary> к публичным методам.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0031d8d1-0325-404a-a706-56ba54bcf7f7
📒 Files selected for processing (6)
Content.Client/Chat/Managers/ChatManager.csContent.Client/UserInterface/Systems/Chat/Controls/ChannelSelectorButton.csContent.Server/_Lust/Chat/Commands/AntiGhostCommand.csContent.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.csResources/Locale/en-US/_strings/_lust/chat/anti_ghost.ftlResources/Locale/ru-RU/_strings/_lust/chat/anti_ghost.ftl
нет мы слушаем тухоллиса блять мы слушаем Тухоллиса неттспенда плейбой карти и кен карсона всё!
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.cs (1)
111-113: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winДобавьте устойчивую атрибуцию в admin-log.
Сейчас запись содержит только
ToPrettyString(source)и текст сообщения. Для пост-раундового анализа явно сохранитеplayer.UserId, имя сущности иPrototype(source)?.ID; одногоEntityUid/форматированного представления недостаточно, поскольку идентификатор сущности после раунда недоступен.As per coding guidelines: логи должны содержать prototype ID, имя сущности и релевантные идентификаторы для анализа после раунда.
Предлагаемый вариант
+ var entityName = Identity.Name(source, EntityManager); + var prototypeId = Prototype(source)?.ID ?? "unknown"; _adminLogger.Add(LogType.Chat, LogImpact.Low, - $"Anti-ghost chat from {ToPrettyString(source):Player}: {message}"); + $"Anti-ghost chat from user {player.UserId}, entity {entityName}, prototype {prototypeId}: {message}");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.cs` around lines 111 - 113, Update the admin-log entry in the Anti-ghost chat handling to include the player.UserId, the source entity name, and Prototype(source)?.ID alongside the existing message and attribution. Preserve the current LogType.Chat and LogImpact.Low values while making these fields explicit for post-round analysis.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.cs`:
- Around line 21-24: Translate the XML documentation for the anti-ghost chat
method, including its summary and quiet parameter description, into English.
Apply the same translation to the additional documented block noted in the
review, while leaving inline comments and reason strings unchanged.
- Around line 25-30: Обновите CanSendAntiGhostMessage и вынесите чистую проверку
антигост-доступа в отдельный метод, принимающий источник как
Entity<GhostComponent?> и использующий Resolve(...). Используйте эту проверку в
обеих ветках quiet, сохранив одинаковую валидацию длины сообщения через
CanSendInGame(...) до санитайзера, чтобы quiet=true не разрешал короткое
исходное сообщение, которое затем будет обрезано.
---
Outside diff comments:
In `@Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.cs`:
- Around line 111-113: Update the admin-log entry in the Anti-ghost chat
handling to include the player.UserId, the source entity name, and
Prototype(source)?.ID alongside the existing message and attribution. Preserve
the current LogType.Chat and LogImpact.Low values while making these fields
explicit for post-round analysis.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 85a3be0c-490a-4703-b4bd-660354a183cc
📒 Files selected for processing (3)
Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.csResources/Locale/en-US/_strings/_lust/chat/anti_ghost.ftlResources/Locale/ru-RU/_strings/_lust/chat/anti_ghost.ftl
| /// <summary> | ||
| /// Проверяет, может ли игрок отправить сообщение в антигост-чат. | ||
| /// </summary> | ||
| /// <param name="quiet">Не выводить игроку причину отказа.</param> |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Переведите XML-документацию на английский.
Новые summary и param написаны на русском, хотя документация в C# должна быть на английском. Русский оставьте для inline-комментариев и reason-фраз; XML-документацию переведите.
As per coding guidelines and path instructions: документация в C# должна быть на английском.
Also applies to: 46-49
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.cs` around lines 21 -
24, Translate the XML documentation for the anti-ghost chat method, including
its summary and quiet parameter description, into English. Apply the same
translation to the additional documented block noted in the review, while
leaving inline comments and reason strings unchanged.
Sources: Coding guidelines, Path instructions
| public bool CanSendAntiGhostMessage( | ||
| EntityUid source, | ||
| string message, | ||
| IConsoleShell shell, | ||
| ICommonSession player, | ||
| bool quiet = false) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Проверьте реализацию общей проверки и все вызовы quiet-ветки.
rg -n -A60 -B10 'CanSendInGame\s*\(' Content.Server/Chat/Systems/ChatSystem.cs
rg -n --glob '*.cs' 'CanSendAntiGhostMessage\s*\(' .Repository: space-sunrise/lust-station
Length of output: 9476
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Candidate files =="
fd -a 'ChatSystem\.AntiGhost\.cs|ChatSystem\.cs' Content.Server | sed 's#^\./##'
echo
echo "== ChatSystem.AntiGhost.cs =="
cat -n Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.cs
echo
echo "== References to TrySendAntiGhostMessage/CanSendAntiGhostMessage =="
rg -n --glob '*.cs' 'TrySendAntiGhostMessage|CanSendAntiGhostMessage|CanSendInGame' Content.Server Content.Shared | sed -n '1,220p'
echo
echo "== Relevant ChatSystem public overrides/API around anti-ghost symbols =="
rg -n --glob '*.cs' 'TrySendAntiGhostMessage|CanSendAntiGhostMessage|IsGhost\(|HasComp<GhostComponent>|MessageCharacterLimit' Content.Server/Chat/Systems/ChatSystem.cs Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.csRepository: space-sunrise/lust-station
Length of output: 7026
Приведите антигост-проверку к общему Entity<T?>-контракту.
CanSendAntiGhostMessage(...) принимает EntityUid, а для чекером с опциональным компонентом правило требует Entity<GhostComponent?> с Resolve(...). Кроме того, quiet = true меняет набор разрешений: при quiet = false возвращается CanSendInGame(...) с проверкой лимита символов, а при quiet = true проверяется длина только через message.Length, поэтому короткое сообщение может получить true и только потом быть отрезано санитайзером. Вынесите чистую проверку антигост-доступа и используйте её из обеих веток, передавая источник через Entity<GhostComponent?>.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Content.Server/_Lust/Chat/Systems/ChatSystem.AntiGhost.cs` around lines 25 -
30, Обновите CanSendAntiGhostMessage и вынесите чистую проверку антигост-доступа
в отдельный метод, принимающий источник как Entity<GhostComponent?> и
использующий Resolve(...). Используйте эту проверку в обеих ветках quiet,
сохранив одинаковую валидацию длины сообщения через CanSendInGame(...) до
санитайзера, чтобы quiet=true не разрешал короткое исходное сообщение, которое
затем будет обрезано.
Source: Path instructions
|
Чо-та говно. |
|
Агост видит. |
|
Я против замены стандартных эмоутов сомнительной "анти ГОСТ" системой |
|
рил бред какой то |
по просьбам игроков полностью функциональный антигост чат

проверено, всё работает корректно
🆑 Fooksy2304
Summary by CodeRabbit
antighost <текст>, поддерживающая отправку анти-призрачных сообщений.