Tyler-IN / Phasmatic

0 stars 0 forks source link

NetworkingPeer in Latest PhotonNetwork #8

Open jacoblusk opened 4 years ago

jacoblusk commented 4 years ago

Did you still find NetworkingPeer apart of PhotonNetwork? I noticed it was moved to a static method on PhotonNetwork itself.

MethodInfo photonNetwork_executeRpc = typeof(PhotonNetwork).GetMethod("ExecuteRpc",
    BindingFlags.Public | BindingFlags.Static);
harmonyInstance.Patch(photonNetwork_executeRpc,
    prefix: new HarmonyMethod(typeof(RPCValidator), nameof(ExecuteRpc)));

with a signature of:

public static bool ExecuteRpc(ExitGames.Client.Photon.Hashtable __0, Photon.Realtime.Player __1)

And the signature from the unhollower:

// Token: 0x06000114 RID: 276 RVA: 0x00006F0C File Offset: 0x0000510C
[CallerCount(2)]
public unsafe static void ExecuteRpc(Hashtable rpcData, Player sender)

I am using MelonLoader though, so not entirely sure if the loader you're using has some major differences, but I think both use the same Unhollower?