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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Configuration;
using Robust.Shared.Input;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Utility;

namespace Content.Client.Administration.UI.CustomControls;
Expand All @@ -21,6 +24,8 @@ public sealed partial class PlayerListControl : BoxContainer

private readonly IEntityManager _entManager;
private readonly IUserInterfaceManager _uiManager;
private readonly ISharedPlayerManager _playerManager;
private readonly IConfigurationManager _config;

private PlayerInfo? _selectedPlayer;

Expand All @@ -34,6 +39,8 @@ public PlayerListControl()
{
_entManager = IoCManager.Resolve<IEntityManager>();
_uiManager = IoCManager.Resolve<IUserInterfaceManager>();
_playerManager = IoCManager.Resolve<ISharedPlayerManager>();
_config = IoCManager.Resolve<IConfigurationManager>();
_adminSystem = _entManager.System<AdminSystem>();
RobustXamlLoader.Load(this);
// Fill the Option data
Expand Down Expand Up @@ -98,7 +105,8 @@ private void FilterList()
_sortedPlayerList.Clear();
foreach (var info in _playerList)
{
var displayName = $"{info.CharacterName} ({info.Username})";
var displayName = $"{info.CharacterName} ({info.Username}@{AuthServer.GetServerFromCVarListByUrl(_config,
_playerManager.GetSessionById(info.SessionId).Channel.UserData.AuthServer)?.Id})";
Comment thread
DEATHB4DEFEAT marked this conversation as resolved.
Resolved
if (info.IdentityName != info.CharacterName)
displayName += $" [{info.IdentityName}]";
if (!string.IsNullOrEmpty(FilterLineEdit.Text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Configuration;
using Robust.Shared.Network;
using Robust.Shared.Utility;

namespace Content.Client.Administration.UI.CustomControls;

[GenerateTypedNameReferences]
public sealed partial class PlayerListEntry : BoxContainer
{
private readonly IPlayerManager _playerManager;
private readonly IConfigurationManager _config;

public PlayerListEntry()
{
RobustXamlLoader.Load(this);
_playerManager = IoCManager.Resolve<IPlayerManager>();
_config = IoCManager.Resolve<IConfigurationManager>();
}

public event Action<PlayerInfo>? OnPinStatusChanged;
Expand All @@ -36,8 +44,8 @@ public void Setup(PlayerInfo info, Func<PlayerInfo, string, string>? overrideTex

private void Update(PlayerInfo info, Func<PlayerInfo, string, string>? overrideText)
{
PlayerEntryLabel.Text = overrideText?.Invoke(info, $"{info.CharacterName} ({info.Username})") ??
$"{info.CharacterName} ({info.Username})";
PlayerEntryLabel.Text = overrideText?.Invoke(info, $"{info.CharacterName} ({info.Username}@{AuthServer.GetServerFromCVarListByUrl(_config,
_playerManager.GetSessionById(info.SessionId).Channel.UserData.AuthServer)?.Id})") ?? $"{info.CharacterName} ({info.Username})";
Comment thread
DEATHB4DEFEAT marked this conversation as resolved.
Resolved

UpdatePinButtonTexture(info.IsPinned);
}
Expand Down
4 changes: 2 additions & 2 deletions Content.Replay/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public static void Main(string[] args)
ContentModulePrefix = "Content.",
ContentBuildDirectory = "Content.Replay",
DefaultWindowTitle = "SS14 Replay",
UserDataDirectoryName = "Space Station 14",
ConfigFileName = "replay.toml"
UserDataDirectoryName = Environment.GetEnvironmentVariable("SS14_LAUNCHER_DATADIR") ?? "SimpleStation14",
ConfigFileName = "replay.toml",
Comment thread
DEATHB4DEFEAT marked this conversation as resolved.
Resolved
});
}
}
5 changes: 3 additions & 2 deletions Content.Server/Administration/PlayerLocator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Immutable;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
Expand Down Expand Up @@ -101,7 +102,7 @@ public PlayerLocator()
return ReturnForPlayerRecord(record);

// If all else fails, ask the auth server.
var authServer = _configurationManager.GetCVar(CVars.AuthServer);
var authServer = AuthServer.FromStringList(_configurationManager.GetCVar(CVars.AuthServers)).First().AuthUrl;
Comment thread
DEATHB4DEFEAT marked this conversation as resolved.
Resolved
var requestUri = $"{authServer}api/query/name?name={WebUtility.UrlEncode(playerName)}";
using var resp = await _httpClient.GetAsync(requestUri, cancel);

