Browse Source

Replaced logs

master
laurids 1 year ago
parent
commit
e12395b57f
27 changed files with 109 additions and 109 deletions
  1. +12
    -12
      Assets/GWConquest/Scripts/Battle.cs
  2. +4
    -4
      Assets/GWConquest/Scripts/BoltList.cs
  3. +4
    -4
      Assets/GWConquest/Scripts/District.cs
  4. +4
    -4
      Assets/GWConquest/Scripts/DistrictFactory.cs
  5. +6
    -6
      Assets/GWConquest/Scripts/DistrictUpgrade.cs
  6. +15
    -15
      Assets/GWConquest/Scripts/Formation.cs
  7. +5
    -5
      Assets/GWConquest/Scripts/GameManager.cs
  8. +7
    -7
      Assets/GWConquest/Scripts/Inventory.cs
  9. +6
    -6
      Assets/GWConquest/Scripts/Planet.cs
  10. +1
    -1
      Assets/GWConquest/Scripts/PlanetConnection.cs
  11. +7
    -7
      Assets/GWConquest/Scripts/PlanetPlacement.cs
  12. +4
    -4
      Assets/GWConquest/Scripts/PlanetRegistry.cs
  13. +1
    -1
      Assets/GWConquest/Scripts/Player.cs
  14. +1
    -1
      Assets/GWConquest/Scripts/SpawnAIUnits.cs
  15. +2
    -2
      Assets/GWConquest/Scripts/UI/FormationIcon.cs
  16. +1
    -1
      Assets/GWConquest/Scripts/UI/FormationUI.cs
  17. +1
    -1
      Assets/GWConquest/Scripts/UI/GarrisonUI.cs
  18. +4
    -4
      Assets/GWConquest/Scripts/UI/IngameUI.cs
  19. +3
    -3
      Assets/GWConquest/Scripts/UI/ItemMoveTooltip.cs
  20. +1
    -1
      Assets/GWConquest/Scripts/UI/MainMenu.cs
  21. +3
    -3
      Assets/GWConquest/Scripts/UI/PlanetViewUI.cs
  22. +1
    -1
      Assets/GWConquest/Scripts/UI/SelectFactionMenu.cs
  23. +3
    -3
      Assets/GWConquest/Scripts/UI/TransportUI.cs
  24. +1
    -1
      Assets/GWConquest/Scripts/UI/TransportUIItemIcon.cs
  25. +1
    -1
      Assets/GWConquest/Scripts/Unit.cs
  26. +10
    -10
      Assets/GWConquest/Scripts/UnitClass.cs
  27. +1
    -1
      Assets/GWConquest/Scripts/Zone.cs

+ 12
- 12
Assets/GWConquest/Scripts/Battle.cs View File

