mirror of
https://github.com/djdevin/recnet-plugin.git
synced 2026-09-08 14:41:30 -07:00
add advanced settings
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<GamePath>C:\Program Files (x86)\Steam\steamapps\content\app_471710\depot_471711</GamePath>
|
<GamePath>C:\Program Files (x86)\Steam\steamapps\content\app_471710\cannednet2023</GamePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -55,15 +55,34 @@ public class Photon_AppSettings_Patch
|
|||||||
private static void Postfix(ref AppSettings __result)
|
private static void Postfix(ref AppSettings __result)
|
||||||
{
|
{
|
||||||
Plugin.Log.LogInfo("okay im patching now");
|
Plugin.Log.LogInfo("okay im patching now");
|
||||||
__result = new()
|
|
||||||
|
if (Plugin.EnableAdvancedSettings.Value)
|
||||||
{
|
{
|
||||||
AppVersion = __result?.AppVersion,
|
__result = new()
|
||||||
AppIdRealtime = Plugin.AppIdRT.Value,
|
{
|
||||||
AppIdVoice = Plugin.AppIdVoice.Value,
|
AppVersion = __result?.AppVersion,
|
||||||
AppIdChat = Plugin.AppIdChat.Value,
|
AppIdRealtime = Plugin.AppIdRT.Value,
|
||||||
FixedRegion = "us",
|
AppIdVoice = Plugin.AppIdVoice.Value,
|
||||||
UseNameServer = true,
|
AppIdChat = Plugin.AppIdChat.Value,
|
||||||
Protocol = ConnectionProtocol.Udp,
|
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
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ public class Plugin : BasePlugin
|
|||||||
public static ConfigEntry<string> AppIdVoice { get; private set; }
|
public static ConfigEntry<string> AppIdVoice { get; private set; }
|
||||||
public static ConfigEntry<string> AppIdChat { get; private set; }
|
public static ConfigEntry<string> AppIdChat { get; private set; }
|
||||||
public static ConfigEntry<string> ServerHostname { get; private set; }
|
public static ConfigEntry<string> ServerHostname { get; private set; }
|
||||||
|
public static ConfigEntry<bool> EnableAdvancedSettings { get; private set; }
|
||||||
|
public static ConfigEntry<string> PhotonHostname { get; private set; }
|
||||||
|
public static ConfigEntry<int> PhotonPort { get; private set; }
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
{
|
{
|
||||||
@@ -31,7 +34,10 @@ public class Plugin : BasePlugin
|
|||||||
AppIdRT = Config.Bind("Photon", "App Id Realtime", "", "Photon Realtime App ID");
|
AppIdRT = Config.Bind("Photon", "App Id Realtime", "", "Photon Realtime App ID");
|
||||||
AppIdVoice = Config.Bind("Photon", "App Id Voice", "", "Photon Voice App ID");
|
AppIdVoice = Config.Bind("Photon", "App Id Voice", "", "Photon Voice App ID");
|
||||||
AppIdChat = Config.Bind("Photon", "App Id Chat", "", "Photon Chat App ID");
|
AppIdChat = Config.Bind("Photon", "App Id Chat", "", "Photon Chat App ID");
|
||||||
ServerHostname = Config.Bind("Server", "NameServer Host", "https://ns.lapis.codes", "Host for the NameServer.");
|
EnableAdvancedSettings = Config.Bind("Advanced", "Enabled Advanced Settings", false, "Allows other fields below in the advanced section to be modified.");
|
||||||
|
PhotonHostname = Config.Bind("Advanced", "Photon NameServer", "", "Custom Photon NameServer");
|
||||||
|
PhotonPort = Config.Bind("Advanced", "Photon NameServer Port", 0, "Custom Photon NameServer Port (if 0, it will be default)");
|
||||||
|
ServerHostname = Config.Bind("Server", "RecNet NameServer Host", "https://ns.lapis.codes", "Host for the RecNet NameServer.");
|
||||||
|
|
||||||
Harmony.CreateAndPatchAll(typeof(Plugin).Assembly);
|
Harmony.CreateAndPatchAll(typeof(Plugin).Assembly);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user