From 96ecb7c232aecbdfb35d35983564e92bf6f14ef7 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 18 May 2013 15:44:16 +1200 Subject: [PATCH 1/2] validate building placement in ResolveOrder as well --- OpenRA.Mods.RA/Player/PlaceBuilding.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Player/PlaceBuilding.cs b/OpenRA.Mods.RA/Player/PlaceBuilding.cs index 9adbef1df0..607b8f647f 100755 --- a/OpenRA.Mods.RA/Player/PlaceBuilding.cs +++ b/OpenRA.Mods.RA/Player/PlaceBuilding.cs @@ -62,7 +62,8 @@ namespace OpenRA.Mods.RA } else { - if (!self.World.CanPlaceBuilding(order.TargetString, buildingInfo, order.TargetLocation, null)) + if (!self.World.CanPlaceBuilding(order.TargetString, buildingInfo, order.TargetLocation, null) + || !buildingInfo.IsCloseEnoughToBase(self.World, order.Player, order.TargetString, order.TargetLocation)) { return; } From 4d85605ccaa478fcbaa3add086d2b12643c94f08 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 18 May 2013 15:58:16 +1200 Subject: [PATCH 2/2] fix validation of startgame order --- OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs index cea8278a39..d9bfcaac4d 100644 --- a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs @@ -91,6 +91,12 @@ namespace OpenRA.Mods.RA.Server { "startgame", s => { + if (!client.IsAdmin) + { + server.SendOrderTo(conn, "Message", "Only the host can start the game"); + return true; + } + if (server.lobbyInfo.Slots.Any(sl => sl.Value.Required && server.lobbyInfo.ClientInSlot(sl.Key) == null)) {