Merge pull request #10650 from pchote/remove-fragile-diplomacy

Remove fragile diplomacy.
This commit is contained in:
Oliver Brakmann
2016-02-06 22:55:55 +01:00
24 changed files with 92 additions and 451 deletions

View File

@@ -63,7 +63,6 @@ namespace OpenRA
public bool? Fog;
public bool? Shroud;
public bool? AllyBuildRadius;
public bool? FragileAlliances;
public int? StartingCash;
public string TechLevel;
public bool ConfigurableStartingUnits = true;
@@ -86,8 +85,6 @@ namespace OpenRA
settings.AllyBuildRadius = AllyBuildRadius.Value;
if (StartingCash.HasValue)
settings.StartingCash = StartingCash.Value;
if (FragileAlliances.HasValue)
settings.FragileAlliances = FragileAlliances.Value;
if (ShortGame.HasValue)
settings.ShortGame = ShortGame.Value;
}

View File

@@ -179,7 +179,6 @@ namespace OpenRA.Network
public int Timestep = 40;
public int OrderLatency = 3; // net tick frames (x 120 = ms)
public int RandomSeed = 0;
public bool FragileAlliances = false; // Allow diplomatic stance changes after game start.
public bool AllowCheats = false;
public bool AllowSpectators = true;
public bool Dedicated;

View File

@@ -265,29 +265,6 @@ namespace OpenRA.Network
break;
}
case "SetStance":
{
if (!Game.OrderManager.LobbyInfo.GlobalSettings.FragileAlliances)
return;
var targetPlayer = order.Player.World.Players.FirstOrDefault(p => p.InternalName == order.TargetString);
var newStance = (Stance)order.ExtraData;
order.Player.SetStance(targetPlayer, newStance);
Game.Debug("{0} has set diplomatic stance vs {1} to {2}",
order.Player.PlayerName, targetPlayer.PlayerName, newStance);
// automatically declare war reciprocally
if (newStance == Stance.Enemy && targetPlayer.Stances[order.Player] == Stance.Ally)
{
targetPlayer.SetStance(order.Player, newStance);
Game.Debug("{0} has reciprocated", targetPlayer.PlayerName);
}
break;
}
case "Ping":
{
orderManager.IssueOrder(Order.Pong(order.TargetString));

View File

@@ -157,17 +157,6 @@ namespace OpenRA
return p == null || Stances[p] == Stance.Ally || (p.Spectating && !NonCombatant);
}
public void SetStance(Player target, Stance s)
{
var oldStance = Stances[target];
Stances[target] = s;
target.Shroud.UpdatePlayerStance(World, this, oldStance, s);
Shroud.UpdatePlayerStance(World, target, oldStance, s);
foreach (var nsc in World.ActorsWithTrait<INotifyStanceChanged>())
nsc.Trait.StanceChanged(nsc.Actor, this, target, oldStance, s);
}
public bool CanViewActor(Actor a)
{
return a.CanBeViewedByPlayer(this);

View File

@@ -364,12 +364,6 @@ namespace OpenRA.Traits
IEnumerable<WPos> TargetablePositions(Actor self);
}
public interface INotifyStanceChanged
{
void StanceChanged(Actor self, Player a, Player b,
Stance oldStance, Stance newStance);
}
public interface ILintPass { void Run(Action<string> emitError, Action<string> emitWarning); }
public interface ILintMapPass { void Run(Action<string> emitError, Action<string> emitWarning, Map map); }
public interface ILintRulesPass { void Run(Action<string> emitError, Action<string> emitWarning, Ruleset rules); }