Localise lobby notification
This commit is contained in:
@@ -18,6 +18,9 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
{
|
{
|
||||||
public class LobbySettingsNotification : ServerTrait, IClientJoined
|
public class LobbySettingsNotification : ServerTrait, IClientJoined
|
||||||
{
|
{
|
||||||
|
[FluentReference("name", "value")]
|
||||||
|
const string NotificationLobbyOption = "notification-lobby-option";
|
||||||
|
|
||||||
public void ClientJoined(OpenRA.Server.Server server, Connection conn)
|
public void ClientJoined(OpenRA.Server.Server server, Connection conn)
|
||||||
{
|
{
|
||||||
lock (server.LobbyInfo)
|
lock (server.LobbyInfo)
|
||||||
@@ -31,11 +34,9 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
.ToDictionary(o => o.Id, o => o);
|
.ToDictionary(o => o.Id, o => o);
|
||||||
|
|
||||||
foreach (var kv in server.LobbyInfo.GlobalSettings.LobbyOptions)
|
foreach (var kv in server.LobbyInfo.GlobalSettings.LobbyOptions)
|
||||||
{
|
|
||||||
if (!defaults.LobbyOptions.TryGetValue(kv.Key, out var def) || kv.Value.Value != def.Value)
|
if (!defaults.LobbyOptions.TryGetValue(kv.Key, out var def) || kv.Value.Value != def.Value)
|
||||||
if (options.TryGetValue(kv.Key, out var option))
|
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] });
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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-no-permission-to-join = You do not have permission to join this server.
|
||||||
notification-slot-closed = Your slot was closed by the host.
|
notification-slot-closed = Your slot was closed by the host.
|
||||||
|
|
||||||
|
## LobbySettingsNotification
|
||||||
|
notification-lobby-option = { $name }: { $value }.
|
||||||
|
|
||||||
## ServerOrders, UnitOrders
|
## ServerOrders, UnitOrders
|
||||||
notification-joined = { $player } has joined the game.
|
notification-joined = { $player } has joined the game.
|
||||||
notification-lobby-disconnected = { $player } has left.
|
notification-lobby-disconnected = { $player } has left.
|
||||||
|
|||||||
Reference in New Issue
Block a user