[S_API FAIL] And not being able to register server with the steam master server
Closed this issue · 3 comments
Hey,
So I've been battling with this issue for a few days, I'm just simply not able to list my server within the steam server browser.
This is my server initialization code:
var serverInit = new SteamServerInit("spacewar", config.serverName){
GamePort = (ushort)config.port,
Secure = true
};
Debug.Log(serverInit.GameDescription);
Debug.Log(serverInit.ModDir);
Debug.Log(serverInit.GamePort);
Debug.Log(serverInit.QueryPort);
try
{
SteamServer.Init( deps.SteamAppId, serverInit, false );
if(SteamNetworkingSockets.RequestFakeIP()){
Debug.Log($"[{nameof(PLMServer)}] Requesting fake IP from steam");
}else{
Debug.Log($"[{nameof(PLMServer)}] Fake IP request already in progress!");
}
SteamServer.LogOnAnonymous();
}
catch ( System.Exception e )
{
Debug.LogError($"[{nameof(PLMServer)}] Error on server startup: {e}");
}
I believe I'm doing everything as instructed here, requesting the fake IP before logon but after Init.
Now, this is the output on the server from these steps:
Peasants Love Magic - Official Server 1
spacewar
7777
27016
dlopen failed trying to load:
steamclient.so
with error:
steamclient.so: cannot open shared object file: No such file or directory
[S_API] SteamAPI_Init(): Loaded '/home/ec2-user/.steam/sdk64/steamclient.so' OK. (First tried local 'steamclient.so')
CAppInfoCacheReadFromDiskThread took 0 milliseconds to initialize
Setting breakpad minidump AppID = 3014500
SteamInternal_SetMinidumpSteamID: Caching Steam ID: 76561197960265728 [API loaded no]
[S_API FAIL] Tried to access Steam interface SteamNetworkingUtils004 before SteamAPI_Init succeeded.
[PLMServer] Requesting fake IP from steam
[PLMServer] Established connection to Steam
[PLMServer] Got fake address 169.254.247.198:63736
Note: I've set the gamedir to "spacewar" for now, but I've tried with my own gamedir as well.
The only thing here that stands out is the [S_API FAIL], which seems to originate from SteamServer.Init() as there is nothing else before that. I tried to trace back the code to find the error but it seems to originate from steam's dll or something as I'm not able to find it.
Is this error what could be causing the problem? Why am I even seeing it as I'm doing everything like in the examples?
Anyway, after this part is done, I start the transport which in it's simplicity is just:
public override bool StartServer()
{
if (LogLevel <= LogLevel.Developer)
Debug.Log($"[{nameof(PLMTransport)}] - Starting as server.");
socketManager = SteamNetworkingSockets.CreateRelaySocketFakeIP<SocketManager>();
socketManager.Interface = this;
return true;
}
I thought I could be doing things in wrong order, however requesting the fake ip seems to have to be done before creating the relay socket, but also before logon.
After the server starts and I go to http://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001/?format=json&addr=169.254.247.198:63736
, there are no servers to be seen in the "servers" list.
However I'm still able to connect to the server by directly connecting to the same fake IP provided by steam as above.
This got me thinking that could it somehow be port related? I tried on both digitalocean and aws hosts, opening ports from their web tool, with no success. (I'm not able to open ports on my home network)
I've tried everything I can think of, I have no clue how to debug this further. If someone has a working example of this I would highly appreciate that as well!
I'm using the latest version from the UnityPlugin folder in the repo, along with Facepunch Transport plugin for Unity NGO.
On another note, the windows build also seems to randomly crash on startup when starting as server..
Fixed this by setting SteamServer.ServerName after calling SteamServer.Init and also setting "Product name" in Steamworks app config in the dedicated server section to my appId.