Skip to content

Commit

Permalink
add port override for incoming data to GT7 Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
drowhunter committed Aug 14, 2024
1 parent ab19ec3 commit 833d89e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
22 changes: 20 additions & 2 deletions Plugins/GT7Plugin/GT7Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -141,7 +141,15 @@ public async void Init()
Task listenTask = Task.CompletedTask;
//"192.168.50.164";

var simInterface = new SimulatorInterfaceClient(_settings.Get<string>("ip") , SimulatorInterfaceGameType.GT7);
var portOverride = _settings.Get<int>("consoleport");

SimulatorInterfaceClient simInterface;

if (portOverride == SimulatorInterfaceClient.BindPortGT7)
simInterface = new SimulatorInterfaceClient(_settings.Get<string>("ip"), SimulatorInterfaceGameType.GT7);
else
simInterface = new SimulatorInterfaceClient(_settings.Get<string>("ip") , SimulatorInterfaceGameType.GT7, portOverride);

simInterface.OnReceive += SimInterface_OnReceive;

if (_settings.Get<bool>("forwardingEnabled"))
Expand Down Expand Up @@ -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

}
};
}
Expand Down
4 changes: 2 additions & 2 deletions Plugins/GT7Plugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
4 changes: 2 additions & 2 deletions Plugins/GT7Plugin/Resources/description.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ <h3>UDP Forwarding</h3>

<h3><font color="red">Notes</font></h3>
<p>When port forwarding you may need to use the ipaddress instead of the autodisovery</p>

<small>version 0.9.4</small>
<hr />
<small>version 0.9.5</small>

0 comments on commit 833d89e

Please sign in to comment.