Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Перевод вооружение, кары, типс и культа ядро. #708

Closed
wants to merge 225 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
b049378
remove .github/workflows/update-wiki.yml
CrimeMoot Jul 17, 2024
79d9fc1
Update build-test-debug.yml
CrimeMoot Jul 17, 2024
f53b68b
Edited ban messages
CrimeMoot Jul 17, 2024
e3e5423
fix workflows
CrimeMoot Jul 17, 2024
030dc14
Admin log timer
CrimeMoot Jul 17, 2024
81303ad
fix с CLF3 на LF
CrimeMoot Jul 17, 2024
07c251d
newrules
CrimeMoot Jul 17, 2024
5f31b1f
new rules
CrimeMoot Jul 17, 2024
dd3a558
Снова формат CLF3, меняю на LF
CrimeMoot Jul 17, 2024
af9f86b
У нас нет WIKI, в печь.
CrimeMoot Jul 17, 2024
3aac4e8
Update build-test-debug.yml
CrimeMoot Jul 17, 2024
991e954
update test-debug
CrimeMoot Jul 17, 2024
3ab55f6
force-say-radio
CrimeMoot Jul 17, 2024
6b155d9
Merge pull request #1 from fospas/Edited_ban_messages
fospas Jul 17, 2024
89c4489
Update AdminLogsControl.xaml
CrimeMoot Jul 17, 2024
84808f8
Update build-test-debug.yml
CrimeMoot Jul 17, 2024
a8d14fb
Ensnareable Tweak
CrimeMoot Jul 17, 2024
f7932f4
Update build-test-debug.yml
CrimeMoot Jul 17, 2024
9d1c3f2
Update build-test-debug.yml
CrimeMoot Jul 17, 2024
dcb0e7b
Update build-test-debug.yml
CrimeMoot Jul 17, 2024
489618b
Убрать ограничения для верхней одежды
CrimeMoot Jul 17, 2024
2c7c3ce
Non-item disposal insert bugfix
CrimeMoot Jul 17, 2024
f60b3cc
Брендинг сервера
Jul 17, 2024
b58b20e
Merge branch 'master' of https://github.com/fospas/Space-Cats
Jul 17, 2024
6186bbf
new_rules Default fix
CrimeMoot Jul 17, 2024
3a2de47
Merge pull request #4 from fospas/new_rules
fospas Jul 17, 2024
84c0c8c
Merge pull request #3 from fospas/Admin_log_timer
fospas Jul 17, 2024
c4e0bec
Merge pull request #7 from fospas/Ensnareable_Tweak
fospas Jul 17, 2024
a8749d6
Revert "Admin log timer"
CrimeMoot Jul 17, 2024
06983ad
Merge pull request #10 from fospas/revert-3-Admin_log_timer
CrimeMoot Jul 17, 2024
236978b
Update DefaultRules.xml
fospas Jul 17, 2024
d149bda
Merge pull request #5 from fospas/force-say-radio
fospas Jul 17, 2024
de8baf0
Merge pull request #9 from fospas/Non-item_disposal_insert_bugfix
fospas Jul 17, 2024
971a2e3
Merge pull request #8 from fospas/Remove_restrictions_for_outerwear
fospas Jul 17, 2024
1ce8836
Update DefaultRules.xml
CrimeMoot Jul 18, 2024
8099220
test
CrimeMoot Jul 18, 2024
b8a1438
fix
CrimeMoot Jul 18, 2024
d36c1f8
Create Minimal-Workflow.yaml
CrimeMoot Jul 18, 2024
a286b42
Delete .github/workflows/Minimal-Workflow.yaml
CrimeMoot Jul 18, 2024
4e08322
Create Minimal-Workflow.yml
CrimeMoot Jul 18, 2024
b5dd16c
В мусор. Нужен-лишь для теста.
CrimeMoot Jul 18, 2024
2debb58
Merge pull request #1 from fospas/Cats
CrimeMoot Jul 18, 2024
a9200a9
Update build-test-debug.yml
CrimeMoot Jul 18, 2024
f81917f
Ban webhook
CrimeMoot Jul 19, 2024
57a8655
fix формы
CrimeMoot Jul 19, 2024
420c794
В adminwo видно пропушенная строчка, что показывает скрытого админа.
CrimeMoot Jul 19, 2024
47cb27b
Агост может видеть должность и мш
CrimeMoot Jul 19, 2024
7e3f3fa
Merge pull request #5 from fospas/admin_ghost
fospas Jul 19, 2024
ce745d5
Отправляет принятые PR в вебхук дискорда как обновление.
CrimeMoot Jul 19, 2024
8c1d763
добавил отображение Tweak, Add, Fix, Remove
CrimeMoot Jul 19, 2024
d6107fc
убрал лишний код.
CrimeMoot Jul 19, 2024
5139dee
upd
CrimeMoot Jul 19, 2024
e01946b
upd
CrimeMoot Jul 19, 2024
cd11390
Конечный вариант.
CrimeMoot Jul 19, 2024
0445655
Добавляет в панель админа кнопку выдачи времени.
CrimeMoot Jul 19, 2024
9e447aa
Убрать пацифист в конце раунде :/
CrimeMoot Jul 19, 2024
e317bdc
Merge pull request #10 from fospas/nowsendsembeds
fospas Jul 19, 2024
64755bf
Update pr-notify.yml
CrimeMoot Jul 19, 2024
87737d3
Merge pull request #13 from fospas/panel_add_time
CrimeMoot Jul 19, 2024
1ece308
Revert "test"
CrimeMoot Jul 19, 2024
1cd460a
Merge pull request #14 from fospas/revert-13-panel_add_time
CrimeMoot Jul 19, 2024
3d9fbc0
Merge pull request #8 from fospas/pr-notify
fospas Jul 19, 2024
0b6f7ed
Merge pull request #4 from fospas/fix_Steath
CrimeMoot Jul 19, 2024
f6b22da
Update pr-notify.yml
CrimeMoot Jul 19, 2024
93fe6f3
Update pr-notify.yml
CrimeMoot Jul 19, 2024
2daba94
fix
CrimeMoot Jul 19, 2024
f4e5449
fix2
CrimeMoot Jul 19, 2024
7c9dc13
Когда-нибудь получиться.
CrimeMoot Jul 19, 2024
45db2b3
проверка
CrimeMoot Jul 19, 2024
f3df447
hotfix
CrimeMoot Jul 19, 2024
854fab2
hotfix1
CrimeMoot Jul 19, 2024
b5a96a6
fix3
CrimeMoot Jul 19, 2024
4dfccca
короче уходи другой сделаю.
CrimeMoot Jul 19, 2024
bf84ee9
new webhook PR
CrimeMoot Jul 19, 2024
97858ed
fix
CrimeMoot Jul 19, 2024
3c17f5b
fix
CrimeMoot Jul 19, 2024
0ed0aff
upd
CrimeMoot Jul 19, 2024
e9ce2d2
убираем ненужное
CrimeMoot Jul 19, 2024
dc65b0e
Update README.md
CrimeMoot Jul 19, 2024
6c86268
fix
CrimeMoot Jul 19, 2024
8481227
Merge pull request #16 from fospas/Dev
CrimeMoot Jul 19, 2024
0d06e20
Revert "Test"
CrimeMoot Jul 19, 2024
a945136
Merge pull request #17 from fospas/revert-16-Dev
CrimeMoot Jul 19, 2024
576c482
fix
CrimeMoot Jul 19, 2024
e3db5b2
test
CrimeMoot Jul 19, 2024
7ab6b51
Merge pull request #18 from fospas/Dev
CrimeMoot Jul 19, 2024
1b35db5
Revert "test"
CrimeMoot Jul 19, 2024
f143994
Merge pull request #19 from fospas/revert-18-Dev
CrimeMoot Jul 19, 2024
0d4895c
upd
CrimeMoot Jul 19, 2024
fde35aa
test
CrimeMoot Jul 19, 2024
d374013
upd
CrimeMoot Jul 19, 2024
3f48179
remove color
CrimeMoot Jul 19, 2024
94288de
Merge pull request #20 from fospas/Dev
CrimeMoot Jul 19, 2024
2a4506d
upd
CrimeMoot Jul 19, 2024
4b51d31
Смена положение правил.
CrimeMoot Jul 19, 2024
2ec018c
Merge pull request #21 from fospas/fix_Rule
CrimeMoot Jul 19, 2024
fdc8b0b
добавил отслеживание revert
CrimeMoot Jul 19, 2024
880d434
Update BanHook.cs
CrimeMoot Jul 19, 2024
8b7d49c
Update BanHook.cs
CrimeMoot Jul 19, 2024
b9d43c8
Update BanHook.cs
CrimeMoot Jul 19, 2024
5986f2f
Update BanHook.cs
CrimeMoot Jul 19, 2024
6faa7a2
fix 3
CrimeMoot Jul 20, 2024
36c5d2b
log in
CrimeMoot Jul 20, 2024
f8563f0
fix
CrimeMoot Jul 20, 2024
813e308
fix
CrimeMoot Jul 20, 2024
5931ce7
upd
CrimeMoot Jul 20, 2024
e9262b1
upd dotnet-version
CrimeMoot Jul 20, 2024
502fabe
fix
CrimeMoot Jul 20, 2024
503968a
снова
CrimeMoot Jul 20, 2024
61ef5f7
fix
CrimeMoot Jul 20, 2024
8387781
fix
CrimeMoot Jul 20, 2024
67a1605
remove
CrimeMoot Jul 20, 2024
3154169
Отображает человека который Вас заблокировал.
CrimeMoot Jul 20, 2024
2b25578
Убираем упоминание Backmen
CrimeMoot Jul 20, 2024
45d9630
Merge pull request #25 from fospas/upstream
CrimeMoot Jul 20, 2024
fb5c861
Add discord button in escape menu
CrimeMoot Jul 20, 2024
8c69f2d
fix
CrimeMoot Jul 20, 2024
17483a1
fix
CrimeMoot Jul 20, 2024
296b993
fix
CrimeMoot Jul 20, 2024
0a48f62
fix
CrimeMoot Jul 20, 2024
35d8bd9
Update connection-messages.ftl
CrimeMoot Jul 20, 2024
c5407b6
Update escape-menu.ftl
CrimeMoot Jul 20, 2024
e5e963b
fix
CrimeMoot Jul 20, 2024
53aba7f
fix
CrimeMoot Jul 20, 2024
ed9da50
админ префикс для ахелпа/админ чата
CrimeMoot Jul 20, 2024
2ca6986
fix
CrimeMoot Jul 20, 2024
81aac92
fix
CrimeMoot Jul 20, 2024
f83a6b8
fix
CrimeMoot Jul 20, 2024
d0d5c48
fix
CrimeMoot Jul 20, 2024
a06d9c3
fix
CrimeMoot Jul 20, 2024
76dfc5e
Merge pull request #28 from fospas/add_admin_prefix
CrimeMoot Jul 20, 2024
36ca97c
Авторизация по ДНК скафандров Ядерщиков
CrimeMoot Jul 20, 2024
30aaf6f
remove
CrimeMoot Jul 20, 2024
5bcce13
fix
CrimeMoot Jul 20, 2024
f53d81e
Подарок для набегаторов.
CrimeMoot Jul 20, 2024
641411f
Update DNALockComponent.cs
CrimeMoot Jul 20, 2024
c73377c
Update DNALockerSystem.cs
CrimeMoot Jul 20, 2024
7ec957a
Merge pull request #30 from fospas/no_svastika
CrimeMoot Jul 20, 2024
dbb11f6
Merge pull request #29 from fospas/remove_art_chaous
CrimeMoot Jul 20, 2024
fa063db
Revert "Подарок для набегаторов."
CrimeMoot Jul 20, 2024
d932992
Merge pull request #31 from fospas/revert-30-no_svastika
CrimeMoot Jul 20, 2024
0fd553e
Merge pull request #22 from fospas/ban-reason-update
CrimeMoot Jul 20, 2024
d03c9f1
Merge pull request #26 from fospas/Add_discord_button
CrimeMoot Jul 20, 2024
7b5d80e
Merge pull request #3 from fospas/ban_weebhook
CrimeMoot Jul 20, 2024
0da4698
Revert "Ban webhook"
CrimeMoot Jul 20, 2024
1a47190
Merge pull request #32 from fospas/revert-3-ban_weebhook
CrimeMoot Jul 20, 2024
9d2c417
Revert "Ban webhook"
CrimeMoot Jul 20, 2024
76aa285
Merge pull request #33 from fospas/revert-3-ban_weebhook
CrimeMoot Jul 20, 2024
f8d505b
ban revive webhook
CrimeMoot Jul 20, 2024
3126eaf
fix
CrimeMoot Jul 20, 2024
a88de03
Merge branch 'master' into ban_weebhook
CrimeMoot Jul 20, 2024
ead1257
fix ahelpa
CrimeMoot Jul 20, 2024
0710539
Merge pull request #34 from fospas/ban_weebhook
CrimeMoot Jul 20, 2024
031e09e
fix
CrimeMoot Jul 20, 2024
27f740f
отступить строку.
CrimeMoot Jul 20, 2024
c4b39c8
отсупить строку в ahelpe
CrimeMoot Jul 20, 2024
4754be5
activate changelogs
CrimeMoot Jul 21, 2024
4bb628f
Update actions_changelogs_since_last_run.py
CrimeMoot Jul 22, 2024
4e83b0d
Merge pull request #36 from fospas/upstream
CrimeMoot Jul 22, 2024
e741204
детектив - добавление зарплат и стартового счета
fospas Jul 22, 2024
980a320
Merge pull request #37 from fospas/Detective-Fix
fospas Jul 22, 2024
d878431
Убираем ивент со спавном шаттлов.
CrimeMoot Jul 22, 2024
f0de1e3
upd
CrimeMoot Jul 22, 2024
a1feb4a
понизил шанс на ивенты.
CrimeMoot Jul 22, 2024
b1a7cd7
уменьшаем хаус на 20%
CrimeMoot Jul 22, 2024
66826dd
bans_web
CrimeMoot Jul 22, 2024
7178472
add
CrimeMoot Jul 22, 2024
1275a5d
fix
CrimeMoot Jul 22, 2024
ae50797
remove
CrimeMoot Jul 22, 2024
4689022
remove
CrimeMoot Jul 22, 2024
13f9833
fix remove xd
CrimeMoot Jul 22, 2024
018eef1
Merge pull request #38 from fospas/remove_event
CrimeMoot Jul 22, 2024
2d013e8
Более приятный цвет PNV
CrimeMoot Jul 22, 2024
ad21d82
Merge pull request #39 from fospas/bans
CrimeMoot Jul 22, 2024
1376e2f
Disable VentClog event
CrimeMoot Jul 22, 2024
176a3d1
Merge pull request #40 from fospas/DisableVentClog
CrimeMoot Jul 23, 2024
4653545
Мелая локализация.
CrimeMoot Jul 23, 2024
ceee465
Merge pull request #41 from fospas/translation
CrimeMoot Jul 23, 2024
e556d8f
Добавление текстур и прототипа новой кастомизации
Jul 23, 2024
0ea8c3e
Merge pull request #42 from fospas/demon_parts
fospas Jul 23, 2024
cd2fd74
Убран из голосование режим Крушение. В голосвании добавлены: Вампиры,…
CrimeMoot Jul 23, 2024
a3bc5d8
Merge pull request #43 from fospas/remove_shipwrecked
CrimeMoot Jul 23, 2024
9f9ef18
fix game_presets
CrimeMoot Jul 23, 2024
51536a8
Открытые роли на ЦК.
CrimeMoot Jul 23, 2024
78624c0
Merge pull request #44 from fospas/centcom_unlock
CrimeMoot Jul 23, 2024
5b36329
remove WageScheduler
CrimeMoot Jul 23, 2024
8839643
fix
CrimeMoot Jul 23, 2024
0b64056
remove WageScheduler
CrimeMoot Jul 23, 2024
51dbbee
Убираем обломок который очень сильно нагружает. И не используется.
CrimeMoot Jul 23, 2024
dda025e
ИИ теперь может видить глазами боргов.
CrimeMoot Jul 23, 2024
feb02d8
add role Admiral NT
CrimeMoot Jul 23, 2024
7df8ec7
add cmd mapping
CrimeMoot Jul 23, 2024
9296331
Merge pull request #45 from fospas/remove_names_borer
CrimeMoot Jul 23, 2024
a1dd583
Merge pull request #46 from fospas/add_watch_borg
CrimeMoot Jul 23, 2024
690833c
Merge pull request #47 from fospas/upstream
CrimeMoot Jul 23, 2024
9950a7d
Revert "ИИ теперь может видить глазами боргов."
CrimeMoot Jul 24, 2024
7a1811a
Merge pull request #48 from fospas/revert-46-add_watch_borg
CrimeMoot Jul 24, 2024
58a79dc
понижение времени для ЦК
CrimeMoot Jul 25, 2024
0faa3bf
Merge pull request #49 from fospas/upstream
CrimeMoot Jul 25, 2024
da953b2
Merge pull request #50 from fospas/time_down
CrimeMoot Jul 25, 2024
f6d2f11
Пониженное численость игроков для событий и режимов.
CrimeMoot Jul 25, 2024
b84ad64
fix
CrimeMoot Jul 25, 2024
8f0784d
Merge pull request #52 from fospas/roundstart
CrimeMoot Jul 25, 2024
b2366a4
Изменение лимита букв в консолях связи
CrimeMoot Jul 25, 2024
bf6cba7
Merge pull request #53 from fospas/announce-length-increase
CrimeMoot Jul 25, 2024
c996dd8
Убираем ограничение на кастомизацию.
CrimeMoot Jul 25, 2024
98dd4b8
Merge pull request #54 from fospas/remove_sponsor
CrimeMoot Jul 25, 2024
d908c56
Убираем цели на животных у вора.
CrimeMoot Jul 25, 2024
0408c87
Merge pull request #55 from fospas/It_is_impossible_to_steal_underpants
CrimeMoot Jul 25, 2024
a836e43
fix кошака, неправильный обозначение
CrimeMoot Jul 25, 2024
29fcbe8
Merge pull request #56 from fospas/fix_felinid_out
CrimeMoot Jul 25, 2024
e205993
fix положения демон хвостов
CrimeMoot Jul 25, 2024
c93b232
Перевод некому не нужных вещей, разве что нижняя одежда...
CrimeMoot Jul 26, 2024
f29718f
Update socks.yml
CrimeMoot Jul 26, 2024
75c50bd
Update Pistols.yml
CrimeMoot Jul 26, 2024
33b1f32
Update pants.yml
CrimeMoot Jul 26, 2024
f590bdc
fix
CrimeMoot Jul 26, 2024
388a7b2
Update smites.ftl
CrimeMoot Jul 26, 2024
1bdf538
Merge branch 'master' into translation_tips
CrimeMoot Jul 26, 2024
7efa89b
add translation
CrimeMoot Jul 26, 2024
e3ee09b
revert
CrimeMoot Jul 26, 2024
856c5d4
Merge pull request #58 from fospas/translation_tips
CrimeMoot Jul 26, 2024
c098bf1
Перевод вооружение, кары, типс и культа ядро.
CrimeMoot Jul 26, 2024
dd8a461
translation
CrimeMoot Jul 26, 2024
404cc51
Merge branch 'master' into translation
CrimeMoot Jul 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ jobs:
ARTIFACT_ID: ${{ steps.artifact-upload-step.outputs.artifact-id }}
GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }}