@ -181,7 +181,7 @@ namespace GWConquest
}
}
else {
BoltLog.Error("Battle has only one player!");
Debug.LogErrorFormat("Battle has only one player!");
}
}
@ -244,11 +244,11 @@ namespace GWConquest
{
if(playerCount <= 0)
{
BoltLog.Info("No players in Battle {0}!", this);
Debug.LogFormat("No players in Battle {0}!", this);
}
else {
var finalPlayer = players.First();
BoltLog.Info("Player {0} is only one left in Battle {1}!", finalPlayer, this);
Debug.LogFormat("Player {0} is only one left in Battle {1}!", finalPlayer, this);
}
Zone.CurrentBattle = null;
@ -391,7 +391,7 @@ namespace GWConquest
private void SimulateUnitAction(UnitAction action)
{
if(DebugUI.LogBattleEvents)
BoltLog.Info("Simulating action {0} for unit {1} on flank {2}", action.ActionType, action.Unit, action.Unit.CurrentFlank);
Debug.LogFormat("Simulating action {0} for unit {1} on flank {2}", action.ActionType, action.Unit, action.Unit.CurrentFlank);
if(action.ActionType == UnitActionType.RevealSelf)
{
@ -426,7 +426,7 @@ namespace GWConquest
return;
if(DebugUI.LogBattleEvents)
BoltLog.Info("Revealing unit {0} from unit {1}", target, action.Unit);
Debug.LogFormat("Revealing unit {0} from unit {1}", target, action.Unit);
target.IncreaseRevealLevel();
@ -438,7 +438,7 @@ namespace GWConquest
return;
if(DebugUI.LogBattleEvents)
BoltLog.Info("Revealing unit {0} by itself", action.Unit);
Debug.LogFormat("Revealing unit {0} by itself", action.Unit);
action.Unit.IncreaseRevealLevel();
}
@ -482,7 +482,7 @@ namespace GWConquest
damage = 0;
if (DebugUI.LogBattleEvents)
BoltLog.Info("Dealing {0} HP damage (armour modifier: {1}) to unit {2} from unit {3}", damage, modifier, target, action.Unit);
Debug.LogFormat("Dealing {0} HP damage (armour modifier: {1}) to unit {2} from unit {3}", damage, modifier, target, action.Unit);
bool isGlancingHit = damage == 0 || modifier < 1f;
@ -500,7 +500,7 @@ namespace GWConquest
if (Check(GameManager.Instance.RevealChanceAttack))
{
if (DebugUI.LogBattleEvents)
BoltLog.Info("Revealing unit {0} as it attacked unit {1}", action.Unit, target);
Debug.LogFormat("Revealing unit {0} as it attacked unit {1}", action.Unit, target);
action.Unit.IncreaseRevealLevel();
}
}
@ -639,18 +639,18 @@ namespace GWConquest
{
if(flank.Player != unit.Player)
{
BoltLog.Error("Tried to move unit {0} of player {1} to flank {2} of player {3}", unit, unit.Player, flank, flank.Player);
Debug.LogErrorFormat("Tried to move unit {0} of player {1} to flank {2} of player {3}", unit, unit.Player, flank, flank.Player);
}
else if(flank.MaxUnitCount <= flankIndex)
{
BoltLog.Error("Tried to move unit {0} to flank index {1} on flank {2} with size {3}", unit, flankIndex, flank, flank.MaxUnitCount);
Debug.LogErrorFormat("Tried to move unit {0} to flank index {1} on flank {2} with size {3}", unit, flankIndex, flank, flank.MaxUnitCount);
}
else if(flank.GetUnit(flankIndex) != null)
{
BoltLog.Error("Tried to move unit {0} to flank index {1} on flank {2}, but it was already occupied by {3}", unit, flankIndex, flank, flank.GetUnit(flankIndex));
Debug.LogErrorFormat("Tried to move unit {0} to flank index {1} on flank {2}, but it was already occupied by {3}", unit, flankIndex, flank, flank.GetUnit(flankIndex));
}
else {
BoltLog.Info("Moving unit {0} to flank index {1} on flank {2}", unit, flankIndex, flank);
Debug.LogFormat("Moving unit {0} to flank index {1} on flank {2}", unit, flankIndex, flank);
unit.BattleState = BattleUnitState.MovingToFlank;
float movement = unit.Class.Movement <= 0 ? 1f : unit.Class.Movement;


+ 4
- 4
Assets/GWConquest/Scripts/BoltList.cs View File

@ -146,25 +146,25 @@ namespace GWConquest
public void Read(UdpPacket packet)
{
//BoltLog.Info("Reading Bolt list...");
//Debug.LogFormat("Reading Bolt list...");
int count = packet.ReadInt();
entries = new T[count];
for (int i = 0; i < count; i++)
{
entries[i] = ReadEntry(packet);
}
//BoltLog.Info("Finished reading Bolt list {0}", this);
//Debug.LogFormat("Finished reading Bolt list {0}", this);
}
public void Write(UdpPacket packet)
{
//BoltLog.Info("Writing Bolt list...");
//Debug.LogFormat("Writing Bolt list...");
packet.WriteInt(entries.Length);
foreach (T e in entries)
{
WriteEntry(packet, e);
}
//BoltLog.Info("Finished writing Bolt list {0}", this);
//Debug.LogFormat("Finished writing Bolt list {0}", this);
}
public override string ToString()


+ 4
- 4
Assets/GWConquest/Scripts/District.cs View File

@ -63,7 +63,7 @@ namespace GWConquest
}
else if(id >= Player.PlayerList.Count)
{
BoltLog.Warn("Tried accessing player {0} in player list of length {1}", id, Player.PlayerList.Count);
Debug.LogWarningFormat("Tried accessing player {0} in player list of length {1}", id, Player.PlayerList.Count);
return null;
}
else
@ -103,7 +103,7 @@ namespace GWConquest
Inventory.StorageCapacity = StorageCapacity;
storageCapacity.OnValueChanged += (prev, now) => Inventory.StorageCapacity = now;
//BoltLog.Info("Setting storage capacity to {0}", StorageCapacity);
//Debug.LogFormat("Setting storage capacity to {0}", StorageCapacity);
AllDistricts.Add(this);
@ -277,13 +277,13 @@ namespace GWConquest
{
if(captureCooldown.Value >= GameManager.Instance.DistrictCaptureCooldown)
{
BoltLog.Info($"Allegiance changed in district {this} to player {player}");
Debug.LogFormat($"Allegiance changed in district {this} to player {player}");
ControllingPlayer = player;
}
else {
if(captureCooldown.Value == 0)
{
BoltLog.Info("Player {0} is the only player in district {1}, starting allegiance change...", player, this);
Debug.LogFormat("Player {0} is the only player in district {1}, starting allegiance change...", player, this);
}
captureCooldown.Value += BoltNetwork.FrameDeltaTime;
}


+ 4
- 4
Assets/GWConquest/Scripts/DistrictFactory.cs View File

@ -119,7 +119,7 @@ namespace GWConquest
{
if(!District.CanBuild(buildable))
{
BoltLog.Error($"Could not build {buildable} in district {gameObject.name}");
Debug.LogErrorFormat($"Could not build {buildable} in district {gameObject.name}");
return;
}
@ -145,7 +145,7 @@ namespace GWConquest
planetInv.RemoveItem(itemId, cost.Amount);
}
else {
BoltLog.Error("Error while building {0}: Item {1} x {2} not found in inventories", buildable, cost.Item, cost.Amount);
Debug.LogErrorFormat("Error while building {0}: Item {1} x {2} not found in inventories", buildable, cost.Item, cost.Amount);
}
}
}
@ -155,7 +155,7 @@ namespace GWConquest
int length = ProductionQueueLength;
if(length < MaxQueueLength)
{
BoltLog.Info("Adding unit {0} to production queue on district {1}", buildable, gameObject.name);
Debug.LogFormat("Adding unit {0} to production queue on district {1}", buildable, gameObject.name);
productionQueue.Add(new ProductionQueueEntry() {
UnitClass = buildable.ID,
@ -196,7 +196,7 @@ namespace GWConquest
}
else
{
BoltLog.Error("No corresponding zone for factory {0}", gameObject.name);
Debug.LogErrorFormat("No corresponding zone for factory {0}", gameObject.name);
}
}
else if(buildable is DistrictUpgrade)


+ 6
- 6
Assets/GWConquest/Scripts/DistrictUpgrade.cs View File

@ -13,7 +13,7 @@ namespace GWConquest
public static void LoadRegistry()
{
BoltLog.Info("Loading district upgrades...");
Debug.LogFormat("Loading district upgrades...");
List<DistrictUpgrade> upgradeList = new List<DistrictUpgrade>();
UpgradeRegistry = new Dictionary<string, DistrictUpgrade>();
@ -85,14 +85,14 @@ namespace GWConquest
}
catch (Exception ex)
{
BoltLog.Error("Could not parse district upgrade");
BoltLog.Exception(ex);
Debug.LogErrorFormat("Could not parse district upgrade");
Debug.LogException(ex);
}
}
Upgrades = upgradeList.ToArray();
BoltLog.Info("District upgrades loaded.");
Debug.LogFormat("District upgrades loaded.");
}
public static DistrictUpgrade FromID(ushort id)
@ -119,7 +119,7 @@ namespace GWConquest
}
if(Util.IsStringEmpty(name))
{
BoltLog.Warn("DistrictUpgrade.FromName called with null name!");
Debug.LogWarningFormat("DistrictUpgrade.FromName called with null name!");
return null;
}
if (UpgradeRegistry.ContainsKey(name))
@ -128,7 +128,7 @@ namespace GWConquest
}
else
{
BoltLog.Warn("DistrictUpgrade {0} not in registry!", name);
Debug.LogWarningFormat("DistrictUpgrade {0} not in registry!", name);
return null;
}
}


+ 15
- 15
Assets/GWConquest/Scripts/Formation.cs View File

@ -82,7 +82,7 @@ namespace GWConquest
newZone.OnFormationArrived(this);
}
BoltLog.Info("Current zone changed from {0} to {1} on formation {2}", previousZone, newZone, this);
Debug.LogFormat("Current zone changed from {0} to {1} on formation {2}", previousZone, newZone, this);
}
}
@ -294,7 +294,7 @@ namespace GWConquest
}
else
{
BoltLog.Warn("No path found between {0} and {1}", currentZone, targetZone);
Debug.LogWarningFormat("No path found between {0} and {1}", currentZone, targetZone);
}
}
@ -304,7 +304,7 @@ namespace GWConquest
{
if (!CanMoveTo(path[0], path[1]))
{
BoltLog.Info($"Formation {this} has not enough fuel for transition {path[0]} -> {path[1]}");
Debug.LogFormat($"Formation {this} has not enough fuel for transition {path[0]} -> {path[1]}");
return;
}
@ -313,7 +313,7 @@ namespace GWConquest
}
else
{
BoltLog.Info("Could not move formation {0} (controlled: {1}, movement state: {2})",
Debug.LogFormat("Could not move formation {0} (controlled: {1}, movement state: {2})",
this, IsOwner, MovementState);
}
}
@ -329,7 +329,7 @@ namespace GWConquest
Zone firstZone = Zone.GetFromId(zoneIDs[0]);
if (!CanMoveTo(currentZone, firstZone))
{
BoltLog.Info($"Formation {this} has not enough fuel for transition {currentZone} -> {firstZone}");
Debug.LogFormat($"Formation {this} has not enough fuel for transition {currentZone} -> {firstZone}");
return;
}
@ -370,7 +370,7 @@ namespace GWConquest
{
if (!CanMoveTo(currentZone, target))
{
BoltLog.Info($"Formation {this} has not enough fuel for transition {currentZone} -> {target}");
Debug.LogFormat($"Formation {this} has not enough fuel for transition {currentZone} -> {target}");
return;
}
@ -412,7 +412,7 @@ namespace GWConquest
}
if (remainingFuel != 0)
{
BoltLog.Warn($"There is {remainingFuel} required fuel remaining after consuming everything, this should not happen!");
Debug.LogWarningFormat($"There is {remainingFuel} required fuel remaining after consuming everything, this should not happen!");
}
currentTransition.Value = new Transition()
@ -429,7 +429,7 @@ namespace GWConquest
}
else
{
BoltLog.Warn("Ignoring MoveToZone on {0} (movement state: {1})", this, MovementState);
Debug.LogWarningFormat("Ignoring MoveToZone on {0} (movement state: {1})", this, MovementState);
}
}
@ -500,7 +500,7 @@ namespace GWConquest
}
else
{
BoltLog.Error("Formation {0} lost its parent formation {1}!", this, ParentFormation);
Debug.LogErrorFormat("Formation {0} lost its parent formation {1}!", this, ParentFormation);
ParentFormation = null;
IsEmbarked = false;
}
@ -553,7 +553,7 @@ namespace GWConquest
}
else
{
BoltLog.Info($"Formation {this} has not enough fuel for transition {currentZone} -> {PathQueue.First()}");
Debug.LogFormat($"Formation {this} has not enough fuel for transition {currentZone} -> {PathQueue.First()}");
pathQueue.Clear();
MovementState = FormationMovementState.Idle;
}
@ -761,7 +761,7 @@ namespace GWConquest
public override void OnNetworkSpawn()
{
BoltLog.Info("Formation attached: {0}", this);
Debug.LogFormat("Formation attached: {0}", this);
FormationInventory = new CombinedInventory(() => Units.Select(u => u.Inventory));
@ -808,7 +808,7 @@ namespace GWConquest
public void OnUnitAdded(Unit unit)
{
BoltLog.Info("Unit {0} added to formation {1}", unit, this);
Debug.LogFormat("Unit {0} added to formation {1}", unit, this);
if (currentZone != null)
{
currentZone.OnFormationChanged(this);
@ -983,13 +983,13 @@ namespace GWConquest
if (Morale > 0)
{
if (DebugUI.LogBattleEvents)
BoltLog.Info("Formation {0} took {1} points of morale damage", this, moraleDamage);
Debug.LogFormat("Formation {0} took {1} points of morale damage", this, moraleDamage);
Morale -= moraleDamage;
if (Morale <= 0)
{
Morale = 0;
BoltLog.Info("Formation {0} is demoralized and will flee!", this);
Debug.LogFormat("Formation {0} is demoralized and will flee!", this);
var retreatZone = GetRetreatZone();
BeginMovementServer(retreatZone);
@ -1026,7 +1026,7 @@ namespace GWConquest
{
StartingMorale = Mathf.Min(Units.Sum(u => u.Class.Morale), MoraleCap);
Morale = StartingMorale;
BoltLog.Info("Morale calculated to {0} for formation {1}", Morale, this);
Debug.LogFormat("Morale calculated to {0} for formation {1}", Morale, this);
bool isArriving = MovementState == FormationMovementState.FinishingMovement;


+ 5
- 5
Assets/GWConquest/Scripts/GameManager.cs View File

@ -98,7 +98,7 @@ namespace GWConquest
_instance = FindObjectOfType<GameManager>();
if(_instance == null)
{
BoltLog.Warn("Found no Game Manager instance!");
Debug.LogWarningFormat("Found no Game Manager instance!");
}
}
return _instance;
@ -122,7 +122,7 @@ namespace GWConquest
{
if(SpawnAIPlayer)
{
BoltLog.Info("Spawning AI players...");
Debug.LogFormat("Spawning AI players...");
for(int i = 0; i < Factions.Length; i++)
{
var faction = Factions[i];
@ -162,16 +162,16 @@ namespace GWConquest
if(BoltNetwork.IsClient)
{
BoltLog.Info("Loading non-static planets on client...");
Debug.LogFormat("Loading non-static planets on client...");
InitPlanetsClient();
}
Planet.SetupPlanetPathfinding();
BoltLog.Info("Setup planet pathfinding.");
Debug.LogFormat("Setup planet pathfinding.");
Planet.UpdateVisibilityStatus();
BoltLog.Info("Entities loaded, Dismissing loading screen...");
Debug.LogFormat("Entities loaded, Dismissing loading screen...");
LoadingScreen.Dismiss();
}


+ 7
- 7
Assets/GWConquest/Scripts/Inventory.cs View File

@ -67,7 +67,7 @@ namespace GWConquest
var item = ItemRegistry.Instance.GetEntry(itemName);
if(!item.Stackable && amount > 1)
{
BoltLog.Warn("Item {0} is not stackable to amount {1}", itemName, amount);
Debug.LogWarningFormat("Item {0} is not stackable to amount {1}", itemName, amount);
amount = 1;
}
return new ItemStack {
@ -83,7 +83,7 @@ namespace GWConquest
var item = ItemRegistry.Instance.GetEntry(itemID);
if(!item.Stackable && amount > 1)
{
BoltLog.Warn("Item {0} is not stackable to amount {1}", itemID, amount);
Debug.LogWarningFormat("Item {0} is not stackable to amount {1}", itemID, amount);
amount = 1;
}
return new ItemStack {
@ -261,7 +261,7 @@ namespace GWConquest
if(amountToRemove > 0)
{
BoltLog.Error("Inventory Error: Did not remove enough items of type {0} (desired: {1}, left: {2})", item, amount, amountToRemove);
Debug.LogErrorFormat("Inventory Error: Did not remove enough items of type {0} (desired: {1}, left: {2})", item, amount, amountToRemove);
}
return true;
@ -335,12 +335,12 @@ namespace GWConquest
target.AddItem(itemID, itemAmount);
}
else {
BoltLog.Error("Could not move {0} of item {1} between inventories", itemAmount, itemID);
Debug.LogErrorFormat("Could not move {0} of item {1} between inventories", itemAmount, itemID);
}
}
else {
BoltLog.Error("One of the specified inventories is null");
Debug.LogErrorFormat("One of the specified inventories is null");
}
}
@ -386,7 +386,7 @@ namespace GWConquest
}
}
}
BoltLog.Error("Could not add all items to combined inventory: item {0}, amount {1}, left {2}", item, amount, remainingAmount);
Debug.LogErrorFormat("Could not add all items to combined inventory: item {0}, amount {1}, left {2}", item, amount, remainingAmount);
return true;
}
else {
@ -414,7 +414,7 @@ namespace GWConquest
}
}
}
BoltLog.Error("Could not remove all items from combined inventory: item {0}, amount {1}, left {2}", item, amount, remainingAmount);
Debug.LogErrorFormat("Could not remove all items from combined inventory: item {0}, amount {1}, left {2}", item, amount, remainingAmount);
return true;
}
else {


+ 6
- 6
Assets/GWConquest/Scripts/Planet.cs View File

@ -144,7 +144,7 @@ namespace GWConquest
public bool IsConnectedTo(Planet planet)
{
BoltLog.Info("Planet {0} has connections {1}", this, Util.PrintObject(connections));
Debug.LogFormat("Planet {0} has connections {1}", this, Util.PrintObject(connections));
if (connections == null) return false;
return connections.Exists(conn => (conn.planet1 == planet || conn.planet2 == planet));
}
@ -158,29 +158,29 @@ namespace GWConquest
/*if(BoltNetwork.IsClient)
{
BoltLog.Info("Planet attached on client, name: {0}", State.PlanetName);
Debug.LogFormat("Planet attached on client, name: {0}", State.PlanetName);
State.AddCallback("SpaceZoneID", () => {
BoltLog.Info("Space zone id changed to {0} on client planet {1}, static: {2}", State.SpaceZoneID, State.PlanetName, PlanetStatic);
Debug.LogFormat("Space zone id changed to {0} on client planet {1}, static: {2}", State.SpaceZoneID, State.PlanetName, PlanetStatic);
var zone = GetMainZone(ZoneType.Space);
zone.SetZoneId(State.SpaceZoneID);
zone.zoneType = ZoneType.Space;
});
State.AddCallback("AttackZoneID", () => {
BoltLog.Info("Attack zone id changed to {0} on client planet {1}, static: {2}", State.AttackZoneID, State.PlanetName, PlanetStatic);
Debug.LogFormat("Attack zone id changed to {0} on client planet {1}, static: {2}", State.AttackZoneID, State.PlanetName, PlanetStatic);
var zone = GetAttackZones(ZoneType.Ground)[0];
zone.SetZoneId(State.AttackZoneID);
zone.zoneType = ZoneType.Ground;
});
State.AddCallback("PlanetName", () => {
BoltLog.Info("planet name changed to {0} on client planet, static: {1}", State.PlanetName, PlanetStatic);
Debug.LogFormat("planet name changed to {0} on client planet, static: {1}", State.PlanetName, PlanetStatic);
planetName = State.PlanetName;
});
State.AddCallback("ConnectedPlanets", () => {
BoltLog.Info("Connected planets changed to {0} on client planet{1}, static: {2}", ConnectedPlanetsList, State.PlanetName, PlanetStatic);
Debug.LogFormat("Connected planets changed to {0} on client planet{1}, static: {2}", ConnectedPlanetsList, State.PlanetName, PlanetStatic);
});
}*/


+ 1
- 1
Assets/GWConquest/Scripts/PlanetConnection.cs View File

@ -241,7 +241,7 @@ namespace GWConquest
}
else
{
BoltLog.Info("Connecting planets {0} and {1}", planet1, planet2);
Debug.LogFormat("Connecting planets {0} and {1}", planet1, planet2);
if (!planet1.connections.Contains(this))
{
planet1.connections.Add(this);


+ 7
- 7
Assets/GWConquest/Scripts/PlanetPlacement.cs View File

@ -110,7 +110,7 @@ namespace GWConquest
if(AvailableNames.Count == 0)
{
AvailableNames.AddRange(PlanetNames);
BoltLog.Info("Refilling planet name list...");
Debug.LogFormat("Refilling planet name list...");
}
int i = Random.Range(0, AvailableNames.Count);
string name = AvailableNames[i];
@ -198,7 +198,7 @@ namespace GWConquest
type = DistrictType.Civil;
}
BoltLog.Info("Spawning district of type {0} on planet {1}", type, planet.name);
Debug.LogFormat("Spawning district of type {0} on planet {1}", type, planet.name);
var point2D = Random.insideUnitCircle * districtSettings.MaxDistrictRadius;
@ -391,13 +391,13 @@ namespace GWConquest
List<Planet> allPlanets = new List<Planet>(FindObjectsOfType<Planet>());
int origPlanetCount = allPlanets.Count;
BoltLog.Info("Static planets: {0}", origPlanetCount);
Debug.LogFormat("Static planets: {0}", origPlanetCount);
foreach(var conn in PreConnections)
{
float connLength = conn.GetLength();
int planetCount = Mathf.RoundToInt( Random.Range(connLength / MaxPlanetDistance, connLength / MinPlanetDistance) ) - 1;
BoltLog.Info("Spawning {0} planets between {1} and {2}", planetCount, conn.planet1.PlanetName, conn.planet2.PlanetName);
Debug.LogFormat("Spawning {0} planets between {1} and {2}", planetCount, conn.planet1.PlanetName, conn.planet2.PlanetName);
Vector3 start = conn.planet1.transform.position;
Vector3 dir = conn.planet2.transform.position - start;
@ -430,7 +430,7 @@ namespace GWConquest
PlacePlanetsSecondPassNew(allPlanets, spawnedConnections, ref nextZoneId);
int finalPlanetCount = allPlanets.Count;
BoltLog.Info("Additional planets: {0}", finalPlanetCount-origPlanetCount);
Debug.LogFormat("Additional planets: {0}", finalPlanetCount-origPlanetCount);
}
private void PlacePlanetsSecondPass(List<Planet> allPlanets, List<PlanetConnection> spawnedConnections, ref int nextZoneId)
@ -484,7 +484,7 @@ namespace GWConquest
private void PlacePlanetsSecondPassNew(List<Planet> allPlanets, List<PlanetConnection> spawnedConnections, ref int nextZoneId)
{
int planetsToSpawn = Random.Range(Pass2New_MinPlanets, Pass2New_MaxPlanets);
BoltLog.Info("Spawning {0} planets in second pass.", planetsToSpawn);
Debug.LogFormat("Spawning {0} planets in second pass.", planetsToSpawn);
Vector3 galaxyCenter = transform.position;
@ -577,7 +577,7 @@ namespace GWConquest
if(!hasSpawned)
{
BoltLog.Warn("Could not find a position to place the {0}th planet. Aborting.", i);
Debug.LogWarningFormat("Could not find a position to place the {0}th planet. Aborting.", i);
break;
}
}


+ 4
- 4
Assets/GWConquest/Scripts/PlanetRegistry.cs View File

@ -47,7 +47,7 @@ namespace GWConquest
}
else
{
BoltLog.Warn("Planet {0} not found in planet map!", planetName);
Debug.LogWarningFormat("Planet {0} not found in planet map!", planetName);
return null;
}
}
@ -61,7 +61,7 @@ namespace GWConquest
{
planetDataMap = new Dictionary<string, PlanetData>();
BoltLog.Info("Loading Planet Map...");
Debug.LogFormat("Loading Planet Map...");
TextAsset database = Resources.Load<TextAsset>("Database/Planets");
CSVFile csv = CSVFile.ParseCSV(database.text);
for(int i = 0; i < csv.Length; i++)
@ -81,7 +81,7 @@ namespace GWConquest
HasShipyard = shipyard > 0,
ShipyardRating = shipyard
};
BoltLog.Info("Loaded planet {0}", planet.Name);
Debug.LogFormat("Loaded planet {0}", planet.Name);
planetDataMap.Add(planet.Name, planet);
}
@ -261,7 +261,7 @@ namespace GWConquest
}
catch(System.Exception ex)
{
BoltLog.Warn("Failed to parse structure types: {0}", structureTypes);
Debug.LogWarningFormat("Failed to parse structure types: {0}", structureTypes);
BoltLog.Exception(ex);
return null;
}


