make bot slot usage actually work

This commit is contained in:
Chris Forbes
2010-08-25 19:34:20 +12:00
parent 909152c662
commit 47eacc5b80
2 changed files with 30 additions and 1 deletions

View File

@@ -444,6 +444,35 @@ namespace OpenRA.Server
slotData.Closed = false;
slotData.Bot = null;
SyncLobbyInfo();
return true;
}},
{ "slot_bot",
s =>
{
var parts = s.Split(' ');
if (parts.Length != 2)
{
SendChatTo( conn, "Malformed slot_bot command" );
return true;
}
int slot;
if (!int.TryParse(parts[0], out slot)) { Log.Write("server", "Invalid slot: {0}", s ); return false; }
var slotData = lobbyInfo.Slots.FirstOrDefault( x => x.Index == slot );
if (slotData == null)
return false;
if (conn.PlayerIndex != 0)
{
SendChatTo( conn, "Only the host can alter slots" );
return true;
}
slotData.Bot = parts[1];
SyncLobbyInfo();
return true;
}},