Localise lobby notification

This commit is contained in:
Gustas
2024-10-23 12:29:11 +03:00
committed by Gustas
parent 63e8835fa0
commit b62c883951
2 changed files with 7 additions and 3 deletions

View File

@@ -18,6 +18,9 @@ namespace OpenRA.Mods.Common.Server
{
public class LobbySettingsNotification : ServerTrait, IClientJoined
{
[FluentReference("name", "value")]
const string NotificationLobbyOption = "notification-lobby-option";
public void ClientJoined(OpenRA.Server.Server server, Connection conn)
{
lock (server.LobbyInfo)
@@ -31,11 +34,9 @@ namespace OpenRA.Mods.Common.Server
.ToDictionary(o => o.Id, o => o);
foreach (var kv in server.LobbyInfo.GlobalSettings.LobbyOptions)
{
if (!defaults.LobbyOptions.TryGetValue(kv.Key, out var def) || kv.Value.Value != def.Value)
if (options.TryGetValue(kv.Key, out var option))
server.SendOrderTo(conn, "Message", option.Name + ": " + option.Values[kv.Value.Value]);
}
server.SendFluentMessageTo(conn, NotificationLobbyOption, new object[] { "name", option.Name, "value", option.Values[kv.Value.Value] });
}
}
}

View File

@@ -84,6 +84,9 @@ notification-requires-authentication = Server requires players to have an OpenRA
notification-no-permission-to-join = You do not have permission to join this server.
notification-slot-closed = Your slot was closed by the host.
## LobbySettingsNotification
notification-lobby-option = { $name }: { $value }.
## ServerOrders, UnitOrders
notification-joined = { $player } has joined the game.
notification-lobby-disconnected = { $player } has left.