Sign In Register

How can we help you today?

Start a new topic
Answered

GS.GameSparksAvailable multiple responses

I am using the GameSparksUnity.cs script, then from my script simply adding:

 

GS.GameSparksAvailable += handleGameSparksAvailable;
GS.GameSparksAuthenticated = handleGameSparksAuthenticated;

I am calling DeviceAuthenticationRequest().Send in handleGameSparksAvailable() so then I get multiple GS.GameSparksAuthenticated responses.


Thank you for any help.



My console log is here

 

GS: Connecting to:wss://gsp-aeu000-se04.gamesparks.net/ws/device/n316653E8Zzp?deviceOS=WINDOWS&deviceID=6ee51a5997008fe406b6a8589534049b61ec4806&SDK=
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
GameSparks.Platforms.<DebugMsg>c__AnonStorey0:<>m__0() (at Assets\GameSparks\Platforms\PlatformBase.cs:380)
GameSparks.Platforms.PlatformBase:Update() (at Assets\GameSparks\Platforms\PlatformBase.cs:236)
 
(Filename: Assets/GameSparks/Platforms/PlatformBase.cs Line: 380)

GS: OPENED
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
GameSparks.Platforms.<DebugMsg>c__AnonStorey0:<>m__0() (at Assets\GameSparks\Platforms\PlatformBase.cs:380)
GameSparks.Platforms.PlatformBase:Update() (at Assets\GameSparks\Platforms\PlatformBase.cs:236)
 
(Filename: Assets/GameSparks/Platforms/PlatformBase.cs Line: 380)

GS: RECV:{"@class":".AuthenticatedConnectResponse","nonce":"a2c9d963-cf77-4e48-9f9f-8ff71beafac1","requestId":"0"}
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
GameSparks.Platforms.<DebugMsg>c__AnonStorey0:<>m__0() (at Assets\GameSparks\Platforms\PlatformBase.cs:380)
GameSparks.Platforms.PlatformBase:Update() (at Assets\GameSparks\Platforms\PlatformBase.cs:236)
 
(Filename: Assets/GameSparks/Platforms/PlatformBase.cs Line: 380)

GS: SEND:{"@class":".AuthenticatedConnectRequest","hmac":"yMKu07iLimkJxTcFU+OD0cRw9RxVDWm48ZgiY9Xtq7o=","os":"WINDOWS","platform":"WindowsEditor","deviceId":"6ee51a5997008fe406b6a8589534049b61ec4806","authToken":"e96b4282-aa2f-4368-b453-8a67e03f0db5"}
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
GameSparks.Platforms.<DebugMsg>c__AnonStorey0:<>m__0() (at Assets\GameSparks\Platforms\PlatformBase.cs:380)
GameSparks.Platforms.PlatformBase:Update() (at Assets\GameSparks\Platforms\PlatformBase.cs:236)
 
(Filename: Assets/GameSparks/Platforms/PlatformBase.cs Line: 380)

GS: RECV:{"@class":".AuthenticatedConnectResponse","authToken":"759bc13b-484c-4c12-9572-7709b4e3e1dd","requestId":"0","sessionId":"a2c9d963-cf77-4e48-9f9f-8ff71beafac1","userId":"5989ddfc7eca3f04543c10a1"}
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
GameSparks.Platforms.<DebugMsg>c__AnonStorey0:<>m__0() (at Assets\GameSparks\Platforms\PlatformBase.cs:380)
GameSparks.Platforms.PlatformBase:Update() (at Assets\GameSparks\Platforms\PlatformBase.cs:236)
 
(Filename: Assets/GameSparks/Platforms/PlatformBase.cs Line: 380)

 


Best Answer

 Hey Daniel,


So i can explain what is happening here from the steps above...



[1] - This is the websocket connecting the SDK to GameSparks
GS: Connecting to:wss://gsp-aeu000-se04.gamesparks.net/ws/device/n316653E8Zzp?deviceOS=WINDOWS&deviceID=6ee51a5997008fe406b6a8589534049b61ec4806&SDK=
[2] - This is the response from the server indicating the socket is authenticated
GS: RECV:{"@class":".AuthenticatedConnectResponse","nonce":"a2c9d963-cf77-4e48-9f9f-8ff71beafac1","requestId":"0"}
[3] - This is an automatic authentication preformed by GameSparks SDK if the is a valid auth-token cached by the SDK. Its an auto-login for the last user
GS: SEND:{"@class":".AuthenticatedConnectRequest","hmac":"yMKu07iLimkJxTcFU+OD0cRw9RxVDWm48ZgiY9Xtq7o=","os":"WINDOWS","platform":"WindowsEditor","deviceId":"6ee51a5997008fe406b6a8589534049b61ec4806","authToken":"e96b4282-aa2f-4368-b453-8a67e03f0db5"}
[4] - This is the auth-response indicating the palyer is logged in. You can see that from the userId at the end.
S: RECV:{"@class":".AuthenticatedConnectResponse","authToken":"759bc13b-484c-4c12-9572-7709b4e3e1dd","requestId":"0","sessionId":"a2c9d963-cf77-4e48-9f9f-8ff71beafac1","userId":"5989ddfc7eca3f04543c10a1"}
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)


So they are not duplicated, they are just named the same because they are part of an SDK request, rather than the requests you can send which would be AuthenticationRequest and AuthenticationResponse rather than AuthenticatedConnectRequest and Response.

let me know if that makes sense.
Thanks,
Sean











1 person has this question
1 Comment

Answer

 Hey Daniel,


So i can explain what is happening here from the steps above...



[1] - This is the websocket connecting the SDK to GameSparks
GS: Connecting to:wss://gsp-aeu000-se04.gamesparks.net/ws/device/n316653E8Zzp?deviceOS=WINDOWS&deviceID=6ee51a5997008fe406b6a8589534049b61ec4806&SDK=
[2] - This is the response from the server indicating the socket is authenticated
GS: RECV:{"@class":".AuthenticatedConnectResponse","nonce":"a2c9d963-cf77-4e48-9f9f-8ff71beafac1","requestId":"0"}
[3] - This is an automatic authentication preformed by GameSparks SDK if the is a valid auth-token cached by the SDK. Its an auto-login for the last user
GS: SEND:{"@class":".AuthenticatedConnectRequest","hmac":"yMKu07iLimkJxTcFU+OD0cRw9RxVDWm48ZgiY9Xtq7o=","os":"WINDOWS","platform":"WindowsEditor","deviceId":"6ee51a5997008fe406b6a8589534049b61ec4806","authToken":"e96b4282-aa2f-4368-b453-8a67e03f0db5"}
[4] - This is the auth-response indicating the palyer is logged in. You can see that from the userId at the end.
S: RECV:{"@class":".AuthenticatedConnectResponse","authToken":"759bc13b-484c-4c12-9572-7709b4e3e1dd","requestId":"0","sessionId":"a2c9d963-cf77-4e48-9f9f-8ff71beafac1","userId":"5989ddfc7eca3f04543c10a1"}
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)


So they are not duplicated, they are just named the same because they are part of an SDK request, rather than the requests you can send which would be AuthenticationRequest and AuthenticationResponse rather than AuthenticatedConnectRequest and Response.

let me know if that makes sense.
Thanks,
Sean










Login to post a comment