mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-28 12:40:28 +00:00
Revert "use GetType() instead of GetType().Name in strings, since they return the same thing"
This reverts commit c3e77d24
This commit is contained in:
parent
46f93ee5b9
commit
ad2c84acb2
@ -22,7 +22,7 @@ internal class QSBItem<T> : WorldObject<T>, IQSBItem
|
|||||||
{
|
{
|
||||||
if (AttachedObject == null)
|
if (AttachedObject == null)
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Error - AttachedObject is null! Type:{GetType()}", OWML.Common.MessageType.Error);
|
DebugLog.ToConsole($"Error - AttachedObject is null! Type:{GetType().Name}", OWML.Common.MessageType.Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,14 +55,14 @@ public static class QSBPatchManager
|
|||||||
//DebugLog.DebugWrite($"Patch block {Enum.GetName(typeof(QSBPatchTypes), type)}", MessageType.Info);
|
//DebugLog.DebugWrite($"Patch block {Enum.GetName(typeof(QSBPatchTypes), type)}", MessageType.Info);
|
||||||
foreach (var patch in _patchList.Where(x => x.Type == type))
|
foreach (var patch in _patchList.Where(x => x.Type == type))
|
||||||
{
|
{
|
||||||
//DebugLog.DebugWrite($" - Patching in {patch}", MessageType.Info);
|
//DebugLog.DebugWrite($" - Patching in {patch.GetType().Name}", MessageType.Info);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
patch.DoPatches(TypeToInstance[type]);
|
patch.DoPatches(TypeToInstance[type]);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Error while patching {patch} :\r\n{ex}", MessageType.Error);
|
DebugLog.ToConsole($"Error while patching {patch.GetType().Name} :\r\n{ex}", MessageType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,5 +300,5 @@ public class PlayerInfo
|
|||||||
_ditheringAnimator.SetVisible(visible, seconds);
|
_ditheringAnimator.SetVisible(visible, seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() => $"{PlayerId}:{GetType()} ({Name})";
|
public override string ToString() => $"{PlayerId}:{GetType().Name} ({Name})";
|
||||||
}
|
}
|
@ -109,7 +109,7 @@ public abstract class SyncBase : QSBNetworkTransform
|
|||||||
public string Name => AttachedTransform ? AttachedTransform.name : "<NullObject!>";
|
public string Name => AttachedTransform ? AttachedTransform.name : "<NullObject!>";
|
||||||
|
|
||||||
public override string ToString() => (IsPlayerObject ? $"{Player.PlayerId}." : string.Empty)
|
public override string ToString() => (IsPlayerObject ? $"{Player.PlayerId}." : string.Empty)
|
||||||
+ $"{netId}:{GetType()} ({Name})";
|
+ $"{netId}:{GetType().Name} ({Name})";
|
||||||
|
|
||||||
protected virtual float DistanceChangeThreshold => 5f;
|
protected virtual float DistanceChangeThreshold => 5f;
|
||||||
private float _prevDistance;
|
private float _prevDistance;
|
||||||
|
@ -203,13 +203,13 @@ public static class QSBWorldSync
|
|||||||
{
|
{
|
||||||
if (!WorldObjects.IsInRange(objectId))
|
if (!WorldObjects.IsInRange(objectId))
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Warning - Tried to find {typeof(TWorldObject)} id {objectId}. Count is {WorldObjects.Count}.", MessageType.Warning);
|
DebugLog.ToConsole($"Warning - Tried to find {typeof(TWorldObject).Name} id {objectId}. Count is {WorldObjects.Count}.", MessageType.Warning);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WorldObjects[objectId] is not TWorldObject worldObject)
|
if (WorldObjects[objectId] is not TWorldObject worldObject)
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Error - {typeof(TWorldObject)} id {objectId} is actually {WorldObjects[objectId].GetType()}.", MessageType.Error);
|
DebugLog.ToConsole($"Error - {typeof(TWorldObject).Name} id {objectId} is actually {WorldObjects[objectId].GetType().Name}.", MessageType.Error);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,13 +221,13 @@ public static class QSBWorldSync
|
|||||||
{
|
{
|
||||||
if (!unityObject)
|
if (!unityObject)
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Error - Trying to run GetWorldFromUnity with a null unity object! TWorldObject:{typeof(TWorldObject)}, TUnityObject:NULL, Stacktrace:\r\n{Environment.StackTrace}", MessageType.Error);
|
DebugLog.ToConsole($"Error - Trying to run GetWorldFromUnity with a null unity object! TWorldObject:{typeof(TWorldObject).Name}, TUnityObject:NULL, Stacktrace:\r\n{Environment.StackTrace}", MessageType.Error);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!UnityObjectsToWorldObjects.TryGetValue(unityObject, out var worldObject))
|
if (!UnityObjectsToWorldObjects.TryGetValue(unityObject, out var worldObject))
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Error - WorldObjectsToUnityObjects does not contain \"{unityObject.name}\"! TWorldObject:{typeof(TWorldObject)}, TUnityObject:{unityObject.GetType()}, Stacktrace:\r\n{Environment.StackTrace}", MessageType.Error);
|
DebugLog.ToConsole($"Error - WorldObjectsToUnityObjects does not contain \"{unityObject.name}\"! TWorldObject:{typeof(TWorldObject).Name}, TUnityObject:{unityObject.GetType().Name}, Stacktrace:\r\n{Environment.StackTrace}", MessageType.Error);
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ public abstract class WorldObject<T> : IWorldObject
|
|||||||
MonoBehaviour IWorldObject.AttachedObject => AttachedObject;
|
MonoBehaviour IWorldObject.AttachedObject => AttachedObject;
|
||||||
public T AttachedObject { get; init; }
|
public T AttachedObject { get; init; }
|
||||||
public string Name => AttachedObject ? AttachedObject.name : "<NullObject!>";
|
public string Name => AttachedObject ? AttachedObject.name : "<NullObject!>";
|
||||||
public override string ToString() => $"{ObjectId}:{GetType()} ({Name})";
|
public override string ToString() => $"{ObjectId}:{GetType().Name} ({Name})";
|
||||||
|
|
||||||
public virtual async UniTask Init(CancellationToken ct) { }
|
public virtual async UniTask Init(CancellationToken ct) { }
|
||||||
public virtual void OnRemoval() { }
|
public virtual void OnRemoval() { }
|
||||||
|
@ -20,5 +20,5 @@ public abstract class WorldObjectManager : MonoBehaviour, IAddComponentOnStart
|
|||||||
|
|
||||||
public virtual void UnbuildWorldObjects() { }
|
public virtual void UnbuildWorldObjects() { }
|
||||||
|
|
||||||
public override string ToString() => GetType().ToString();
|
public override string ToString() => GetType().Name;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user