# - name: Publish changelog (Discord)
# run: Tools/actions_changelogs_since_last_run.py
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DISCORD_WEBHOOK_URL: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }}
- name: Publish changelog
run: Tools/actions_changelogs_since_last_run.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }}

# - name: Publish changelog (RSS)
# run: Tools/actions_changelog_rss.py
Expand Down
92 changes: 0 additions & 92 deletions .github/workflows/update-wiki.yml

This file was deleted.

1 change: 1 addition & 0 deletions Content.Client/Options/UI/EscapeMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Button Access="Public" Name="RulesButton" Text="{Loc 'ui-escape-rules'}" />
<Button Access="Public" Name="GuidebookButton" Text="{Loc 'ui-escape-guidebook'}" />
<Button Access="Public" Name="WikiButton" Text="{Loc 'ui-escape-wiki'}" />
<Button Access="Public" Name="DiscordButton" Text="{Loc 'ui-escape-discord'}" />
<Button Access="Public" Name="DisconnectButton" Text="{Loc 'ui-escape-disconnect'}" />
<Button Access="Public" Name="QuitButton" Text="{Loc 'ui-escape-quit'}" />
</BoxContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ private void OnDamageForceSay(DamageForceSayEvent ev, EntitySessionEventArgs _)

// we need to handle selected channel
// and prefix-channel separately..
var allowedChannels = ChatSelectChannel.Local | ChatSelectChannel.Whisper;
var allowedChannels = ChatSelectChannel.Local | ChatSelectChannel.Whisper | ChatSelectChannel.Radio;
if ((chatBox.SelectedChannel & allowedChannels) == ChatSelectChannel.None)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,20 @@ public void OnStateEntered(GameplayState state)
_uri.OpenUri(_cfg.GetCVar(CCVars.InfoLinksWiki));
};

