From 833d89eab9daba6551bb379e38fff6abc08d84f8 Mon Sep 17 00:00:00 2001 From: drowhunter Date: Wed, 14 Aug 2024 02:13:12 -0400 Subject: [PATCH] add port override for incoming data to GT7 Plugin --- Plugins/GT7Plugin/GT7Plugin.cs | 22 ++++++++++++++++++-- Plugins/GT7Plugin/Properties/AssemblyInfo.cs | 4 ++-- Plugins/GT7Plugin/Resources/description.html | 4 ++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Plugins/GT7Plugin/GT7Plugin.cs b/Plugins/GT7Plugin/GT7Plugin.cs index 8d53a27..d5369f7 100644 --- a/Plugins/GT7Plugin/GT7Plugin.cs +++ b/Plugins/GT7Plugin/GT7Plugin.cs @@ -24,7 +24,7 @@ namespace YawVR_Game_Engine.Plugin { [Export(typeof(Game))] - [ExportMetadata("Name", "Gran Turismo 7 (0.9.4)")] + [ExportMetadata("Name", "Gran Turismo 7")] [ExportMetadata("Version", "0.9")] public class GT7Plugin : Game { @@ -141,7 +141,15 @@ public async void Init() Task listenTask = Task.CompletedTask; //"192.168.50.164"; - var simInterface = new SimulatorInterfaceClient(_settings.Get("ip") , SimulatorInterfaceGameType.GT7); + var portOverride = _settings.Get("consoleport"); + + SimulatorInterfaceClient simInterface; + + if (portOverride == SimulatorInterfaceClient.BindPortGT7) + simInterface = new SimulatorInterfaceClient(_settings.Get("ip"), SimulatorInterfaceGameType.GT7); + else + simInterface = new SimulatorInterfaceClient(_settings.Get("ip") , SimulatorInterfaceGameType.GT7, portOverride); + simInterface.OnReceive += SimInterface_OnReceive; if (_settings.Get("forwardingEnabled")) @@ -315,6 +323,16 @@ public float CalculateCentrifugalAcceleration(Vector3 velocity, Vector3 angularV Value = "255.255.255.255", ValidationEnabled = true + }, + new UserSetting + { + DisplayName = $"Console Incoming Port", + Name = "consoleport", + Description = "The default port for incoming data from the console. (Default: 33740)", + SettingType = SettingType.NetworkPort, + Value = 33740, + ValidationEnabled = true + } }; } diff --git a/Plugins/GT7Plugin/Properties/AssemblyInfo.cs b/Plugins/GT7Plugin/Properties/AssemblyInfo.cs index d091980..ae751e4 100644 --- a/Plugins/GT7Plugin/Properties/AssemblyInfo.cs +++ b/Plugins/GT7Plugin/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ [assembly: ComVisible(false)] [assembly: Guid("7781f6be-a56f-439b-812a-bba788dbb5d8")] -[assembly: AssemblyFileVersion("0.9.4.0")] -[assembly: AssemblyVersion("0.9.4.0")] +[assembly: AssemblyFileVersion("0.9.5.0")] +[assembly: AssemblyVersion("0.9.5.0")] [assembly: InternalsVisibleTo("GT7PluginTest")] diff --git a/Plugins/GT7Plugin/Resources/description.html b/Plugins/GT7Plugin/Resources/description.html index 1024d78..264f3a3 100644 --- a/Plugins/GT7Plugin/Resources/description.html +++ b/Plugins/GT7Plugin/Resources/description.html @@ -15,5 +15,5 @@

UDP Forwarding

Notes

When port forwarding you may need to use the ipaddress instead of the autodisovery

- -version 0.9.4 \ No newline at end of file +
+version 0.9.5 \ No newline at end of file