From 685c5f48d649a932500e525c2edf9e7aca2ea996 Mon Sep 17 00:00:00 2001 From: zombieb Date: Tue, 7 Apr 2026 00:18:59 -0400 Subject: [PATCH] Fix for view creators --- .gitignore | 2 ++ Plugin.cs | 17 +++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 45cc92d..a9a3a33 100644 --- a/.gitignore +++ b/.gitignore @@ -208,3 +208,5 @@ FakesAssemblies/ # JetBrains Rider *.sln.iml + +/AssemblyReferences/ \ No newline at end of file diff --git a/Plugin.cs b/Plugin.cs index accd326..bcaef89 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -2,12 +2,12 @@ using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using CsvHelper; -using Il2CppInterop.Runtime; using Photon.Pun; using System; using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Linq; namespace PhotonViewDumper; @@ -41,16 +41,21 @@ public class Plugin : BasePlugin { try { - var recNetId = view.Owner == null ? -1 : view.Owner.RecNetAccountId; + var creator = PhotonNetwork.PlayerList.FirstOrDefault(player => player.ActorNumber == view.CreatorActorNr); + if (creator == null) + { + Log.LogWarning($"Could not get creator for view ID {view.ViewID}"); + continue; + } CCEOLAOLEKJ recNetAccount = null; - PEGGCEDHBOF.DKNKKLPCGLM.TryGetValue(recNetId, out recNetAccount); + PEGGCEDHBOF.DKNKKLPCGLM.TryGetValue(creator.RecNetAccountId, out recNetAccount); views.Add(new ViewElement { - RecNetId = recNetId, - ActorId = view.Owner == null ? -1 : view.Owner.ActorNumber, - NickName = view.Owner == null ? "" : view.Owner.nickName, + RecNetId = creator.RecNetAccountId, + ActorId = creator.ActorNumber, + NickName = creator.nickName, RecNetUserName = recNetAccount == null ? "" : recNetAccount.BIOGKFGIMDG.ToString(), ViewId = view.ViewID, PrefabName = view.name