+ 1
- 1
Assets/GWConquest/Scripts/Player.cs View File

@ -83,7 +83,7 @@ namespace GWConquest
public override void OnGainedOwnership()
{
CurrentPlayer = this;
BoltLog.Info("Current player is {0} with connection ID {1}", this, OwnerClientId);
Debug.LogFormat("Current player is {0} with connection ID {1}", this, OwnerClientId);
}
public void SetFaction(ushort ind)


+ 1
- 1
Assets/GWConquest/Scripts/SpawnAIUnits.cs View File

@ -16,7 +16,7 @@ namespace GWConquest {
public void SpawnUnits()
{
BoltLog.Info("Spawning AI units");
Debug.LogFormat("Spawning AI units");
Player player = Player.GetPlayerById(playerId);
if(player != null)


+ 2
- 2
Assets/GWConquest/Scripts/UI/FormationIcon.cs View File

@ -111,7 +111,7 @@ namespace GWConquest {
if (planet != null)
{
CurrentFormation.TryMoveToPlanet(planet);
BoltLog.Info("Moving formation {0} to planet {1}", CurrentFormation.name, planet.name);
Debug.LogFormat("Moving formation {0} to planet {1}", CurrentFormation.name, planet.name);
break;
}
}
@ -123,7 +123,7 @@ namespace GWConquest {
if (RectTransformUtility.RectangleContainsScreenPoint(di.GetComponent<RectTransform>(), mousePos))
{
CurrentFormation.TryMoveToZone(di.zone);
BoltLog.Info("Moving formation {0} to zone {1}", CurrentFormation.name, di.zone);
Debug.LogFormat("Moving formation {0} to zone {1}", CurrentFormation.name, di.zone);
break;
}
}


+ 1
- 1
Assets/GWConquest/Scripts/UI/FormationUI.cs View File

@ -117,7 +117,7 @@ namespace GWConquest
if (planet != null)
{
formation.TryMoveToPlanet(planet);
BoltLog.Info("Moving formation {0} to planet {1}", formation.name, planet.name);
Debug.LogFormat("Moving formation {0} to planet {1}", formation.name, planet.name);
break;
}
}


+ 1
- 1
Assets/GWConquest/Scripts/UI/GarrisonUI.cs View File

@ -70,7 +70,7 @@ namespace GWConquest
elementComp.Planet = obj as Planet;
}
else {
BoltLog.Error("Displayed object is neither District or Formation: {0}", obj);
Debug.LogErrorFormat("Displayed object is neither District or Formation: {0}", obj);
}


