order latency via lobbyinfo
This commit is contained in:
@@ -216,8 +216,8 @@ namespace OpenRA.Server
|
||||
|
||||
Console.WriteLine("Order lag is now {0} frames.", lag);
|
||||
|
||||
DispatchOrders(null, 0,
|
||||
new ServerOrder(0, "SetLag", lag.ToString()).Serialize());
|
||||
lobbyInfo.GlobalSettings.OrderLatency = lag;
|
||||
SyncLobbyInfo();
|
||||
return true;
|
||||
}},
|
||||
{ "race",
|
||||
|
||||
@@ -377,9 +377,18 @@ namespace OpenRa.Game
|
||||
|
||||
if (mapName != LobbyInfo.GlobalSettings.Map)
|
||||
{
|
||||
chat.AddLine(Color.White, "Debug", "Map change {0} -> {1}".F(mapName, session.GlobalSettings.Map));
|
||||
chat.AddLine(Color.White, "Debug",
|
||||
"Map change {0} -> {1}".F(mapName, session.GlobalSettings.Map));
|
||||
ChangeMap(LobbyInfo.GlobalSettings.Map);
|
||||
}
|
||||
|
||||
if (Game.orderManager.FramesAhead != LobbyInfo.GlobalSettings.OrderLatency
|
||||
&& !Game.orderManager.GameStarted)
|
||||
{
|
||||
Game.orderManager.FramesAhead = LobbyInfo.GlobalSettings.OrderLatency;
|
||||
Game.chat.AddLine(Color.White, "Server",
|
||||
"Order lag is now {0} frames.".F(LobbyInfo.GlobalSettings.OrderLatency));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,19 +49,6 @@ namespace OpenRa.Game.Orders
|
||||
Game.chat.AddLine(order.Player, "is now YOU.");
|
||||
break;
|
||||
}
|
||||
case "SetLag":
|
||||
{
|
||||
int lag = int.Parse(order.TargetString);
|
||||
if (Game.orderManager.GameStarted)
|
||||
{
|
||||
Game.chat.AddLine(Color.White, "Server", "Failed to change lag to {0} frames".F(lag));
|
||||
return;
|
||||
}
|
||||
|
||||
Game.orderManager.FramesAhead = lag;
|
||||
Game.chat.AddLine(Color.White, "Server", "Order lag is now {0} frames.".F(lag));
|
||||
break;
|
||||
}
|
||||
case "StartGame":
|
||||
{
|
||||
Game.chat.AddLine(Color.White, "Server", "The game has started.");
|
||||
@@ -70,7 +57,6 @@ namespace OpenRa.Game.Orders
|
||||
}
|
||||
case "SyncInfo":
|
||||
{
|
||||
// Game.chat.AddLine(Color.White, "Server", "Synchronizing lobby info...");
|
||||
Game.SyncLobbyInfo(order.TargetString);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user