Expand All @@ -120,7 +121,7 @@ public PlayerLocator()
return ReturnForPlayerRecord(record);

// If all else fails, ask the auth server.
var authServer = _configurationManager.GetCVar(CVars.AuthServer);
var authServer = AuthServer.FromStringList(_configurationManager.GetCVar(CVars.AuthServers)).First().AuthUrl;
Comment thread
DEATHB4DEFEAT marked this conversation as resolved.
Resolved
var requestUri = $"{authServer}api/query/userid?userid={WebUtility.UrlEncode(userId.UserId.ToString())}";
using var resp = await _httpClient.GetAsync(requestUri, cancel);

Expand Down
17 changes: 15 additions & 2 deletions Content.Server/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,28 @@ private void SendOOC(ICommonSession player, string message)
}

Color? colorOverride = null;
var wrappedMessage = Loc.GetString("chat-manager-send-ooc-wrap-message", ("playerName",player.Name), ("message", FormattedMessage.EscapeText(message)));
var authServer = player.AuthType == LoginType.LoggedIn
? AuthServer.FromStringList(_configurationManager.GetCVar(CCVars.AuthServers))
.FirstOrDefault(x => x.AuthUrl.ToString() == player.Channel.UserData.AuthServer)?.Id ?? "Unknown"
: "Unknown";
var wrappedMessage = Loc.GetString(
"chat-manager-send-ooc-wrap-message",
("playerName", $"{player.Name}"),
("authServer", authServer),
("message", FormattedMessage.EscapeText(message)));
if (_adminManager.HasAdminFlag(player, AdminFlags.Admin))
{
var prefs = _preferencesManager.GetPreferences(player.UserId);
colorOverride = prefs.AdminOOCColor;
}
if ( _netConfigManager.GetClientCVar(player.Channel, CCVars.ShowOocPatronColor) && player.Channel.UserData.PatronTier is { } patron && PatronOocColors.TryGetValue(patron, out var patronColor))
{
wrappedMessage = Loc.GetString("chat-manager-send-ooc-patron-wrap-message", ("patronColor", patronColor),("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
wrappedMessage = Loc.GetString(
"chat-manager-send-ooc-patron-wrap-message",
("patronColor", patronColor),
("playerName", player.Name),
("authServer", authServer),
("message", FormattedMessage.EscapeText(message)));
}

//TODO: player.Name color, this will need to change the structure of the MsgChatMessage
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Einstein Engines is a hard fork of [Space Station 14](https://github.com/space-w
Our founding organization is based on a democratic system whereby our mutual contributors and downstreams have a say in what code goes into their own upstream.
If you are a representative of a former downstream of Delta-V, we would like to invite you to contact us for an opportunity to represent your fork in this new upstream.

Space Station 14 is inspired heavily by Space Station 13 and runs on [Robust Toolbox](https://github.com/space-wizards/RobustToolbox), a homegrown engine written in C#.
Space Station 14 is inspired heavily by Space Station 13 and runs on the [Supermatter Engine](https://github.com/Simple-Station/SupermatterEngine), a homegrown engine written in C#.

As a hard fork, any code sourced from a different upstream cannot ever be merged directly here, and must instead be ported.
All code present in this repository is subject to change as desired by the council of maintainers.
Expand Down
10 changes: 8 additions & 2 deletions Resources/Locale/en-US/chat/managers/chat-manager.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ chat-manager-entity-me-wrap-message = [italic]{ PROPER($entity) ->
}

chat-manager-entity-looc-wrap-message = LOOC: {$entityName}: {$message}
chat-manager-send-ooc-wrap-message = OOC: {$playerName}: {$message}
chat-manager-send-ooc-patron-wrap-message = OOC: [color={$patronColor}]{$playerName}[/color]: {$message}
chat-manager-send-ooc-wrap-message = OOC: {$playerName}{$authServer ->
[Unknown] {""}
*[other] @{$authServer}
}: {$message}
chat-manager-send-ooc-patron-wrap-message = OOC: [color={$patronColor}]{$playerName}{$authServer ->
[Unknown] {""}
*[other] @{$authServer}
}[/color]: {$message}

chat-manager-send-dead-chat-wrap-message = {$deadChannelName}: [BubbleHeader]{$playerName}[/BubbleHeader]: [BubbleContent]{$message}[/BubbleContent]
chat-manager-send-admin-dead-chat-wrap-message = {$adminChannelName}: ([BubbleHeader]{$userName}[/BubbleHeader]): [BubbleContent]{$message}[/BubbleContent]
Expand Down
2 changes: 1 addition & 1 deletion RobustToolbox
Loading