commit 85bdf31a4d751a88eb52c4ff06c35efc97d1ae2b Author: zombieb Date: Mon Apr 6 21:08:06 2026 -0400 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45cc92d --- /dev/null +++ b/.gitignore @@ -0,0 +1,210 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# Build results +[Bb]in/ +[Oo]bj/ +[Ee]xt/ +[Ll]og/ +[Ll]ogs/ + +# MSBuild Binary and Structured Log +*.binlog + +# MSBuild response files +!MSBuild.rsp +!Directory.Build.rsp + +# Visual Studio 14+ cache/options directory +.vs/ + +# Visual Studio 15+ auto generated files +Generated\ Files/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*~.* +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# Microsoft Fakes +FakesAssemblies/ + +# CodeRush personal settings +.cr/personal + +# JetBrains Rider +*.sln.iml diff --git a/GameObject.cs b/GameObject.cs new file mode 100644 index 0000000..22664f4 --- /dev/null +++ b/GameObject.cs @@ -0,0 +1,19 @@ +using System; +using UnityEngine; + +namespace PhotonViewDumper +{ + internal class GameObject : MonoBehaviour + { + void Update() + { + try + { + if (Input.GetKeyDown(KeyCode.F6)) Plugin.Dump(); + } catch (Exception ex) + { + Plugin.Log.LogError($"Failed to dump views: {ex}"); + } + } + } +} diff --git a/PhotonViewDumper.csproj b/PhotonViewDumper.csproj new file mode 100644 index 0000000..86c036c --- /dev/null +++ b/PhotonViewDumper.csproj @@ -0,0 +1,44 @@ + + + + net6.0 + PhotonViewDumper + My first plugin + 1.0.0 + true + latest + + https://api.nuget.org/v3/index.json; + https://nuget.bepinex.dev/v3/index.json; + https://nuget.samboy.dev/v3/index.json + + PhotonViewDumper + true + + + + + + + + + + ./AssemblyReferences/Assembly-CSharp.dll + + + ./AssemblyReferences/Il2Cppmscorlib.dll + + + ./AssemblyReferences/PhotonRealtime.dll + + + ./AssemblyReferences/PhotonUnityNetworking.dll + + + ./AssemblyReferences/UnityEngine.CoreModule.dll + + + ./AssemblyReferences/UnityEngine.InputLegacyModule.dll + + + diff --git a/PhotonViewDumper.sln b/PhotonViewDumper.sln new file mode 100644 index 0000000..74a08a9 --- /dev/null +++ b/PhotonViewDumper.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.3.11520.95 d18.3 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotonViewDumper", "PhotonViewDumper.csproj", "{1C893A91-9E01-4217-F6A1-1ED17CEB7D62}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1C893A91-9E01-4217-F6A1-1ED17CEB7D62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C893A91-9E01-4217-F6A1-1ED17CEB7D62}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C893A91-9E01-4217-F6A1-1ED17CEB7D62}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C893A91-9E01-4217-F6A1-1ED17CEB7D62}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F128F9B7-243F-4045-A691-C9D38AFF4162} + EndGlobalSection +EndGlobal diff --git a/Plugin.cs b/Plugin.cs new file mode 100644 index 0000000..accd326 --- /dev/null +++ b/Plugin.cs @@ -0,0 +1,69 @@ +using BepInEx; +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; + +namespace PhotonViewDumper; + +public class ViewElement +{ + public int RecNetId { get; set; } + public int ActorId { get; set; } + public string NickName { get; set; } + public string RecNetUserName { get; set; } + public int ViewId { get; set; } + public string PrefabName { get; set; } +} + +[BepInPlugin("dev.proxnet.recroom.photonviewdumper", "PhotonViewDumper", "0.1.0")] +public class Plugin : BasePlugin +{ + public static new ManualLogSource Log; + + public override void Load() + { + Log = base.Log; + Log.LogInfo($"Loaded"); + + AddComponent(); + } + + public static void Dump() + { + List views = new(); + foreach (PhotonView view in PhotonNetwork.PhotonViews) + { + try + { + var recNetId = view.Owner == null ? -1 : view.Owner.RecNetAccountId; + + CCEOLAOLEKJ recNetAccount = null; + PEGGCEDHBOF.DKNKKLPCGLM.TryGetValue(recNetId, out recNetAccount); + + views.Add(new ViewElement + { + RecNetId = recNetId, + ActorId = view.Owner == null ? -1 : view.Owner.ActorNumber, + NickName = view.Owner == null ? "" : view.Owner.nickName, + RecNetUserName = recNetAccount == null ? "" : recNetAccount.BIOGKFGIMDG.ToString(), + ViewId = view.ViewID, + PrefabName = view.name + }); + } catch (Exception ex) + { + Log.LogWarning($"Failed to dump view {view.ViewID}: {ex}"); + } + } + + using var writer = new StreamWriter("views.csv"); + using var csv = new CsvWriter(writer, CultureInfo.InvariantCulture); + csv.WriteRecords(views); + Log.LogInfo($"Wrote {views.Count} to views.csv"); + } +} \ No newline at end of file