Steamworks.NET: ValidateAuthTicektResponce_t doesn't callback on servers

When we initialize as SteamGameServer and call BeginAuthSession The ValidateAuthTicektResponce_t never responds

We have been doing a lot of troublshooting on this and I finally took the mind to check the definitions … I noted that there is no SteamGameServer version of this callback there is only the one ValidateAuthTicektResponce_t defined in SteamCallbacks.cs and that definition sets the callback ID as

public const int k_iCallback = Constants.k_iSteamUserCallbacks + 43;

should there be a GameServerValidateAuthTicketResponce_t where in

public const int k_iCallback = Constants.k_iSteamGameServerCallbacks + 43;

If that is the case it would explain why we dont get the callback as expected and would sugest there is also an issue with GetAuthSessionTicketResponse_t similar thing … should have a GameServer variant

Then again I could be insain and something else is preventing the callback from returning but this works perfrectly on the Client API should be the same code for Server the only difference being

SteamGameServer.BeginAuthSession

as oppsed to

SteamUser.BeginAuthSession

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 48 (36 by maintainers)

Most upvoted comments

So I got to look into this again, I had to make one change in the test repo, and then it seemed to work fine:

m_ValidateAuthSessionTicketResponce = Callback<ValidateAuthTicketResponse_t>.Create(TestCB); To m_ValidateAuthSessionTicketResponce = Callback<ValidateAuthTicketResponse_t>.CreateGameServer(TestCB);

To match the usage in C++ that Spacewar has where they create it with STEAM_GAMESERVER_CALLBACK

These seem to be the only usages of the GameServer callback though for what ever reason:

// Tells us when we have successfully connected to Steam
STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnSteamServersConnected, SteamServersConnected_t );

// Tells us when there was a failure to connect to Steam
STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnSteamServersConnectFailure, SteamServerConnectFailure_t );

// Tells us when we have been logged out of Steam
STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnSteamServersDisconnected, SteamServersDisconnected_t );

// Tells us that Steam has set our security policy (VAC on or off)
STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnPolicyResponse, GSPolicyResponse_t );

// Tells us a client has been authenticated and approved to play by Steam (passes auth, license check, VAC status, etc...)
STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnValidateAuthTicketResponse, ValidateAuthTicketResponse_t );

// All connection changes are handled through this callback
STEAM_GAMESERVER_CALLBACK(CSpaceWarServer, OnNetConnectionStatusChanged, SteamNetConnectionStatusChangedCallback_t);

I have updated the test repo and our asset this issue should now be resolved

Thank you everyone

I can try this on Thursday night and let y’all know what happens.

Hey James, sorry I haven’t really been able to get to this much.

The callback numbers themselves are defined by Steam and are available via the Steamworks API here:

https://github.com/rlabrecque/Steamworks.NET/blob/master/CodeGen/steam/steam_api_internal.h#L247-L290=

It looks like all of the k_iSteamGameServerCallbacks callbacks are defined in isteamgameserver.h:

https://github.com/rlabrecque/Steamworks.NET/blob/f5c8f33c4fc4493f47d9a15c904b7025843c4fc7/CodeGen/steam/isteamgameserver.h#L283=

The callback Id is pretty arbitrary but – it must match on both sides, it’s basically the key to lookup what type of struct to use because Steam basically just sends (callbackId, binaryDataBlob, binaryDataBlobSize) to games, but then we (Steamworks code in the game) have to do deserialization from that blob into an actual struct.

I think one thing to try is enabling log_callbacks in Steam as documented here, would be interesting to see what kind of callbacks are /attempted/ to be sent when we call these functions:

https://partner.steamgames.com/doc/sdk/api/debugging