Steamworks.NET: Steamworks.GameServer.Init doesn't take 6 arguments / gameserver.init "bad_response"
Steam.cs : lines 156/162
public static bool Init(uint unIP, ushort usAuthPort, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, string pchVersionString) { // added AuthPort variable
InteropHelp.TestIfPlatformSupported();
bool ret;
using (var pchVersionString2 = new InteropHelp.UTF8StringHandle(pchVersionString)) {
ret = NativeMethods.SteamInternal_GameServer_Init(unIP, usAuthPort, usGamePort, usQueryPort, eServerMode, pchVersionString2); // use NativeMethods.SteamInternal_GameServer_Init instead
}
Steamworks GameServer won’t initialize correctly without the Authentication port, this allows the use of the Authentication port.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (12 by maintainers)
That’s the worksround we are using at the moment Simply passing in a value of 0 on the usSteam port I think the param is called.
We are seeing issues with GameServers not getting messages from clients when using SteamNetworking or SteamNetworkingSockets (and its GameServer varients) even with this work around in place. That issue may be releated to something else around Mirror or similar but was hoping the server intialization and transport issue was related for a single easy fix 😃
For the moment we using a modified Steam.cs which calls SteamInternal_GameServer_Init, from what I saw in the game server header this is what SteamGameServer_Init does anyway so I think that will do us for now.
I have done a re-read and some more testing on this one
using the source from this project directly so the assemblies are the ones included in this project’s Plugin folder.
As is e.g. without any changes when we initalize GameServer.init … we see the issue reported above, that is the odd looking UDP port binding on port 1 and the server will not show up in Steam Game Server Browser either via query through the API nor via the view in the Steam Client.
If we modify Steam.cs to call SteamInternal_GameServer_Init passing in any value even 0 as the second param the most apparent issues appear to resolve and the server shows up in the browser.
Having a look over the change you linked from Steamworks SDK and the related steam_gameserver.h I do see a note there
When I examen the NativeMethods.cs of Steamworks.NET for the method in question SteamGameServer_Init I see its referencing an entry point SteamGameServer_InitSafe
[DllImport(NativeLibraryName, EntryPoint = "SteamGameServer_InitSafe", CallingConvention = CallingConvention.Cdecl)]That is as far as I got, its far to late in the evening 😃 … or well early in the day now 😦 … to keep poking Hopfully that is of some use to others