Fix for view creators
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -208,3 +208,5 @@ FakesAssemblies/
|
|||||||
|
|
||||||
# JetBrains Rider
|
# JetBrains Rider
|
||||||
*.sln.iml
|
*.sln.iml
|
||||||
|
|
||||||
|
/AssemblyReferences/
|
||||||
17
Plugin.cs
17
Plugin.cs
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user