Connection Failed when trying to join custom map #12881
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Mods.Common.Traits;
|
|
||||||
using OpenRA.Network;
|
using OpenRA.Network;
|
||||||
using OpenRA.Server;
|
using OpenRA.Server;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
@@ -29,16 +29,19 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
|
|
||||||
var options = server.Map.Rules.Actors["player"].TraitInfos<ILobbyOptions>()
|
var options = server.Map.Rules.Actors["player"].TraitInfos<ILobbyOptions>()
|
||||||
.Concat(server.Map.Rules.Actors["world"].TraitInfos<ILobbyOptions>())
|
.Concat(server.Map.Rules.Actors["world"].TraitInfos<ILobbyOptions>())
|
||||||
.SelectMany(t => t.LobbyOptions(server.Map.Rules))
|
.SelectMany(t => t.LobbyOptions(server.Map.Rules));
|
||||||
.ToDictionary(o => o.Id, o => o);
|
|
||||||
|
var optionNames = new Dictionary<string, string>();
|
||||||
|
foreach (var o in options)
|
||||||
|
optionNames[o.Id] = o.Name;
|
||||||
|
|
||||||
foreach (var kv in server.LobbyInfo.GlobalSettings.LobbyOptions)
|
foreach (var kv in server.LobbyInfo.GlobalSettings.LobbyOptions)
|
||||||
{
|
{
|
||||||
Session.LobbyOptionState def;
|
Session.LobbyOptionState def;
|
||||||
LobbyOption option;
|
string optionName;
|
||||||
if (!defaults.LobbyOptions.TryGetValue(kv.Key, out def) || kv.Value.Value != def.Value)
|
if (!defaults.LobbyOptions.TryGetValue(kv.Key, out def) || kv.Value.Value != def.Value)
|
||||||
if (options.TryGetValue(kv.Key, out option))
|
if (optionNames.TryGetValue(kv.Key, out optionName))
|
||||||
server.SendOrderTo(conn, "Message", option.Name + ": " + kv.Value.Value);
|
server.SendOrderTo(conn, "Message", optionName + ": " + kv.Value.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user