diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml new file mode 100644 index 0000000000..c9a58a0577 --- /dev/null +++ b/.github/workflows/publish-test.yml @@ -0,0 +1,53 @@ +name: Publish Test + +concurrency: + group: publish + cancel-in-progress: true + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install Dependencies + run: pip install pyyaml requests + + - uses: actions/checkout@v4.2.2 + with: + submodules: 'recursive' + + - name: Setup .NET Core + uses: actions/setup-dotnet@v4.1.0 + with: + dotnet-version: 9.0.x + + - name: Get Engine Tag + run: | + cd RobustToolbox + git fetch --depth=1 + + - name: Install dependencies + run: dotnet restore + + - name: Build Packaging + run: dotnet build Content.Packaging --configuration Release --no-restore /m + + - name: Package server + run: dotnet run --project Content.Packaging server --platform win-x64 --platform linux-x64 --platform osx-x64 --platform linux-arm64 + + - name: Package client + run: dotnet run --project Content.Packaging client --no-wipe-release + + - name: Publish version + run: Tools/publish_multi_request.py --fork-id sunrise_station_test + env: + PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} + GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }} diff --git a/Content.Client/Administration/Systems/AdminWhoSystem.cs b/Content.Client/Administration/Systems/AdminWhoSystem.cs new file mode 100644 index 0000000000..81e801ece5 --- /dev/null +++ b/Content.Client/Administration/Systems/AdminWhoSystem.cs @@ -0,0 +1,31 @@ +using Content.Shared.Administration; + +namespace Content.Client.Administration.Systems; + +/// +/// Client system for handling admin who requests +/// +public sealed class AdminWhoSystem : EntitySystem +{ + public event Action>? OnAdminWhoUpdate; + + public override void Initialize() + { + base.Initialize(); + + SubscribeNetworkEvent(OnAdminWhoResponse); + } + + /// + /// Request the list of online administrators from the server + /// + public void RequestAdminWho() + { + RaiseNetworkEvent(new RequestAdminWhoEvent()); + } + + private void OnAdminWhoResponse(AdminWhoResponseEvent args, EntitySessionEventArgs session) + { + OnAdminWhoUpdate?.Invoke(args.Admins); + } +} \ No newline at end of file diff --git a/Content.Client/Administration/Systems/BwoinkSystem.cs b/Content.Client/Administration/Systems/BwoinkSystem.cs index 72c87b6ba6..3c0730c88d 100644 --- a/Content.Client/Administration/Systems/BwoinkSystem.cs +++ b/Content.Client/Administration/Systems/BwoinkSystem.cs @@ -12,13 +12,25 @@ namespace Content.Client.Administration.Systems [Dependency] private readonly IGameTiming _timing = default!; public event EventHandler? OnBwoinkTextMessageRecieved; + public event EventHandler? OnBwoinkCooldownReceived; private (TimeSpan Timestamp, bool Typing) _lastTypingUpdateSent; + public override void Initialize() + { + base.Initialize(); + SubscribeNetworkEvent(OnBwoinkCooldownMessage); + } + protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySessionEventArgs eventArgs) { OnBwoinkTextMessageRecieved?.Invoke(this, message); } + private void OnBwoinkCooldownMessage(BwoinkCooldownMessage message, EntitySessionEventArgs eventArgs) + { + OnBwoinkCooldownReceived?.Invoke(this, message); + } + public void Send(NetUserId channelId, string text, bool playSound, bool adminOnly) { // Reuse the channel ID as the 'true sender'. diff --git a/Content.Client/Administration/UI/Bwoink/AdminWhoUIController.cs b/Content.Client/Administration/UI/Bwoink/AdminWhoUIController.cs new file mode 100644 index 0000000000..23cc08298a --- /dev/null +++ b/Content.Client/Administration/UI/Bwoink/AdminWhoUIController.cs @@ -0,0 +1,65 @@ + +using Content.Client.Administration.Systems; +using JetBrains.Annotations; +using Robust.Client.UserInterface.Controllers; + +namespace Content.Client.Administration.UI.Bwoink +{ + [UsedImplicitly] + public sealed class AdminWhoUIController : UIController, IOnSystemChanged + { + private AdminWhoWindow? _dialog; + private AdminWhoSystem? _adminWhoSystem; + + protected override string SawmillName => "c.c.admin.adminwho"; + + public void OnSystemLoaded(AdminWhoSystem system) + { + _adminWhoSystem = system; + + _dialog = new AdminWhoWindow(); + _dialog.Initialize(system); + } + + public void OnSystemUnloaded(AdminWhoSystem system) + { + if (_dialog != null) + { + _dialog.Close(); + _dialog.Uninitialize(); + _dialog.Dispose(); + _dialog = null; + } + + _adminWhoSystem = null; + } + + public void Open() + { + if (_dialog == null) + { + if (_adminWhoSystem == null) + return; + + _dialog = new AdminWhoWindow(); + _dialog.Initialize(_adminWhoSystem); + } + + _dialog.OpenCentered(); + _dialog.RefreshAdminList(); + } + + public void Toggle() + { + if (_dialog?.IsOpen == true) + Close(); + else + Open(); + } + + public void Close() + { + _dialog?.Close(); + } + } +} diff --git a/Content.Client/Administration/UI/Bwoink/AdminWhoWindow.xaml b/Content.Client/Administration/UI/Bwoink/AdminWhoWindow.xaml new file mode 100644 index 0000000000..811dbd9b97 --- /dev/null +++ b/Content.Client/Administration/UI/Bwoink/AdminWhoWindow.xaml @@ -0,0 +1,23 @@ + + + +