change some DebugWrite to ToConsole

This commit is contained in:
Mister_Nebula 2021-06-23 21:46:52 +01:00
parent b51d2d45db
commit 3781da3a08
8 changed files with 17 additions and 17 deletions

View File

@ -53,7 +53,7 @@ namespace QSB.Animation.NPC.Patches
{
if (playerId == uint.MaxValue)
{
DebugLog.DebugWrite($"Error - {__instance.name} is in conversation with a null player! Defaulting to active camera.", MessageType.Error);
DebugLog.ToConsole($"Error - {__instance.name} is in conversation with a null player! Defaulting to active camera.", MessageType.Error);
playerToUse = QSBPlayerManager.LocalPlayer;
}
else

View File

@ -157,7 +157,7 @@ namespace QSB.Player
{
if (playerList.Count == 0)
{
DebugLog.DebugWrite($"Error - Cannot get closest player from empty player list.", MessageType.Error);
DebugLog.ToConsole($"Error - Cannot get closest player from empty player list.", MessageType.Error);
return null;
}

View File

@ -72,7 +72,7 @@ namespace QSB.RoastingSync.Events
var rigidbody = tossedMallow.GetComponent<OWRigidbody>();
if (player.Campfire == null)
{
DebugLog.DebugWrite($"Error - Campfire for {playerId} is null.", OWML.Common.MessageType.Error);
DebugLog.ToConsole($"Error - Campfire for {playerId} is null.", OWML.Common.MessageType.Error);
return;
}
@ -80,7 +80,7 @@ namespace QSB.RoastingSync.Events
rigidbody.SetAngularVelocity(stickTip.right * 10f);
if (player.Marshmallow == null)
{
DebugLog.DebugWrite($"Error - Marshmallow for {playerId} is null.", OWML.Common.MessageType.Error);
DebugLog.ToConsole($"Error - Marshmallow for {playerId} is null.", OWML.Common.MessageType.Error);
return;
}

View File

@ -51,7 +51,7 @@ namespace QSB.Syncs
{
if (_referenceTransform == null)
{
DebugLog.DebugWrite($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
DebugLog.ToConsole($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
return;
}
@ -66,7 +66,7 @@ namespace QSB.Syncs
{
if (_referenceTransform == null)
{
DebugLog.DebugWrite($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
DebugLog.ToConsole($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
return;
}
@ -92,7 +92,7 @@ namespace QSB.Syncs
{
if (_referenceTransform == null)
{
DebugLog.DebugWrite($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
DebugLog.ToConsole($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
return Vector3.zero;
}
@ -106,7 +106,7 @@ namespace QSB.Syncs
{
if (_referenceTransform == null)
{
DebugLog.DebugWrite($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
DebugLog.ToConsole($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
return Quaternion.identity;
}

View File

@ -235,7 +235,7 @@ namespace QSB.Syncs.RigidbodySync
var distance = Vector3.Distance(currentPosition, targetPosition);
if (distance > _previousDistance + DistanceLeeway)
{
DebugLog.DebugWrite($"Warning - {AttachedObject.name} moved too far!", MessageType.Warning);
DebugLog.ToConsole($"Warning - {AttachedObject.name} moved too far!", MessageType.Warning);
_previousDistance = distance;
return targetPosition;
}

View File

@ -219,7 +219,7 @@ namespace QSB.Syncs.TransformSync
var distance = Vector3.Distance(currentPosition, targetPosition);
if (distance > _previousDistance + DistanceLeeway)
{
DebugLog.DebugWrite($"Warning - {AttachedObject.name} moved too far!", MessageType.Warning);
DebugLog.ToConsole($"Warning - {AttachedObject.name} moved too far!", MessageType.Warning);
_previousDistance = distance;
return targetPosition;
}

View File

@ -125,7 +125,7 @@ namespace QSB.TimeSync
if (PlayerData.LoadLoopCount() != _serverLoopCount)
{
DebugLog.DebugWrite($"Warning - ServerLoopCount is not the same as local loop count! local:{PlayerData.LoadLoopCount()} server:{_serverLoopCount}");
DebugLog.ToConsole($"Warning - ServerLoopCount is not the same as local loop count! local:{PlayerData.LoadLoopCount()} server:{_serverLoopCount}");
StartWaitingForServerToDie();
return;
}

View File

@ -43,28 +43,28 @@ namespace QSB.Utility
{
if (connection == null)
{
DebugLog.DebugWrite($"Error - Trying to get player id of null QNetworkConnection.", MessageType.Error);
DebugLog.ToConsole($"Error - Trying to get player id of null QNetworkConnection.", MessageType.Error);
return uint.MaxValue;
}
var playerController = connection.PlayerControllers[0];
if (playerController == null)
{
DebugLog.DebugWrite($"Error - Player Controller of {connection.address} is null.", MessageType.Error);
DebugLog.ToConsole($"Error - Player Controller of {connection.address} is null.", MessageType.Error);
return uint.MaxValue;
}
var go = playerController.Gameobject;
if (go == null)
{
DebugLog.DebugWrite($"Error - GameObject of {playerController.UnetView.NetId.Value} is null.", MessageType.Error);
DebugLog.ToConsole($"Error - GameObject of {playerController.UnetView.NetId.Value} is null.", MessageType.Error);
return uint.MaxValue;
}
var controller = go.GetComponent<PlayerTransformSync>();
if (controller == null)
{
DebugLog.DebugWrite($"Error - No PlayerTransformSync found on {go.name}", MessageType.Error);
DebugLog.ToConsole($"Error - No PlayerTransformSync found on {go.name}", MessageType.Error);
return uint.MaxValue;
}
@ -96,14 +96,14 @@ namespace QSB.Utility
var method = typeof(BaseType).GetAnyMethod(methodName);
if (method == null)
{
DebugLog.DebugWrite($"Error - Couldn't find method {methodName} in {typeof(BaseType).FullName}!", MessageType.Error);
DebugLog.ToConsole($"Error - Couldn't find method {methodName} in {typeof(BaseType).FullName}!", MessageType.Error);
return;
}
var functionPointer = method.MethodHandle.GetFunctionPointer();
if (functionPointer == null)
{
DebugLog.DebugWrite($"Error - Function pointer for {methodName} in {typeof(BaseType).FullName} is null!", MessageType.Error);
DebugLog.ToConsole($"Error - Function pointer for {methodName} in {typeof(BaseType).FullName} is null!", MessageType.Error);
return;
}