+ 4
- 4
Assets/GWConquest/Scripts/UI/IngameUI.cs View File

@ -127,7 +127,7 @@ namespace GWConquest
{
Vector3 camPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
//BoltLog.Info("Raycasting with origin {0}; direction {1}", camPos, Camera.main.transform.forward);
//Debug.LogFormat("Raycasting with origin {0}; direction {1}", camPos, Camera.main.transform.forward);
Debug.DrawRay(camPos, Camera.main.transform.forward, Color.green, 5);
@ -137,7 +137,7 @@ namespace GWConquest
bool hasHit = false;
foreach (RaycastResult result in list)
{
BoltLog.Info("Found game object {0}", result.gameObject);
Debug.LogFormat("Found game object {0}", result.gameObject);
Planet planet = result.gameObject.GetComponentInParent<Planet>();
if (planet != null)
{
@ -145,7 +145,7 @@ namespace GWConquest
{
EnablePlanetView(planet);
BoltLog.Info("Enabling planet view on {0}", planet.gameObject);
Debug.LogFormat("Enabling planet view on {0}", planet.gameObject);
}
else
{
@ -153,7 +153,7 @@ namespace GWConquest
PlanetHud.SelectPlanet(planet);
BoltLog.Info("Selecting planet {0}", planet.gameObject);
Debug.LogFormat("Selecting planet {0}", planet.gameObject);
}


+ 3
- 3
Assets/GWConquest/Scripts/UI/ItemMoveTooltip.cs View File

@ -79,11 +79,11 @@ namespace GWConquest
GWNetworkManager.Instance.MoveItemServerRpc(originBeh, targetBeh, MovedItem.ItemName, current);
}
else {
BoltLog.Error("Amount {0} of item {1} is not transferable ({2})", current, MovedItem.ItemName, transferable);
Debug.LogErrorFormat("Amount {0} of item {1} is not transferable ({2})", current, MovedItem.ItemName, transferable);
}
}
else {
BoltLog.Error("Invalid amount: {0}", AmountField.text);
Debug.LogErrorFormat("Invalid amount: {0}", AmountField.text);
}
Cancel();
@ -115,7 +115,7 @@ namespace GWConquest
}
}
else {
BoltLog.Error("bad string in input field: {0}", AmountField.text);
Debug.LogErrorFormat("bad string in input field: {0}", AmountField.text);
AmountField.text = "";
}
}


