private static void GetNewInstancePrefix(ref string tags) { MelonLogger.Msg("Mono Stacktrace:\n" + new StackTrace().ToString()); MelonLogger.Msg("Il2Cpp Stacktrace:\n" + new Il2CppSystem.Diagnostics.StackTrace().ToString()); ServerDef targetServer; if (new StackTrace().GetFrame(2).GetMethod().DeclaringType == typeof(PopupRoomInstance)) { targetServer = serverList[serverDropdown.value]; } else { targetServer = ss.AppSettings.UseNameServer ? ServerDef.CloudServer("", ss.AppSettings.FixedRegion, ss.AppSettings.AppIdRealtime, ss.AppSettings.AppVersion) : ServerDef.DedicatedServer("", ss.AppSettings.Server, ss.AppSettings.Port); } if (targetServer != defaultServer) { if (targetServer.cloud) { tags += "~cloud(" + targetServer.region + "," + targetServer.appId + "," + targetServer.appVersion + ")"; } else { tags += "~server(" + targetServer.address + "," + targetServer.port + ")"; } } MelonLogger.Msg("generated instance id: " + tags); }
private static void GetNewInstancePrefix(ref string tags) { ServerDef targetServer; if (new StackTrace().GetFrame(2).GetMethod().DeclaringType == typeof(PopupRoomInstance)) { targetServer = serverList[serverDropdown.value]; } else { targetServer = ss.AppSettings.UseNameServer ? ServerDef.CloudServer("", ss.AppSettings.FixedRegion, ss.AppSettings.AppIdRealtime, ss.AppSettings.AppVersion) : ServerDef.DedicatedServer("", ss.AppSettings.Server, ss.AppSettings.Port); } if (targetServer != defaultServer) { if (targetServer.cloud) { tags += "~cloud(" + targetServer.region + "," + targetServer.appId + "," + targetServer.appVersion + ")"; } else { tags += "~server(" + targetServer.address + "," + targetServer.port + ")"; } } }
private IEnumerator InitAfterFrame() { yield return(null); //ss = PhotonNetwork.field_Public_Static_ServerSettings_0; ss = PhotonNetwork.PhotonServerSettings; MelonLogger.Msg("ss: " + ss?.ToString() ?? "null"); MelonLogger.Msg("AppSettings: " + ss?.AppSettings?.ToString() ?? "null"); defaultServer = ServerDef.CloudServer("VRChat Cloud Server USW", ss.AppSettings.FixedRegion, ss.AppSettings.AppIdRealtime, ss.AppSettings.AppVersion); foreach (string text in Environment.GetCommandLineArgs()) { if (text.StartsWith("--photonUseNS=")) { string value = text.Substring("--photonUseNS=".Length); if (value == "false" || value == "0") { Log("setting UserNameServer to false. Old value was " + ss.AppSettings.UseNameServer); ss.AppSettings.UseNameServer = false; } else if (value == "true" || value == "1") { Log("setting UserNameServer to true. Old value was " + ss.AppSettings.UseNameServer); ss.AppSettings.UseNameServer = true; } else { Log("--photonUseNS was passed with an invalid value"); } } else if (text.StartsWith("--photonFixedRegion=")) { Log("setting FixedRegion to " + text.Substring("--photonFixedRegion=".Length) + ". Old value was " + ss.AppSettings.FixedRegion); ss.AppSettings.FixedRegion = text.Substring("--photonFixedRegion=".Length); } else if (text.StartsWith("--photonServer=")) { Log("setting Server to " + text.Substring("--photonServer=".Length) + ". Old value was " + ss.AppSettings.Server); ss.AppSettings.Server = text.Substring("--photonServer=".Length); } else if (text.StartsWith("--photonPort=")) { if (int.TryParse(text.Substring("--photonPort=".Length), out int valueInt)) { Log("setting Port to " + valueInt + ". Old value was " + ss.AppSettings.Port); ss.AppSettings.Port = valueInt; Log("Port set to " + ss.AppSettings.Port); } else { Log("--photonPort was passed with an invalid value"); } } else if (text.StartsWith("--photonId")) { //Log("setting Id to " + text.Substring("--photonId=".Length) + ". Old value was " + VRCApplicationSetup.field_Private_Static_VRCApplicationSetup_0.gameServerVersionOverride); //VRCApplicationSetup.field_Private_Static_VRCApplicationSetup_0.gameServerVersionOverride = text.Substring("--photonId=".Length); //Log("Id set to " + VRCApplicationSetup.field_Private_Static_VRCApplicationSetup_0.gameServerVersionOverride); Log("setting Id to " + text.Substring("--photonId=".Length) + ". Old value was " + VRCApplicationSetup.Instance.gameServerVersionOverride); VRCApplicationSetup.Instance.gameServerVersionOverride = text.Substring("--photonId=".Length); Log("Id set to " + VRCApplicationSetup.Instance.gameServerVersionOverride); } } MelonLogger.Msg("Waiting for InitUI"); yield return(null);// InitUI(); MelonLogger.Msg("Done InitUI"); }