remove bogus SurrenderOnDisconnect feature

This commit is contained in:
Chris Forbes
2011-12-23 16:46:40 +13:00
parent bc38e99495
commit 4bcd19f57c
4 changed files with 0 additions and 42 deletions

View File

@@ -244,7 +244,6 @@
<Compile Include="Player\ClassicProductionQueue.cs" />
<Compile Include="Player\PlaceBuilding.cs" />
<Compile Include="Player\ProductionQueue.cs" />
<Compile Include="Player\SurrenderOnDisconnect.cs" />
<Compile Include="Player\TechTree.cs" />
<Compile Include="PrimaryBuilding.cs" />
<Compile Include="Production.cs" />

View File

@@ -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<SurrenderOnDisconnect> {}
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<IResolveOrder>().Do(t => t.ResolveOrder(pl.PlayerActor, new Order("Surrender", self, false))));
}
}
}
}

View File

@@ -44,7 +44,6 @@ Player:
PlayerColorPalette:
BasePalette: terrain
PaletteFormat: cnc
SurrenderOnDisconnect:
BaseAttackNotifier:
World:

View File

@@ -130,7 +130,6 @@ Player:
SquadSize: 10
PlayerColorPalette:
BasePalette: terrain
SurrenderOnDisconnect:
DebugResourceCash:
DebugResourceOre:
DebugResourceOreCapacity: