Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 3 additions & 22 deletions Modules/GoobStation/Content.Goobstation.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
// SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
// SPDX-FileCopyrightText: 2025 Aidenkrz <28298836+Aidenkrz@users.noreply.github.com>
// SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
// SPDX-FileCopyrightText: 2025 Misandry <mary@thughunt.ing>
// SPDX-FileCopyrightText: 2025 Sara Aldrete's Top Guy <mary@thughunt.ing>
// SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Goobstation.Client.IoC;
using Content.Goobstation.Client.IoC;
using Robust.Shared.ContentPack;
using Robust.Shared.Timing;

namespace Content.Goobstation.Client.Entry;

public sealed class EntryPoint : GameClient
{

public override void Init()
{
ClientGoobContentIoc.Register();

IoCManager.BuildGraph();
IoCManager.InjectDependencies(this);
}
Expand All @@ -26,14 +17,4 @@ public override void PostInit()
{
base.PostInit();
}

public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs)
{
base.Update(level, frameEventArgs);
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2025 Goob Station Contributors
//
// SPDX-License-Identifier: MPL-2.0
using Content.Goobstation.Client.Redial;

namespace Content.Goobstation.Client.IoC;

Expand All @@ -9,5 +10,6 @@ internal static class ClientGoobContentIoc
internal static void Register()
{
var instance = IoCManager.Instance!;
instance.Register<RedialManager>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Content.Goobstation.Shared.Redial;
using Robust.Client;

namespace Content.Goobstation.Client.Redial;

public sealed partial class RedialManager : SharedRedialManager
{
[Dependency] private IGameController _gameController = default!;

public override void Initialize()
{
NetManager.RegisterNetMessage<MsgRedial>(RedialOnMessage);
}

private void RedialOnMessage(MsgRedial message)
=> _gameController.Redial(message.Address);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Content.Goobstation.Server.Redial;
using Content.Server.Administration;
using Content.Shared.Administration;
using Robust.Server.Player;
using Robust.Shared.Console;

namespace Content.Goobstation.Server.Administration.Commands;

[AdminCommand(AdminFlags.Host)]
public sealed partial class RedialCommand : LocalizedCommands
{
[Dependency] private IPlayerManager _playerMan = default!;
[Dependency] private RedialManager _redialMan = default!;

public override string Command => "redial";

public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length < 2)
{
shell.WriteLine(Help);
return;
}

var address = args[0];

for (int i = 1; i < args.Length; i++)
{
var playerName = args[i];

if (!_playerMan.TryGetSessionByUsername(playerName, out var player))
{
shell.WriteError($"Unable to find player: '{playerName}'.");
return;
}

_redialMan.Redial(player.Channel, address);
}
}

public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
{
return args.Length switch
{
>1 => CompletionResult.FromHintOptions(CompletionHelper.SessionNames(), Loc.GetString("main-menu-username-text")),
_ => CompletionResult.Empty,
};
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
// SPDX-FileCopyrightText: 2025 Misandry <mary@thughunt.ing>
// SPDX-FileCopyrightText: 2025 Sara Aldrete's Top Guy <mary@thughunt.ing>
// SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Goobstation.Server.Database;
using Content.Goobstation.Server.Database;
using Content.Goobstation.Server.IoC;
using Robust.Shared.ContentPack;
using Robust.Shared.Timing;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// SPDX-FileCopyrightText: 2025 Goob Station Contributors
//
// SPDX-License-Identifier: MPL-2.0

using Content.Goobstation.Server.Database;
using Content.Goobstation.Server.Redial;

namespace Content.Goobstation.Server.IoC;

Expand All @@ -12,5 +9,6 @@ internal static void Register()
{
var instance = IoCManager.Instance!;
instance.Register<IGoobstationDbManager, GoobstationDbManager>();
instance.Register<RedialManager>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Content.Goobstation.Shared.Redial;
using Robust.Shared.Network;

namespace Content.Goobstation.Server.Redial;

public sealed class RedialManager : SharedRedialManager
{
public override void Initialize()
{
NetManager.RegisterNetMessage<MsgRedial>();
}

public void Redial(INetChannel channel, string address)
{
if (!channel.IsConnected)
return;

var msg = new MsgRedial
{
Address = address,
};

channel.SendMessage(msg);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
// SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
// SPDX-FileCopyrightText: 2025 Misandry <mary@thughunt.ing>
// SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Goobstation.Shared.IoC;
using Content.Goobstation.Shared.IoC;
using Robust.Shared.ContentPack;

namespace Content.Goobstation.Shared.Entry;
Expand Down
24 changes: 24 additions & 0 deletions Modules/GoobStation/Content.Goobstation.Shared/Redial/MsgRedial.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Lidgren.Network;
using Robust.Shared.Network;
using Robust.Shared.Serialization;

namespace Content.Goobstation.Shared.Redial;

public sealed class MsgRedial : NetMessage
{
public override MsgGroups MsgGroup => MsgGroups.Core;

public string Address = string.Empty;

public override void ReadFromBuffer(NetIncomingMessage buffer, IRobustSerializer serializer)
{
Address = buffer.ReadString();
}

public override void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serializer)
{
buffer.Write(Address);
}

public override NetDeliveryMethod DeliveryMethod => NetDeliveryMethod.ReliableOrdered;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Robust.Shared.Network;

namespace Content.Goobstation.Shared.Redial;

public abstract partial class SharedRedialManager : IPostInjectInit
{
[Dependency] protected INetManager NetManager = default!;

public void PostInject()
{
Initialize();
}

public virtual void Initialize() { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cmd-redial-desc = Redials a player to another server.
cmd-redial-help = Usage: redial [Address] <Player1> <Player2> ...
Loading