-
Notifications
You must be signed in to change notification settings - Fork 21
FAQ
Neico edited this page Jun 11, 2016
·
5 revisions
Q: I can't set the server's game port on the command-line using -Port=
using steam, what am I doing wrong?
A: It seems to be an oversight from Epic Games in their Steam implementation (also see this PR), here's the Diff with a fix, assuming you compile the Engine by yourself:
30c28393a78ec51871f2c9e39677d8ac45d1d3a8
.../OnlineSubsystemSteam/Private/OnlineSubsystemSteam.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Engine/Source/Runtime/Online/OnlineSubsystemSteam/Private/OnlineSubsystemSteam.cpp b/Engine/Source/Runtime/Online/OnlineSubsystemSteam/Private/OnlineSubsystemSteam.cpp
index 6b0e34e..2fe759b 100644
--- a/Engine/Source/Runtime/Online/OnlineSubsystemSteam/Private/OnlineSubsystemSteam.cpp
+++ b/Engine/Source/Runtime/Online/OnlineSubsystemSteam/Private/OnlineSubsystemSteam.cpp
@@ -543,7 +543,15 @@ bool FOnlineSubsystemSteam::InitSteamworksServer()
}
}
- GConfig->GetInt(TEXT("URL"), TEXT("Port"), GameServerGamePort, GEngineIni);
+ // Allow the command line to override the default port
+ if (FParse::Value(FCommandLine::Get(),TEXT("Port="), GameServerGamePort) == false)
+ {
+ if (!GConfig->GetInt( TEXT("URL"), TEXT("Port"), GameServerGamePort, GEngineIni))
+ {
+ GameServerGamePort = 7777;
+ }
+ }
+
GameServerSteamPort = GameServerGamePort + 1;
// Allow the command line to override the default query port