and this line of code in ChallengeStarted cloud code:
//Initiation of the challenge settings through the challenger(similar to host)
if(Spark.getPlayer().getPlayerId() === challengerId){
As I said, in some cases challenged player (not challenger) can get ChallengeStarted message first. In that case scriptData is not set and he got null for scriptData.
Is there a reason you are trying to add scriptData to the ChallengeStartedMessage ? You can also set it to the challenge itself using SparkChallenge, you can read more about this here. Is user 2 in the Unity Editor or on a device ? Have you tried fully closing either before re authenticating ?
Thanks,
Liam
M
Mislav Zlatar
said
over 6 years ago
Hey Liam,
I was following Hearthstone tutorial, that's the reason why I fill scriptData in ChallengeStarted :)
User 2 is Editor.
It is rarely happening if I try to reproduce with 2 Chrome test harness instances. But often while one player is Chrome and other is in Unity Editor - I think that Editor player is somehow still cached and authenticated and then after I logout and then login with him, start challenge, got null because GameSparks thinks I am still logged in and in first challenge.
ChallengeWithdraw didn't make much difference
Can two players start one challenge and then start another one while first one is still running?
Mislav
M
Mislav Zlatar
said
over 6 years ago
This cannot be reproduced if Editor player is disconnecting and other is logged in, just if both players disconnects.
Mislav
M
Mislav Zlatar
said
over 6 years ago
Hey Liam,
Any news about this problem?
I can confirm that this is not problem with Unity, I can reproduce with 2 test harness windows.
Steps:
Player 1 finds a match Player 2 finds a match
Challenge Starts
Player 2 finds a match Player 1 finds a match
Challenge starts but player 2 got null for challenge script data
It is OK in this steps:
Player 1 finds a match Player 2 finds a match
Challenge Starts
Player 1 finds a match Player 2 finds a match
It is true that i starts challenge with same players and that challenge isnt finished yet but manual withdrawn challenge didn't help either.
Last time that happened was with challengeId: 579600524912893204b89e13
Mislav
M
Mislav Zlatar
said
over 6 years ago
Answer
Guys I am so sorry I totally overlooked one line of code. As I said I was following Hearthstone tutorial.
and this line of code in ChallengeStarted cloud code:
//Initiation of the challenge settings through the challenger(similar to host)
if(Spark.getPlayer().getPlayerId() === challengerId){
As I said, in some cases challenged player (not challenger) can get ChallengeStarted message first. In that case scriptData is not set and he got null for scriptData.
Mislav
Customer Support
said
over 6 years ago
Hi Mislav,
No problem, sincerest apologies for this being post being overlooked. I'm happy to hear you got this one worked out. If you run into any other issues that require immediate attention please log a ticket in our system and our team will get it addressed as fast as possible.
Mislav Zlatar
I am having difficulties when restarting challenge with Unity and Test Harness.
When I do this steps, got null for scriptData in ChallengeStartedMessage:
Following json is message from Unity:
And this is from GameSparks:
I checked Script.log and there is no error.
Also I tried with challengeEvent in which I call .drawChallenge() before user user1 disconnect, and same result.
Thanks,
Mislav
Guys I am so sorry I totally overlooked one line of code. As I said I was following Hearthstone tutorial.
Blame is on matchmaking tutorial (https://docs.gamesparks.com/tutorials/multiplayer/hearthstone-example/matchmaking.html).
and this line of code in ChallengeStarted cloud code:
As I said, in some cases challenged player (not challenger) can get ChallengeStarted message first. In that case scriptData is not set and he got null for scriptData.
Mislav
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Mislav,
Is there a reason you are trying to add scriptData to the ChallengeStartedMessage ? You can also set it to the challenge itself using SparkChallenge, you can read more about this here. Is user 2 in the Unity Editor or on a device ? Have you tried fully closing either before re authenticating ?
Thanks,
Liam
Mislav Zlatar
Hey Liam,
I was following Hearthstone tutorial, that's the reason why I fill scriptData in ChallengeStarted :)
User 2 is Editor.
It is rarely happening if I try to reproduce with 2 Chrome test harness instances. But often while one player is Chrome and other is in Unity Editor - I think that Editor player is somehow still cached and authenticated and then after I logout and then login with him, start challenge, got null because GameSparks thinks I am still logged in and in first challenge.
ChallengeWithdraw didn't make much difference
Can two players start one challenge and then start another one while first one is still running?
Mislav
Mislav Zlatar
This cannot be reproduced if Editor player is disconnecting and other is logged in, just if both players disconnects.
Mislav
Mislav Zlatar
Hey Liam,
Any news about this problem?
I can confirm that this is not problem with Unity, I can reproduce with 2 test harness windows.
Steps:
Player 1 finds a match
Player 2 finds a match
Challenge Starts
Player 2 finds a match
Player 1 finds a match
Challenge starts but player 2 got null for challenge script data
It is OK in this steps:
Player 1 finds a match
Player 2 finds a match
Challenge Starts
Player 1 finds a match
Player 2 finds a match
It is true that i starts challenge with same players and that challenge isnt finished yet but manual withdrawn challenge didn't help either.
Last time that happened was with challengeId: 579600524912893204b89e13
Mislav
Mislav Zlatar
Guys I am so sorry I totally overlooked one line of code. As I said I was following Hearthstone tutorial.
Blame is on matchmaking tutorial (https://docs.gamesparks.com/tutorials/multiplayer/hearthstone-example/matchmaking.html).
and this line of code in ChallengeStarted cloud code:
As I said, in some cases challenged player (not challenger) can get ChallengeStarted message first. In that case scriptData is not set and he got null for scriptData.
Mislav
Customer Support
Hi Mislav,
No problem, sincerest apologies for this being post being overlooked. I'm happy to hear you got this one worked out. If you run into any other issues that require immediate attention please log a ticket in our system and our team will get it addressed as fast as possible.
Thanks,
Liam
1 person likes this
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics