Sign In Register

How can we help you today?

Start a new topic

Multiple GameSparks Connections To Same Server

I'm trying to implement GameSparks into my server authoritative UE4 game and am running into a snag regarding making multiple connections to the server.

What I'm trying to accomplish is rather than having the client log into GameSparks and submit their own Log Events, the client sends a request to the game server to log in on their behalf. This would allow the server to trigger all player specific Log Events (setting position database, inventory database, etc.) which to my understand is much safer from a hacking perspective than having the client personally log them.

I launch my dedicated server first and then a client. Using text boxes from the client game I pass username/password variables to the server and log in on their behalf for "Tester01". This all works fine. My blueprint that updates player location processes and sends information to the "Tester01" playerID position data index perfectly.

My issue occurs when I launch a second game instance and pass new login credentials to the server ("Tester02"). The server processes the new login and logs in on their behalf, however it seems that in doing so drops the previous login. Now all "Set Position" events on the server are being sent only to the "Tester02" playerID position data index and the "Tester01" index is no longer updating correctly.

Basically it seems that the UE4 server can only be logged in to one GameSparks account at a time. Is this correct? Is there a way around this? I can get the functionality working fine if I set everything client-side, however then I am allowing the client to trigger events and database changes which seems very unsafe to me.


Have you looked at the REST API? My understanding from the docs is that the REST API was intended to solve the problem of server to server connectivity. Keep in mind the usage restrictions- I think its 600req per MAU. This will make you take care in caching data and only persisting things on intervals

you need to use the gamesparks server events which you pass the players unique Id then it can make requests to the gamesparks backend on the players behalf. its what i do in my game and i can do this with multiple players 

Thank you both for the responses. I did end up solving this a few days ago using something similar to what you mentioned Anthony. Rather than the server trying to log into players individual accounts in order to record events, I now have it log into a master account that then runs events for specific characters by retrieving their specific player ID and storing info in the database accordingly.

Login to post a comment