mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 07:28:45 -07:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2b3f66aec | |||
| 914852a107 | |||
| d3ca1f9297 |
@@ -126,10 +126,10 @@ jobs:
|
||||
-c Release \
|
||||
-r "${{ matrix.rid }}" \
|
||||
--self-contained true \
|
||||
/p:Version="$v" \
|
||||
/p:AssemblyVersion="${v}.0" \
|
||||
/p:FileVersion="${v}.0" \
|
||||
/p:InformationalVersion="$v"
|
||||
-p:Version="$v" \
|
||||
-p:AssemblyVersion="${v}.0" \
|
||||
-p:FileVersion="${v}.0" \
|
||||
-p:InformationalVersion="$v"
|
||||
|
||||
- name: Package
|
||||
shell: bash
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
alongside Windows. The shared Backend classes are written to
|
||||
OperatingSystem.IsWindows()-gate any Windows-only paths. -->
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<!-- Declared so a RID-less restore produces assets for every target the
|
||||
CI matrix / release pipeline later publishes with no-restore. Without
|
||||
this, RID-specific publish fails with NETSDK1047. -->
|
||||
<RuntimeIdentifiers>win-x64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>DorkNet.ServerCli</RootNamespace>
|
||||
|
||||
@@ -14,8 +14,15 @@ public static class Program
|
||||
{
|
||||
public static async Task<int> Main(string[] args)
|
||||
{
|
||||
// --help / -h (and a bare invocation) print usage and exit cleanly.
|
||||
if (args.Length == 0 || args.Contains("--help") || args.Contains("-h"))
|
||||
{
|
||||
PrintHelp();
|
||||
return 0;
|
||||
}
|
||||
|
||||
var parsed = ParseArgs(args);
|
||||
if (parsed is null) return 1; // ParseArgs already wrote --help or an error.
|
||||
if (parsed is null) return 1; // ParseArgs already wrote the error.
|
||||
|
||||
// Validate required values up front so the user sees the
|
||||
// failure before any download / process spin-up.
|
||||
@@ -216,50 +223,52 @@ public static class Program
|
||||
|
||||
private static ParsedArgs? ParseArgs(string[] args)
|
||||
{
|
||||
if (args.Length == 0 || args.Contains("--help") || args.Contains("-h"))
|
||||
{
|
||||
PrintHelp();
|
||||
return null;
|
||||
}
|
||||
|
||||
string photon = "", voice = "", region = "us";
|
||||
string mode = "localtunnel", apex = "", name = "DorkNet Server";
|
||||
string versionKey = "march_2020_03_10";
|
||||
string? serverDir = null;
|
||||
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
try
|
||||
{
|
||||
string Next()
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
{
|
||||
if (i + 1 >= args.Length)
|
||||
throw new ArgumentException($"missing value for {args[i]}");
|
||||
return args[++i];
|
||||
string Next()
|
||||
{
|
||||
if (i + 1 >= args.Length)
|
||||
throw new ArgumentException($"missing value for {args[i]}");
|
||||
return args[++i];
|
||||
}
|
||||
switch (args[i])
|
||||
{
|
||||
case "--photon-id": photon = Next(); break;
|
||||
case "--voice-id": voice = Next(); break;
|
||||
case "--region": region = Next(); break;
|
||||
case "--mode": mode = Next(); break;
|
||||
case "--apex": apex = Next(); break;
|
||||
case "--name": name = Next(); break;
|
||||
case "--version": versionKey = Next(); break;
|
||||
case "--server-dir": serverDir = Next(); break;
|
||||
default:
|
||||
Console.Error.WriteLine($"error: unknown arg '{args[i]}' (try --help)");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
switch (args[i])
|
||||
|
||||
HostingMode parsedMode = mode.ToLowerInvariant() switch
|
||||
{
|
||||
case "--photon-id": photon = Next(); break;
|
||||
case "--voice-id": voice = Next(); break;
|
||||
case "--region": region = Next(); break;
|
||||
case "--mode": mode = Next(); break;
|
||||
case "--apex": apex = Next(); break;
|
||||
case "--name": name = Next(); break;
|
||||
case "--version": versionKey = Next(); break;
|
||||
case "--server-dir": serverDir = Next(); break;
|
||||
default:
|
||||
Console.Error.WriteLine($"error: unknown arg '{args[i]}' (try --help)");
|
||||
return null;
|
||||
}
|
||||
"localtunnel" or "lt" or "internet" or "tunnel" => HostingMode.SingleOriginTunnel,
|
||||
"wildcard" or "remote" or "tunnelto" => HostingMode.RemoteWildcard,
|
||||
"lan" or "local" or "wifi" => HostingMode.LocalNetwork,
|
||||
_ => throw new ArgumentException($"unknown --mode '{mode}' (try localtunnel, wildcard, lan)"),
|
||||
};
|
||||
|
||||
return new ParsedArgs(photon, voice, region, parsedMode, apex, name, versionKey, serverDir);
|
||||
}
|
||||
|
||||
HostingMode parsedMode = mode.ToLowerInvariant() switch
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
"localtunnel" or "lt" or "internet" or "tunnel" => HostingMode.SingleOriginTunnel,
|
||||
"wildcard" or "remote" or "tunnelto" => HostingMode.RemoteWildcard,
|
||||
"lan" or "local" or "wifi" => HostingMode.LocalNetwork,
|
||||
_ => throw new ArgumentException($"unknown --mode '{mode}' (try localtunnel, wildcard, lan)"),
|
||||
};
|
||||
|
||||
return new ParsedArgs(photon, voice, region, parsedMode, apex, name, versionKey, serverDir);
|
||||
Console.Error.WriteLine($"error: {ex.Message} (try --help)");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void PrintHelp()
|
||||
|
||||
@@ -29,8 +29,6 @@ Go to **[dashboard.photonengine.com](https://dashboard.photonengine.com/)**
|
||||
and click "Sign up". Email + password; the free tier doesn't ask for a
|
||||
card.
|
||||
|
||||

|
||||
|
||||
> If you already have an account from another project, log in instead.
|
||||
> Multiple DorkNet servers can share the same Photon account, but each
|
||||
> server needs its own AppId pair so concurrent player counts don't
|
||||
@@ -49,15 +47,11 @@ for:
|
||||
|
||||
Click **CREATE**.
|
||||
|
||||

|
||||
|
||||
## Step 3 — Copy the Realtime AppId
|
||||
|
||||
You land back on the dashboard with your new app at the top. The AppId
|
||||
is the long string under the app name — click it to copy.
|
||||
|
||||

|
||||
|
||||
That's your **Realtime AppId**. Paste it into:
|
||||
|
||||
- the launcher's first-run wizard step 4, **REALTIME APPID** field, OR
|
||||
@@ -69,8 +63,6 @@ That's your **Realtime AppId**. Paste it into:
|
||||
If you want in-game voice chat, repeat Step 2 with **Photon Voice**
|
||||
selected instead of Realtime. Same flow.
|
||||
|
||||

|
||||
|
||||
Copy the Voice AppId from the dashboard the same way as Step 3 and
|
||||
paste it into:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user