vPOD has outgrown its home inside the console's folder: it now emulates both halves of a pod (Munga game client + TeslaLauncher service / provisioning), so it lives at the repo root beside Console/, Launcher/, Contract/ and SecureConfig/, like the peer it has become. Accompanying changes: project references rebased (Contract, SecureConfig, the console's vendored Munga Net.dll), solution + DiffTests reference paths, the console csproj's now-obsolete vPOD source exclusion removed, and the root README / Apps.xml / vPOD README path mentions updated. pack.ps1 is self-relative and now emits vPOD/dist/vPOD.zip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
107 lines
2.8 KiB
C#
107 lines
2.8 KiB
C#
using System;
|
|
using Munga.Net;
|
|
|
|
namespace VPod;
|
|
|
|
/// <summary>
|
|
/// The launch options a real game client understands, parsed from the command
|
|
/// line the console/launcher starts it with. vPOD accepts the same shape so it
|
|
/// is a drop-in stand-in:
|
|
/// <c>-net <port></c> Munga control port (default 1501)
|
|
/// <c>-lc</c> live-camera role (cosmetic here; state model is identical)
|
|
/// <c>-mr</c> mission-review role
|
|
/// <c>-res W H</c> resolution (ignored)
|
|
/// <c>-app rp|bt</c> which ApplicationID to report (RP by default; also
|
|
/// switchable live in the UI)
|
|
/// <c>-host <id></c> the responding host id reported in state responses
|
|
///
|
|
/// vPOD-only (not a real game-client option):
|
|
/// <c>-nomanage</c> disable the virtual launcher / site-management side
|
|
/// (no provisioning beacons, no TCP 53290 listener)
|
|
/// </summary>
|
|
internal sealed class PodArguments
|
|
{
|
|
public int Port { get; private set; } = MungaSocket.ConsolePort; // 1501
|
|
|
|
public ApplicationID Application { get; private set; } = ApplicationID.RPL4;
|
|
|
|
public HostType HostType { get; private set; } = HostType.GameMachineHostType;
|
|
|
|
public int HostId { get; private set; } = 1;
|
|
|
|
public bool NoManage { get; private set; }
|
|
|
|
public static PodArguments Parse(string[] args)
|
|
{
|
|
PodArguments result = new PodArguments();
|
|
for (int i = 0; i < args.Length; i++)
|
|
{
|
|
string token = args[i].ToLowerInvariant();
|
|
switch (token)
|
|
{
|
|
case "-net":
|
|
if (i + 1 < args.Length && int.TryParse(args[i + 1], out int port))
|
|
{
|
|
result.Port = port;
|
|
i++;
|
|
}
|
|
break;
|
|
case "-lc":
|
|
result.HostType = HostType.MissionReviewHostType;
|
|
break;
|
|
case "-mr":
|
|
result.HostType = HostType.MissionReviewHostType;
|
|
break;
|
|
case "-res":
|
|
i += 2; // width height, ignored
|
|
break;
|
|
case "-app":
|
|
if (i + 1 < args.Length)
|
|
{
|
|
result.Application = ParseApp(args[i + 1]);
|
|
i++;
|
|
}
|
|
break;
|
|
case "-host":
|
|
if (i + 1 < args.Length && int.TryParse(args[i + 1], out int host))
|
|
{
|
|
result.HostId = host;
|
|
i++;
|
|
}
|
|
break;
|
|
case "-nomanage":
|
|
result.NoManage = true;
|
|
break;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
private static ApplicationID ParseApp(string value)
|
|
{
|
|
switch (value.ToLowerInvariant())
|
|
{
|
|
case "bt":
|
|
case "btl4":
|
|
case "battletech":
|
|
return ApplicationID.BTL4;
|
|
case "nd":
|
|
case "ndl4":
|
|
return ApplicationID.NDL4;
|
|
default:
|
|
return ApplicationID.RPL4;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Mirror of the console's HostType (GameMachine=0, MissionReview=2, Console=3).
|
|
/// Duplicated here so vPOD does not depend on the console assembly.
|
|
/// </summary>
|
|
internal enum HostType
|
|
{
|
|
GameMachineHostType = 0,
|
|
MissionReviewHostType = 2,
|
|
ConsoleHostType = 3
|
|
}
|