(ce6f2672e) Additional verbose logging
This commit is contained in:
@@ -894,6 +894,75 @@ namespace Barotrauma
|
|||||||
return configFile;
|
return configFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<string> characterConfigFiles;
|
||||||
|
private static IEnumerable<string> CharacterConfigFiles
|
||||||
|
{
|
||||||
|
#if SERVER
|
||||||
|
if (GameMain.Server != null && IsRemotePlayer)
|
||||||
|
{
|
||||||
|
if (characterConfigFiles == null)
|
||||||
|
{
|
||||||
|
case InputType.Left:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Left)) && (prevDequeuedInput.HasFlag(InputNetFlags.Left));
|
||||||
|
case InputType.Right:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Right)) && (prevDequeuedInput.HasFlag(InputNetFlags.Right));
|
||||||
|
case InputType.Up:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Up)) && (prevDequeuedInput.HasFlag(InputNetFlags.Up));
|
||||||
|
case InputType.Down:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Down)) && (prevDequeuedInput.HasFlag(InputNetFlags.Down));
|
||||||
|
case InputType.Run:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Run)) && (prevDequeuedInput.HasFlag(InputNetFlags.Run));
|
||||||
|
case InputType.Crouch:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Crouch)) && (prevDequeuedInput.HasFlag(InputNetFlags.Crouch));
|
||||||
|
case InputType.Select:
|
||||||
|
return dequeuedInput.HasFlag(InputNetFlags.Select); //TODO: clean up the way this input is registered
|
||||||
|
case InputType.Deselect:
|
||||||
|
return dequeuedInput.HasFlag(InputNetFlags.Deselect);
|
||||||
|
case InputType.Health:
|
||||||
|
return dequeuedInput.HasFlag(InputNetFlags.Health);
|
||||||
|
case InputType.Grab:
|
||||||
|
return dequeuedInput.HasFlag(InputNetFlags.Grab);
|
||||||
|
case InputType.Use:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Use)) && (prevDequeuedInput.HasFlag(InputNetFlags.Use));
|
||||||
|
case InputType.Shoot:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Shoot)) && (prevDequeuedInput.HasFlag(InputNetFlags.Shoot));
|
||||||
|
case InputType.Ragdoll:
|
||||||
|
return !(dequeuedInput.HasFlag(InputNetFlags.Ragdoll)) && (prevDequeuedInput.HasFlag(InputNetFlags.Ragdoll));
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return characterConfigFiles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Searches for a character config file from all currently selected content packages,
|
||||||
|
/// or from a specific package if the contentPackage parameter is given.
|
||||||
|
/// </summary>
|
||||||
|
public static string GetConfigFile(string speciesName, ContentPackage contentPackage = null)
|
||||||
|
{
|
||||||
|
string configFile = null;
|
||||||
|
if (contentPackage == null)
|
||||||
|
{
|
||||||
|
configFile = GameMain.Instance.GetFilesOfType(ContentType.Character)
|
||||||
|
.FirstOrDefault(c => Path.GetFileName(c).ToLowerInvariant() == $"{speciesName.ToLowerInvariant()}.xml");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
configFile = contentPackage.GetFilesOfType(ContentType.Character)?
|
||||||
|
.FirstOrDefault(c => Path.GetFileName(c).ToLowerInvariant() == $"{speciesName.ToLowerInvariant()}.xml");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (configFile == null)
|
||||||
|
{
|
||||||
|
DebugConsole.ThrowError($"Couldn't find a config file for {speciesName} from the selected content packages!");
|
||||||
|
DebugConsole.ThrowError($"(The config file must end with \"{speciesName}.xml\")");
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
return configFile;
|
||||||
|
}
|
||||||
|
|
||||||
private static IEnumerable<string> characterConfigFiles;
|
private static IEnumerable<string> characterConfigFiles;
|
||||||
private static IEnumerable<string> CharacterConfigFiles
|
private static IEnumerable<string> CharacterConfigFiles
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -627,6 +627,8 @@ namespace Barotrauma
|
|||||||
ic.OnItemLoaded();
|
ic.OnItemLoaded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DebugConsole.Log("Created " + Name + " (" + ID + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
partial void InitProjSpecific();
|
partial void InitProjSpecific();
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
GapList.Add(this);
|
GapList.Add(this);
|
||||||
InsertToList();
|
InsertToList();
|
||||||
|
|
||||||
|
DebugConsole.Log("Created gap (" + ID + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override MapEntity Clone()
|
public override MapEntity Clone()
|
||||||
|
|||||||
@@ -242,6 +242,8 @@ namespace Barotrauma
|
|||||||
WaterVolume = 0.0f;
|
WaterVolume = 0.0f;
|
||||||
|
|
||||||
InsertToList();
|
InsertToList();
|
||||||
|
|
||||||
|
DebugConsole.Log("Created hull (" + ID + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Rectangle GetBorders()
|
public static Rectangle GetBorders()
|
||||||
|
|||||||
@@ -1274,6 +1274,8 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DebugConsole.Log("Generating level resources...");
|
||||||
|
|
||||||
for (int i = 0; i < generationParams.ItemCount; i++)
|
for (int i = 0; i < generationParams.ItemCount; i++)
|
||||||
{
|
{
|
||||||
var selectedPrefab = ToolBox.SelectWeightedRandom(
|
var selectedPrefab = ToolBox.SelectWeightedRandom(
|
||||||
@@ -1286,6 +1288,7 @@ namespace Barotrauma
|
|||||||
var selectedEdge = selectedCell.Edges.GetRandom(e => e.IsSolid && !e.OutsideLevel, Rand.RandSync.Server);
|
var selectedEdge = selectedCell.Edges.GetRandom(e => e.IsSolid && !e.OutsideLevel, Rand.RandSync.Server);
|
||||||
if (selectedEdge == null) continue;
|
if (selectedEdge == null) continue;
|
||||||
|
|
||||||
|
|
||||||
float edgePos = Rand.Range(0.0f, 1.0f, Rand.RandSync.Server);
|
float edgePos = Rand.Range(0.0f, 1.0f, Rand.RandSync.Server);
|
||||||
Vector2 selectedPos = Vector2.Lerp(selectedEdge.Point1, selectedEdge.Point2, edgePos);
|
Vector2 selectedPos = Vector2.Lerp(selectedEdge.Point1, selectedEdge.Point2, edgePos);
|
||||||
Vector2 edgeNormal = selectedEdge.GetNormal(selectedCell);
|
Vector2 edgeNormal = selectedEdge.GetNormal(selectedCell);
|
||||||
@@ -1306,6 +1309,8 @@ namespace Barotrauma
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DebugConsole.Log("Level resources generated");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector2 GetRandomItemPos(PositionType spawnPosType, float randomSpread, float minDistFromSubs, float offsetFromWall = 10.0f)
|
public Vector2 GetRandomItemPos(PositionType spawnPosType, float randomSpread, float minDistFromSubs, float offsetFromWall = 10.0f)
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ namespace Barotrauma
|
|||||||
linkedToID = new List<ushort>();
|
linkedToID = new List<ushort>();
|
||||||
|
|
||||||
InsertToList();
|
InsertToList();
|
||||||
|
|
||||||
|
DebugConsole.Log("Created linked submarine (" + ID + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LinkedSubmarine CreateDummy(Submarine mainSub, Submarine linkedSub)
|
public static LinkedSubmarine CreateDummy(Submarine mainSub, Submarine linkedSub)
|
||||||
|
|||||||
@@ -355,6 +355,15 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
InsertToList();
|
InsertToList();
|
||||||
|
|
||||||
|
DebugConsole.Log("Created " + Name + " (" + ID + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
partial void InitProjSpecific();
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
partial void InitProjSpecific();
|
partial void InitProjSpecific();
|
||||||
|
|||||||
@@ -125,6 +125,8 @@ namespace Barotrauma
|
|||||||
InsertToList();
|
InsertToList();
|
||||||
WayPointList.Add(this);
|
WayPointList.Add(this);
|
||||||
|
|
||||||
|
DebugConsole.Log("Created waypoint (" + ID + ")");
|
||||||
|
|
||||||
currentHull = Hull.FindHull(WorldPosition);
|
currentHull = Hull.FindHull(WorldPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user