update
This commit is contained in:
@@ -4,8 +4,7 @@ using Newtonsoft.Json;
|
||||
using Photon.Realtime;
|
||||
using PhotonLogger.Core;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
[HarmonyPatch]
|
||||
@@ -15,21 +14,24 @@ public class OnEventPatch
|
||||
public class SerializableEventData
|
||||
{
|
||||
public byte Code { get; set; }
|
||||
public NonAllocDictionary<byte, object> Parameters { get; set; }
|
||||
public Dictionary<byte, object> Parameters { get; set; }
|
||||
}
|
||||
|
||||
static MethodInfo TargetMethod() => typeof(LoadBalancingClient).GetRuntimeMethod("OnEvent", [ typeof(EventData) ]);
|
||||
|
||||
static void Postfix(ref EventData photonEvent)
|
||||
static void Postfix(ref EventData photonEvent, ref LoadBalancingClient __instance)
|
||||
{
|
||||
var newMsg = new Message
|
||||
{
|
||||
Time = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
|
||||
Type = MessageType.Event,
|
||||
Server = __instance.CurrentServerAddress,
|
||||
Data = new SerializableEventData
|
||||
{
|
||||
Code = photonEvent.Code,
|
||||
Parameters = photonEvent.Parameters.paramDict
|
||||
Parameters = OperationNormalizer.NormalizeDictionaryValues(
|
||||
new Dictionary<byte, object>(photonEvent.Parameters.paramDict)
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user