Enforce color/race/team locking
This commit is contained in:
@@ -54,6 +54,10 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
if (targetClient.Index != client.Index && conn.PlayerIndex != 0)
|
if (targetClient.Index != client.Index && conn.PlayerIndex != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// Map has disabled race changes
|
||||||
|
if (server.lobbyInfo.Slots[targetClient.Slot].LockRace)
|
||||||
|
return true;
|
||||||
|
|
||||||
targetClient.Country = parts[1];
|
targetClient.Country = parts[1];
|
||||||
server.SyncLobbyInfo();
|
server.SyncLobbyInfo();
|
||||||
return true;
|
return true;
|
||||||
@@ -68,6 +72,10 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
if (targetClient.Index != client.Index && conn.PlayerIndex != 0)
|
if (targetClient.Index != client.Index && conn.PlayerIndex != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// Map has disabled team changes
|
||||||
|
if (server.lobbyInfo.Slots[targetClient.Slot].LockTeam)
|
||||||
|
return true;
|
||||||
|
|
||||||
int team;
|
int team;
|
||||||
if (!int.TryParse(parts[1], out team)) { Log.Write("server", "Invalid team: {0}", s ); return false; }
|
if (!int.TryParse(parts[1], out team)) { Log.Write("server", "Invalid team: {0}", s ); return false; }
|
||||||
|
|
||||||
@@ -116,6 +124,10 @@ namespace OpenRA.Mods.RA.Server
|
|||||||
if (targetClient.Index != client.Index && conn.PlayerIndex != 0)
|
if (targetClient.Index != client.Index && conn.PlayerIndex != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// Map has disabled color changes
|
||||||
|
if (targetClient.Slot != null && server.lobbyInfo.Slots[targetClient.Slot].LockColor)
|
||||||
|
return true;
|
||||||
|
|
||||||
var ci = parts[1].Split(',').Select(cc => int.Parse(cc)).ToArray();
|
var ci = parts[1].Split(',').Select(cc => int.Parse(cc)).ToArray();
|
||||||
targetClient.ColorRamp = new ColorRamp((byte)ci[0], (byte)ci[1], (byte)ci[2], (byte)ci[3]);
|
targetClient.ColorRamp = new ColorRamp((byte)ci[0], (byte)ci[1], (byte)ci[2], (byte)ci[3]);
|
||||||
server.SyncLobbyInfo();
|
server.SyncLobbyInfo();
|
||||||
|
|||||||
Reference in New Issue
Block a user