_escapeWindow.DiscordButton.OnPressed += _ =>
{
_uri.OpenUri(_cfg.GetCVar(CCVars.InfoLinksDiscord));
};

_escapeWindow.GuidebookButton.OnPressed += _ =>
{
_guidebook.ToggleGuidebook();
};

// Hide wiki button if we don't have a link for it.
_escapeWindow.WikiButton.Visible = _cfg.GetCVar(CCVars.InfoLinksWiki) != "";
// Hide discord button if we don't have a link for it.
_escapeWindow.DiscordButton.Visible = _cfg.GetCVar(CCVars.InfoLinksDiscord) != ""; //discord-button

CommandBinds.Builder
.Bind(EngineKeyFunctions.EscapeMenu,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void AddDenied(int denied)
EntryContainer.AddChild(textLabel);

var whitelistButton = new Button();
whitelistButton.Text = Loc.GetString("ui-escape-discord");
whitelistButton.Text = Loc.GetString("ui-escap-discord");

var uri = IoCManager.Resolve<IUriOpener>();
var cfg = IoCManager.Resolve<IConfigurationManager>();
Expand Down
14 changes: 7 additions & 7 deletions Content.Server/Administration/Commands/AdminWhoCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text;
using System.Linq;
using System.Text;
using Content.Server.Administration.Managers;
using Content.Server.Afk;
using Content.Shared.Administration;
Expand Down Expand Up @@ -29,13 +30,10 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
seeStealth = playerData != null && playerData.CanStealth();
}

