Fix a pile of compile warnings and debug log spam. Fix <playername> (Dead) in chat

This commit is contained in:
Paul Chote
2010-10-14 19:39:37 +13:00
parent 28f79533eb
commit 9c944924de
11 changed files with 9 additions and 31 deletions

View File

@@ -52,13 +52,11 @@ namespace OpenRA.Network
class ReplayRecorderConnection : IConnection
{
IConnection inner;
FileStream replayFile;
BinaryWriter writer;
public ReplayRecorderConnection( IConnection inner, FileStream replayFile )
{
this.inner = inner;
this.replayFile = replayFile;
this.writer = new BinaryWriter( replayFile );
}

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Network
{
var player = world != null ? world.FindPlayerByClient(client) : null;
var suffix = (player != null && player.WinState == WinState.Lost) ? " (Dead)" : "";
Game.AddChatLine(client.Color1, client.Name, order.TargetString);
Game.AddChatLine(client.Color1, client.Name+suffix, order.TargetString);
}
else
Game.AddChatLine(Color.White, "(player {0})".F(clientId), order.TargetString);
@@ -105,7 +105,6 @@ namespace OpenRA.Network
case "SetStance":
{
var targetPlayer = order.Player.World.players[order.TargetLocation.X];
var oldStance = order.Player.Stances[targetPlayer];
var newStance = (Stance)order.TargetLocation.Y;
SetPlayerStance(world, order.Player, targetPlayer, newStance);

View File

@@ -27,11 +27,9 @@ namespace OpenRA.Widgets.Delegates
{
public class DeveloperModeDelegate : IWidgetDelegate
{
readonly World world;
[ObjectCreator.UseCtor]
public DeveloperModeDelegate( [ObjectCreator.Param] World world )
{
this.world = world;
var devmodeBG = Widget.RootWidget.GetWidget("INGAME_ROOT").GetWidget("DEVELOPERMODE_BG");
var devModeButton = Widget.RootWidget.GetWidget<ButtonWidget>("INGAME_DEVELOPERMODE_BUTTON");

View File

@@ -45,10 +45,7 @@ namespace OpenRA.Mods.RA
{
var bi = Rules.Info[bridge].Traits.Get<BridgeInfo>();
foreach (var template in bi.Templates)
{
BridgeTypes.Add(template.First, Pair.New(bridge, template.Second));
Log.Write("debug", "Adding template {0} for bridge {1}", template, bridge);
}
}
// Loop through the map looking for templates to overlay
@@ -66,9 +63,7 @@ namespace OpenRA.Mods.RA
}
void ConvertBridgeToActor(World w, int i, int j)
{
Log.Write("debug", "Converting bridge at {0} {1}", i, j);
{
// This cell already has a bridge overlaying it from a previous iteration
if (Bridges[i,j] != null)
return;
@@ -104,9 +99,7 @@ namespace OpenRA.Mods.RA
// This isn't the bridge you're looking for
if (!w.Map.IsInMap(x, y) || w.Map.MapTiles[x, y].image != ind)
continue;
Log.Write("debug", "Adding tile {0} {1} for type {2}", x,y,tile);
subTiles.Add(new int2(x,y),ind);
Bridges[x,y] = bridge;
}

View File

@@ -34,11 +34,9 @@ namespace OpenRA.Mods.RA.Orders
world.CancelInputMode();
var ret = InnerOrder( world, xy, mi ).ToList();
foreach( var order in ret )
{
if (ret.Count > 0)
world.CancelInputMode();
break;
}
return ret;
}

View File

@@ -276,7 +276,7 @@ namespace OpenRA.Mods.RA
OnComplete = onComplete;
Queue = queue;
Log.Write("debug", "new ProductionItem: {0} time={1} cost={2}", item, time, cost);
//Log.Write("debug", "new ProductionItem: {0} time={1} cost={2}", item, time, cost);
}
public void Tick(PlayerResources pr, PowerManager pm)

View File

@@ -89,7 +89,7 @@ namespace OpenRA.Mods.RA
foreach (var t in self.TraitsImplementing<INotifyProduction>())
t.UnitProduced(self, newUnit, exit);
Log.Write("debug", "{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID);
//Log.Write("debug", "{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID);
}
public virtual bool Produce( Actor self, ActorInfo producee )

View File

@@ -35,7 +35,6 @@ namespace OpenRA.Mods.RA
foreach (var s in self.Info.Traits.WithInterface<ExitInfo>())
{
var exit = self.Location + s.ExitCell;
var spawn = self.CenterLocation + s.SpawnOffset;
if (!self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt( exit ).Any())
{
var newUnit = self.World.CreateActor( producee.Name, new TypeDictionary
@@ -53,7 +52,7 @@ namespace OpenRA.Mods.RA
foreach (var t in self.TraitsImplementing<INotifyProduction>())
t.UnitProduced(self, newUnit, exit);
Log.Write("debug", "{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID);
//Log.Write("debug", "{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID);
return true;
}
}

View File

@@ -119,11 +119,8 @@ namespace OpenRA.Mods.RA
world.CancelInputMode();
var ret = OrderInner( world, xy, mi ).ToList();
foreach( var order in ret )
{
if (ret.Count > 0)
world.CancelInputMode();
break;
}
return ret;
}

View File

@@ -15,11 +15,9 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
{
public class IngameChromeDelegate : IWidgetDelegate
{
readonly World world;
[ObjectCreator.UseCtor]
public IngameChromeDelegate( [ObjectCreator.Param] World world )
{
this.world = world;
var r = Widget.RootWidget;
var gameRoot = r.GetWidget("INGAME_ROOT");
var optionsBG = gameRoot.GetWidget("INGAME_OPTIONS_BG");

View File

@@ -16,11 +16,9 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
{
public class OrderButtonsChromeDelegate : IWidgetDelegate
{
readonly World world;
[ObjectCreator.UseCtor]
public OrderButtonsChromeDelegate( [ObjectCreator.Param] World world )
{
this.world = world;
var r = Widget.RootWidget;
var gameRoot = r.GetWidget("INGAME_ROOT");