This commit is contained in:
2026-02-16 15:53:20 -05:00
parent 3b8f32c19b
commit acbefc568c
4 changed files with 51 additions and 16 deletions

View File

@@ -0,0 +1,28 @@
using ExitGames.Client.Photon;
using ExitGames.Client.Photon.StructWrapping;
using System.Collections.Generic;
using UnityEngine;
namespace PhotonLogger.Core;
public class OperationNormalizer
{
public static Dictionary<byte, object> NormalizeDictionaryValues(Dictionary<byte, object> inDict)
{
var dictionary = new Dictionary<byte, object>(inDict);
foreach (KeyValuePair<byte, object> entry in inDict)
{
var key = entry.Key;
var value = entry.Value;
if (value.GetType() == typeof(Vector2)) dictionary[key] = "StubVector2";
else if (value.GetType() == typeof(Vector3)) dictionary[key] = "StubVector3";
else if (value is Dictionary<byte, object>) dictionary[key] = NormalizeDictionaryValues((Dictionary<byte, object>)value);
else if (value is ParameterDictionary) dictionary[key] = NormalizeDictionaryValues(new Dictionary<byte, object>((ParameterDictionary)value));
else if (value is StructWrapper<byte>) dictionary[key] = "a byte that must be unwrapped";
else if (value is StructWrapper<bool>) dictionary[key] = "a bool that must be unwrapped";
}
return dictionary;
}
}