var sb = new StringBuilder();
var first = true;
var adminList = new List<string>();
foreach (var admin in adminMgr.ActiveAdmins)
{
if (!first)
sb.Append('\n');
first = false;
var sb = new StringBuilder();

var adminData = adminMgr.GetAdminData(admin)!;
DebugTools.AssertNotNull(adminData);
Expand All @@ -55,8 +53,10 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
if (afk.IsAfk(admin))
sb.Append(" [AFK]");
}

adminList.Add(sb.ToString());
}

shell.WriteLine(sb.ToString());
shell.WriteLine(string.Join(Environment.NewLine, adminList));
}
}
86 changes: 30 additions & 56 deletions Content.Server/Administration/Systems/BwoinkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Content.Server.Administration.Managers;
using Content.Server.Backmen.Administration.Bwoink.Gpt;
using Content.Server.Afk;
using Content.Server.Discord;
using Content.Server.GameTicking;
using Content.Server.Players.RateLimiting;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Mind;
Expand All @@ -23,14 +21,15 @@
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Robust.Shared.Console;
using Content.Server.Administration.Commands;


namespace Content.Server.Administration.Systems
{
[UsedImplicitly]
public sealed partial class BwoinkSystem : SharedBwoinkSystem
public sealed class BwoinkSystem : SharedBwoinkSystem
{
private const string RateLimitKey = "AdminHelp";

[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IConfigurationManager _config = default!;
Expand All @@ -39,10 +38,6 @@ public sealed partial class BwoinkSystem : SharedBwoinkSystem
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly SharedMindSystem _minds = default!;
[Dependency] private readonly IAfkManager _afkManager = default!;
[Dependency] private readonly PlayerRateLimitManager _rateLimit = default!;

[GeneratedRegex(@"^https://discord\.com/api/webhooks/(\d+)/((?!.*/).*)$")]
private static partial Regex DiscordRegex();

private ISawmill _sawmill = default!;
private readonly HttpClient _httpClient = new();
Expand Down Expand Up @@ -74,33 +69,17 @@ public sealed partial class BwoinkSystem : SharedBwoinkSystem
public override void Initialize()
{
base.Initialize();
Subs.CVar(_config, CCVars.DiscordAHelpWebhook, OnWebhookChanged, true);
Subs.CVar(_config, CCVars.DiscordAHelpFooterIcon, OnFooterIconChanged, true);
Subs.CVar(_config, CCVars.DiscordAHelpAvatar, OnAvatarChanged, true);
Subs.CVar(_config, CVars.GameHostName, OnServerNameChanged, true);
Subs.CVar(_config, CCVars.AdminAhelpOverrideClientName, OnOverrideChanged, true);
_config.OnValueChanged(CCVars.DiscordAHelpWebhook, OnWebhookChanged, true);
_config.OnValueChanged(CCVars.DiscordAHelpFooterIcon, OnFooterIconChanged, true);
_config.OnValueChanged(CCVars.DiscordAHelpAvatar, OnAvatarChanged, true);
_config.OnValueChanged(CVars.GameHostName, OnServerNameChanged, true);
_config.OnValueChanged(CCVars.AdminAhelpOverrideClientName, OnOverrideChanged, true);
_sawmill = IoCManager.Resolve<ILogManager>().GetSawmill("AHELP");
_maxAdditionalChars = GenerateAHelpMessage("", "", true, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playedSound: false).Length;
_maxAdditionalChars = GenerateAHelpMessage("", "", true, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel).Length;
_playerManager.PlayerStatusChanged += OnPlayerStatusChanged;

SubscribeLocalEvent<GameRunLevelChangedEvent>(OnGameRunLevelChanged);
SubscribeNetworkEvent<BwoinkClientTypingUpdated>(OnClientTypingUpdated);

_rateLimit.Register(
RateLimitKey,
new RateLimitRegistration
{
CVarLimitPeriodLength = CCVars.AhelpRateLimitPeriod,
CVarLimitCount = CCVars.AhelpRateLimitCount,
PlayerLimitedAction = PlayerRateLimitedAction
});
}

private void PlayerRateLimitedAction(ICommonSession obj)
{
RaiseNetworkEvent(
new BwoinkTextMessage(obj.UserId, default, Loc.GetString("bwoink-system-rate-limited"), playSound: false),
obj.Channel);
}

private void OnOverrideChanged(string obj)
Expand Down Expand Up @@ -171,6 +150,15 @@ private void OnServerNameChanged(string obj)
_serverName = obj;
}

public override void Shutdown()
{
base.Shutdown();
_config.UnsubValueChanged(CCVars.DiscordAHelpWebhook, OnWebhookChanged);
_config.UnsubValueChanged(CCVars.DiscordAHelpFooterIcon, OnFooterIconChanged);
_config.UnsubValueChanged(CVars.GameHostName, OnServerNameChanged);
_config.UnsubValueChanged(CCVars.AdminAhelpOverrideClientName, OnOverrideChanged);
}

private async void OnWebhookChanged(string url)
{
_webhookUrl = url;
Expand All @@ -181,7 +169,7 @@ private async void OnWebhookChanged(string url)
return;

// Basic sanity check and capturing webhook ID and token
var match = DiscordRegex().Match(url);
var match = Regex.Match(url, @"^https://discord\.com/api/webhooks/(\d+)/((?!.*/).*)$");

if (!match.Success)
{
Expand Down Expand Up @@ -416,31 +404,24 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
return;
}

if (_rateLimit.CountAction(eventArgs.SenderSession, RateLimitKey) != RateLimitStatus.Allowed)
return;

var escapedText = FormattedMessage.EscapeText(message.Text);

string bwoinkText;

if (senderAdmin is not null && senderAdmin.Flags == AdminFlags.Adminhelp) // Mentor. Not full admin. That's why it's colored differently.
{
bwoinkText = $"[color=purple]{senderSession.Name}[/color]";
bwoinkText = $"[color=purple]{senderSession.Name}[/color]: {escapedText}";
}
else if (senderAdmin is not null && senderAdmin.HasFlag(AdminFlags.Adminhelp))
{
bwoinkText = $"[color=red]{senderSession.Name}[/color]";
bwoinkText = $"\\[{senderAdmin.Title}\\] [color=red]{senderSession.Name}[/color]: {escapedText}"; // сообщение админа
}
else
{
bwoinkText = $"{senderSession.Name}";
bwoinkText = $"{senderSession.Name}: {escapedText}";
}

bwoinkText = $"{(message.PlaySound ? "" : "(S) ")}{bwoinkText}: {escapedText}";

// If it's not an admin / admin chooses to keep the sound then play it.
var playSound = !senderAHelpAdmin || message.PlaySound;
var msg = new BwoinkTextMessage(message.UserId, senderSession.UserId, bwoinkText, playSound: playSound);
var msg = new BwoinkTextMessage(message.UserId, senderSession.UserId, bwoinkText);

LogBwoink(msg);

Expand All @@ -464,20 +445,18 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
// Doing the same thing as above, but with the override name. Theres probably a better way to do this.
if (senderAdmin is not null && senderAdmin.Flags == AdminFlags.Adminhelp) // Mentor. Not full admin. That's why it's colored differently.
{
overrideMsgText = $"[color=purple]{_overrideClientName}[/color]";
overrideMsgText = $"[color=purple]{_overrideClientName}[/color]: {escapedText}";
}
else if (senderAdmin is not null && senderAdmin.HasFlag(AdminFlags.Adminhelp))
{
overrideMsgText = $"[color=red]{_overrideClientName}[/color]";
overrideMsgText = $"[color=red]{_overrideClientName}[/color]: {escapedText}";
}
else
{
overrideMsgText = $"{senderSession.Name}"; // Not an admin, name is not overridden.
overrideMsgText = $"{senderSession.Name}: {escapedText}"; // Not an admin, name is not overridden.
}

overrideMsgText = $"{(message.PlaySound ? "" : "(S) ")}{overrideMsgText}: {escapedText}";

RaiseNetworkEvent(new BwoinkTextMessage(message.UserId, senderSession.UserId, overrideMsgText, playSound: playSound), session.Channel);
RaiseNetworkEvent(new BwoinkTextMessage(message.UserId, senderSession.UserId, overrideMsgText), session.Channel);
}
else
RaiseNetworkEvent(msg, session.Channel);
Expand All @@ -498,11 +477,9 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
str = str[..(DescriptionMax - _maxAdditionalChars - unameLength)];
}
var nonAfkAdmins = GetNonAfkAdmins();
_messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playedSound: playSound, noReceivers: nonAfkAdmins.Count == 0));
_messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, nonAfkAdmins.Count == 0));
}

EntityManager.SystemOrNull<GptAhelpSystem>()?.AddUserMessage(message.UserId, personalChannel, escapedText); // backmen: gpt

if (admins.Count != 0 || sendsWebhook)
return;

Expand All @@ -528,7 +505,7 @@ private IList<INetChannel> GetTargetAdmins()
.ToList();
}

private static string GenerateAHelpMessage(string username, string message, bool admin, string roundTime, GameRunLevel roundState, bool playedSound, bool noReceivers = false)
private static string GenerateAHelpMessage(string username, string message, bool admin, string roundTime, GameRunLevel roundState, bool noReceivers = false)
{
var stringbuilder = new StringBuilder();

Expand All @@ -541,12 +518,9 @@ private static string GenerateAHelpMessage(string username, string message, bool

if(roundTime != string.Empty && roundState == GameRunLevel.InRound)
stringbuilder.Append($" **{roundTime}**");
if (!playedSound)
stringbuilder.Append(" **(S)**");
stringbuilder.Append($" **{username}:** ");
stringbuilder.Append(message);
return stringbuilder.ToString();
}
}
}

Loading
Loading