Skirmish mode starts with a bot selected.
This commit is contained in:
@@ -31,6 +31,12 @@ namespace OpenRA.Network
|
||||
return Clients.SingleOrDefault(c => c.Slot == slot.Index);
|
||||
}
|
||||
|
||||
public int FirstEmptySlot()
|
||||
{
|
||||
return Slots.First(s => !s.Closed && ClientInSlot(s) == null
|
||||
&& s.Bot == null).Index;
|
||||
}
|
||||
|
||||
public enum ClientState
|
||||
{
|
||||
NotReady,
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace OpenRA.Server
|
||||
|
||||
// Enforce correct PlayerIndex and Slot
|
||||
client.Index = newConn.PlayerIndex;
|
||||
client.Slot = ChooseFreeSlot();
|
||||
client.Slot = lobbyInfo.FirstEmptySlot();
|
||||
|
||||
var slotData = lobbyInfo.Slots.FirstOrDefault( x => x.Index == client.Slot );
|
||||
if (slotData != null && slotData.MapPlayer != null)
|
||||
@@ -235,13 +235,6 @@ namespace OpenRA.Server
|
||||
}
|
||||
catch (Exception) { DropClient(newConn); }
|
||||
}
|
||||
|
||||
int ChooseFreeSlot()
|
||||
{
|
||||
return lobbyInfo.Slots.First(s => !s.Closed && s.Bot == null
|
||||
&& !lobbyInfo.Clients.Any( c => c.Slot == s.Index )).Index;
|
||||
}
|
||||
|
||||
|
||||
public static void SyncClientToPlayerReference(Session.Client c, PlayerReference pr)
|
||||
{
|
||||
|
||||
@@ -199,6 +199,8 @@ namespace OpenRA.Widgets
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
public static Action Once( Action a ) { return () => { if (a != null) { a(); a = null; } }; }
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
||||
Reference in New Issue
Block a user