Added: Lobby server command "spectator" - will attempt to put the player in an available spectator slot
This commit is contained in:
@@ -376,15 +376,25 @@ namespace OpenRA.Server
|
|||||||
}},
|
}},
|
||||||
{ "race",
|
{ "race",
|
||||||
s =>
|
s =>
|
||||||
{
|
{
|
||||||
GetClient(conn).Country = s;
|
GetClient(conn).Country = s;
|
||||||
|
|
||||||
SyncLobbyInfo();
|
SyncLobbyInfo();
|
||||||
return true;
|
return true;
|
||||||
}},
|
}},
|
||||||
{ "spectator",
|
{ "spectator",
|
||||||
s =>
|
s =>
|
||||||
{
|
{
|
||||||
// GetClient(conn).Slot = -1; /* observer */
|
var slotData = lobbyInfo.Slots.Where(ax => ax.Spectator && !lobbyInfo.Clients.Any(l => l.Slot == ax.Index)).FirstOrDefault();
|
||||||
|
if (slotData == null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
var cl = GetClient(conn);
|
||||||
|
|
||||||
|
cl.Slot = slotData.Index;
|
||||||
|
|
||||||
|
SyncClientToPlayerReference(cl, slotData.MapPlayer != null ? Map.Players[slotData.MapPlayer] : null);
|
||||||
|
|
||||||
SyncLobbyInfo();
|
SyncLobbyInfo();
|
||||||
return true;
|
return true;
|
||||||
}},
|
}},
|
||||||
|
|||||||
Reference in New Issue
Block a user