add IEnum<T>.JoinWith, use it to clean up a bunch of things
This commit is contained in:
@@ -184,7 +184,7 @@ namespace OpenRA.Mods.RA.Server
|
||||
|
||||
var slot = server.lobbyInfo.Slots[parts[0]];
|
||||
var bot = server.lobbyInfo.ClientInSlot(parts[0]);
|
||||
var botType = string.Join(" ", parts.Skip(1).ToArray() );
|
||||
var botType = parts.Skip(1).JoinWith(" ");
|
||||
|
||||
// Invalid slot
|
||||
if (bot != null && bot.Bot == null)
|
||||
@@ -419,7 +419,7 @@ namespace OpenRA.Mods.RA.Server
|
||||
};
|
||||
|
||||
var cmdName = cmd.Split(' ').First();
|
||||
var cmdValue = string.Join(" ", cmd.Split(' ').Skip(1).ToArray());
|
||||
var cmdValue = cmd.Split(' ').Skip(1).JoinWith(" ");
|
||||
|
||||
Func<string,bool> a;
|
||||
if (!dict.TryGetValue(cmdName, out a))
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.RA.Server
|
||||
server.Settings.ExternalPort, Uri.EscapeUriString(server.Settings.Name),
|
||||
server.GameStarted ? 2 : 1, // todo: post-game states, etc.
|
||||
server.lobbyInfo.Clients.Count,
|
||||
string.Join(",", Game.CurrentMods.Select(f => "{0}@{1}".F(f.Key, f.Value.Version)).ToArray()),
|
||||
Game.CurrentMods.Select(f => "{0}@{1}".F(f.Key, f.Value.Version)).JoinWith(","),
|
||||
server.lobbyInfo.GlobalSettings.Map,
|
||||
server.Map.PlayerCount));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user