update
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user