+ 1
- 1
Assets/GWConquest/Scripts/UI/MainMenu.cs View File

@ -56,7 +56,7 @@ namespace GWConquest
public override void SessionListUpdated(Map<Guid, UdpSession> sessionList)
{
BoltLog.Info("Session list updated: {0} total sessions", sessionList.Count);
Debug.LogFormat("Session list updated: {0} total sessions", sessionList.Count);
foreach (var session in sessionList)
{


+ 3
- 3
Assets/GWConquest/Scripts/UI/PlanetViewUI.cs View File

@ -119,7 +119,7 @@ namespace GWConquest
public void SpawnLandingLine(Formation f)
{
BoltLog.Info("Spawning landing line");
Debug.LogFormat("Spawning landing line");
if(f.CurrentTransition.OriginZone.planet == selectedPlanet)
{
bool isLanding = f.MovementOriginFormation != null;
@ -458,7 +458,7 @@ namespace GWConquest
public void SwitchPlanet(int dir)
{
BoltLog.Info("Switching planets...");
Debug.LogFormat("Switching planets...");
var player = Player.CurrentPlayer;
var planets = Planet.AllPlanets.Where(p => {
return p.ControllingPlayer == player ||
@ -477,7 +477,7 @@ namespace GWConquest
nextInd -= planets.Count;
}
BoltLog.Info("Switching to planet {0}", planets[nextInd].PlanetName);
Debug.LogFormat("Switching to planet {0}", planets[nextInd].PlanetName);
var ingameUI = GetComponentInParent<IngameUI>();
ingameUI.DisablePlanetView();


+ 1
- 1
Assets/GWConquest/Scripts/UI/SelectFactionMenu.cs View File

@ -25,7 +25,7 @@ namespace GWConquest
public void StartGame()
{
BoltLog.Info("Starting game with faction {0}", FactionIndices[selected]);
Debug.LogFormat("Starting game with faction {0}", FactionIndices[selected]);
FindObjectOfType<MainMenu>().StartServer(FactionIndices[selected]);
}
}


+ 3
- 3
Assets/GWConquest/Scripts/UI/TransportUI.cs View File

@ -140,7 +140,7 @@ namespace GWConquest
elementComp.Planet = obj as Planet;
}
else {
BoltLog.Error("Displayed object is neither District or Formation: {0}", obj);
Debug.LogErrorFormat("Displayed object is neither District or Formation: {0}", obj);
}
@ -166,7 +166,7 @@ namespace GWConquest
panel = SpacePanel;
}
else {
BoltLog.Warn("UI Icon {0} not in any panel!", icon);
Debug.LogWarningFormat("UI Icon {0} not in any panel!", icon);
return;
}
@ -185,7 +185,7 @@ namespace GWConquest
panel = SpacePanel;
}
else {
BoltLog.Warn("UI Element {0} not in any panel!", element);
Debug.LogWarningFormat("UI Element {0} not in any panel!", element);
return;
}
SelectFormationForPanel(panel, element);


+ 1
- 1
Assets/GWConquest/Scripts/UI/TransportUIItemIcon.cs View File

@ -65,7 +65,7 @@ namespace GWConquest {
return false;
}
else {
BoltLog.Info("No remaining space in target inventory!");
Debug.LogFormat("No remaining space in target inventory!");
}
}
}


