Fix for view creators

This commit is contained in:
2026-04-07 00:18:59 -04:00
parent 85bdf31a4d
commit 685c5f48d6
2 changed files with 13 additions and 6 deletions

2
.gitignore vendored
View File

@@ -208,3 +208,5 @@ FakesAssemblies/
# JetBrains Rider # JetBrains Rider
*.sln.iml *.sln.iml
/AssemblyReferences/

View File

@@ -2,12 +2,12 @@
using BepInEx.Logging; using BepInEx.Logging;
using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP;
using CsvHelper; using CsvHelper;
using Il2CppInterop.Runtime;
using Photon.Pun; using Photon.Pun;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
namespace PhotonViewDumper; namespace PhotonViewDumper;
@@ -41,16 +41,21 @@ public class Plugin : BasePlugin
{ {
try 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; CCEOLAOLEKJ recNetAccount = null;
PEGGCEDHBOF.DKNKKLPCGLM.TryGetValue(recNetId, out recNetAccount); PEGGCEDHBOF.DKNKKLPCGLM.TryGetValue(creator.RecNetAccountId, out recNetAccount);
views.Add(new ViewElement views.Add(new ViewElement
{ {
RecNetId = recNetId, RecNetId = creator.RecNetAccountId,
ActorId = view.Owner == null ? -1 : view.Owner.ActorNumber, ActorId = creator.ActorNumber,
NickName = view.Owner == null ? "" : view.Owner.nickName, NickName = creator.nickName,
RecNetUserName = recNetAccount == null ? "" : recNetAccount.BIOGKFGIMDG.ToString(), RecNetUserName = recNetAccount == null ? "" : recNetAccount.BIOGKFGIMDG.ToString(),
ViewId = view.ViewID, ViewId = view.ViewID,
PrefabName = view.name PrefabName = view.name