Skip to content

Commit

Permalink
Renamed Main to reflect what application does
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowAfterlife committed May 19, 2021
1 parent e459873 commit 446dd2b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ This way, you can avoid port forwarding so long as Steam can establish a P2P con
(e.g. `480` for SDK demo app)
since free apps do not have the matchmaking API enabled by default.
Make sure that Steam client is running!
- Select the protocol (TCP or UDP) that the game uses.
Most games mention this in documentation; if they don't, they likely use TCP.
- The person hosting a server (host) picks Server.
Enter the IP to connect to (`127.0.0.1` if hosted on the same machine)
and port (determined by the game).
Expand All @@ -49,13 +51,25 @@ This way, you can avoid port forwarding so long as Steam can establish a P2P con

## Limitations and caveats

- Routing packets through an extra pair of applications may slightly increase latency compared to direct connections. In my tests, added latency appeared to be 10..20ms, depending on the game.
- Only supports two players per session
(though you can technically run multiple copies of the tool on host's end)
- Does not support forwarding socket errors - if something goes wrong, you'll get either a generic "connection closed" or a "connection timeout". Inspecting the tool's output may reveal the actual problem.
- No Mac/Linux builds unless you compile them yourself (see below)
- The tool has no knowledge of what application it's communicating with,
so it's on you not to do anything stupid/insecure.

## Command-line arguments

You may run the tool from CLI (Command Prompt or PowerShell on Windows, Terminal on Mac/Linux, etc.) to avoid having to re-enter details every time you run the tool. Supported arguments are as following:

- `--server`: Automatically enters server mode
- `--client`: Automatically enters client mode
- `--tcp`: Automatically uses TCP protocol
- `--udp`: Automatically uses UDP protocol
- `--host <ip>`: Uses the specified IP address to host on/connect to (e.g. `--host 127.0.0.1`)
- `--port <number>`: Uses the specified IP address to host on/connect to (e.g. `--port 5394`)

## Compiling

First-time setup:
Expand Down
3 changes: 2 additions & 1 deletion SteamworksP2P.hxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<option directives="" />
<option flashStrict="False" />
<option noInlineOnDebug="False" />
<option mainClass="Main" />
<option mainClass="SteamworksP2P" />
<option enabledebug="False" />
<option additional="" />
</build>
Expand All @@ -33,6 +33,7 @@
<!-- Class files to compile (other referenced classes will automatically be included) -->
<compileTargets>
<compile path="src\Main.hx" />
<compile path="src\SteamworksP2P.hx" />
</compileTargets>
<!-- Paths to exclude from the Project Explorer tree -->
<hiddenPaths>
Expand Down
2 changes: 1 addition & 1 deletion src/Main.hx → src/SteamworksP2P.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SysTools.*;
* ...
* @author YellowAfterlife
*/
class Main {
class SteamworksP2P {
static function main() {
println("hello!");
Params.init();
Expand Down

0 comments on commit 446dd2b

Please sign in to comment.