From 4bcd19f57c5561809509a510f5cce957bc94abb9 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 23 Dec 2011 16:46:40 +1300 Subject: [PATCH] remove bogus SurrenderOnDisconnect feature --- OpenRA.Mods.RA/OpenRA.Mods.RA.csproj | 1 - .../Player/SurrenderOnDisconnect.cs | 39 ------------------- mods/cnc/rules/system.yaml | 1 - mods/ra/rules/system.yaml | 1 - 4 files changed, 42 deletions(-) delete mode 100644 OpenRA.Mods.RA/Player/SurrenderOnDisconnect.cs diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index b24ef6683953..9db4b2dbbd24 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -244,7 +244,6 @@ - diff --git a/OpenRA.Mods.RA/Player/SurrenderOnDisconnect.cs b/OpenRA.Mods.RA/Player/SurrenderOnDisconnect.cs deleted file mode 100644 index 2b2083689f8a..000000000000 --- a/OpenRA.Mods.RA/Player/SurrenderOnDisconnect.cs +++ /dev/null @@ -1,39 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using OpenRA.Network; -using OpenRA.Traits; - -namespace OpenRA.Mods.RA -{ - class SurrenderOnDisconnectInfo : TraitInfo {} - - class SurrenderOnDisconnect : ITick - { - bool Disconnected = false; - - public void Tick(Actor self) - { - var p = self.Owner; - if (Disconnected || !p.PlayerReference.Playable) return; - if (p.WinState == WinState.Lost || p.WinState == WinState.Won) return; /* already won or lost */ - - var client = p.World.LobbyInfo.ClientWithIndex(p.ClientIndex); - if (client == null) - return; - - if (client.State == Session.ClientState.Disconnected) - { - Disconnected = true; /* dont call this multiple times! */ - self.World.Players.Do(pl => pl.PlayerActor.TraitsImplementing().Do(t => t.ResolveOrder(pl.PlayerActor, new Order("Surrender", self, false)))); - } - } - } -} diff --git a/mods/cnc/rules/system.yaml b/mods/cnc/rules/system.yaml index d67c5a670395..542b08d410ad 100644 --- a/mods/cnc/rules/system.yaml +++ b/mods/cnc/rules/system.yaml @@ -44,7 +44,6 @@ Player: PlayerColorPalette: BasePalette: terrain PaletteFormat: cnc - SurrenderOnDisconnect: BaseAttackNotifier: World: diff --git a/mods/ra/rules/system.yaml b/mods/ra/rules/system.yaml index e2af9b95bdd4..54362ab8e9d0 100644 --- a/mods/ra/rules/system.yaml +++ b/mods/ra/rules/system.yaml @@ -130,7 +130,6 @@ Player: SquadSize: 10 PlayerColorPalette: BasePalette: terrain - SurrenderOnDisconnect: DebugResourceCash: DebugResourceOre: DebugResourceOreCapacity: