add advanced settings

This commit is contained in:
Lapis
2026-06-04 18:58:56 -04:00
parent 6855abe9f6
commit 837543f5e2
3 changed files with 36 additions and 11 deletions
+28 -9
View File
@@ -55,15 +55,34 @@ public class Photon_AppSettings_Patch
private static void Postfix(ref AppSettings __result)
{
Plugin.Log.LogInfo("okay im patching now");
__result = new()
if (Plugin.EnableAdvancedSettings.Value)
{
AppVersion = __result?.AppVersion,
AppIdRealtime = Plugin.AppIdRT.Value,
AppIdVoice = Plugin.AppIdVoice.Value,
AppIdChat = Plugin.AppIdChat.Value,
FixedRegion = "us",
UseNameServer = true,
Protocol = ConnectionProtocol.Udp,
};
__result = new()
{
AppVersion = __result?.AppVersion,
AppIdRealtime = Plugin.AppIdRT.Value,
AppIdVoice = Plugin.AppIdVoice.Value,
AppIdChat = Plugin.AppIdChat.Value,
FixedRegion = "us",
UseNameServer = true,
Protocol = ConnectionProtocol.Udp,
Server = Plugin.PhotonHostname.Value,
Port = Plugin.PhotonPort.Value == 0 ? 4533 : Plugin.PhotonPort.Value
};
}
else
{
__result = new()
{
AppVersion = __result?.AppVersion,
AppIdRealtime = Plugin.AppIdRT.Value,
AppIdVoice = Plugin.AppIdVoice.Value,
AppIdChat = Plugin.AppIdChat.Value,
FixedRegion = "us",
UseNameServer = true,
Protocol = ConnectionProtocol.Udp
};
}
}
}