+ 1
- 1
Assets/GWConquest/Scripts/Unit.cs View File

@ -562,7 +562,7 @@ namespace GWConquest
if(Morale > 0 && !IsDead)
{
if(DebugUI.LogBattleEvents)
BoltLog.Info("Unit {0} took {1} points of morale damage", this, moraleDamage);
Debug.LogFormat("Unit {0} took {1} points of morale damage", this, moraleDamage);
Morale -= moraleDamage;
if(Morale <= 0)
{


+ 10
- 10
Assets/GWConquest/Scripts/UnitClass.cs View File

@ -21,7 +21,7 @@ namespace GWConquest
public static void LoadClassMap()
{
BoltLog.Info("Loading unit classes...");
Debug.LogFormat("Loading unit classes...");
classMap = new Dictionary<string, UnitClass>();
TextAsset shipsDatabase = Resources.Load<TextAsset>("Database/Ships");
LoadDatabase(shipsDatabase, ZoneType.Space);
@ -36,7 +36,7 @@ namespace GWConquest
classList.Sort((uc1, uc2) => uc1.ID - uc2.ID);
unitClasses = classList.ToArray();
GameManager.Instance.UnitClasses = unitClasses;
BoltLog.Info("All unit classes loaded.");
Debug.LogFormat("All unit classes loaded.");
}
private static void LoadDatabase(TextAsset asset, ZoneType zoneType, char delimiter=',')
@ -55,7 +55,7 @@ namespace GWConquest
unitClass.FullName = data.GetString("Full Name");
BoltLog.Info("Parsing unit class {0}", unitClass.ShortName);
Debug.LogFormat("Parsing unit class {0}", unitClass.ShortName);
unitClass.Hitpoints = data.GetInt("Hitpoints");
@ -177,8 +177,8 @@ namespace GWConquest
}
catch (Exception ex)
{
BoltLog.Error("Could not parse unit class");
BoltLog.Exception(ex);
Debug.LogErrorFormat("Could not parse unit class");
Debug.LogException(ex);
}
}
@ -196,7 +196,7 @@ namespace GWConquest
var heroName = data.GetString("Name");
BoltLog.Info("Parsing hero {0}", heroName);
Debug.LogFormat("Parsing hero {0}", heroName);
unitClass.ShortName = "Hero" + Util.RemoveSpecialCharacters(heroName);
unitClass.FullName = heroName;
@ -266,8 +266,8 @@ namespace GWConquest
}
catch(Exception ex)
{
BoltLog.Error("Could not parse hero");
BoltLog.Exception(ex);
Debug.LogErrorFormat("Could not parse hero");
Debug.LogException(ex);
}
}
}
@ -280,7 +280,7 @@ namespace GWConquest
}
if(Util.IsStringEmpty(name))
{
BoltLog.Warn("UnitClass.FromName called with null name!");
Debug.LogWarningFormat("UnitClass.FromName called with null name!");
return null;
}
if (classMap.ContainsKey(name))
@ -289,7 +289,7 @@ namespace GWConquest
}
else
{
BoltLog.Warn("Unit class {0} not in registry!", name);
Debug.LogWarningFormat("Unit class {0} not in registry!", name);
return null;
}
}


+ 1
- 1
Assets/GWConquest/Scripts/Zone.cs View File

@ -141,7 +141,7 @@ namespace GWConquest
}
CurrentBattle.Init();
BoltLog.Info("Starting battle at zone {0}", this);
Debug.LogFormat("Starting battle at zone {0}", this);
}
}


Loading…
Cancel
Save