Closed SaadBazaz closed 1 month ago
Instead of setting matchmaking = false
, leave it null
or undefined
.
For example, instead of:
PlayroomKit.insertCoin(
matchmaking=false,
//... other options
)
You could try:
PlayroomKit.insertCoin(
//... other options, no matchmaking option at all
)
Will close the Issue if the above recommendations yield positive results, or if the Issue become stale.
Paraphrasing @momintlh:
I have tested the StartMatchMaking one, it first works fine then if a player leaves the game will crash and the attached ID error is thrown. after that I get the other abnormal behavior error, that is due to the coroutine, provided in the example.
Not setting matchmaking within insertcoin's initoption leads to the same result because its default value is false. It cannot be null because it's a C# bool.
Marking this as an issue which needs to be solved.
Going to test without using GetPlayers(), I will maintain a list on the games side and use that.
Going to test without using GetPlayers(), I will maintain a list on the games side and use that.
That sounds like a good idea to narrow it down. Did it work?
Going to test without using GetPlayers(), I will maintain a list on the games side and use that.
That sounds like a good idea to narrow it down. Did it work?
Getting the same error
If you can share an alt snippet which people can use instead of using it incorrectly, that could work as a solution too.
The code below achieves the same goal and leads to the same error
private void Initialize()
{
PlayroomKit.InsertCoin(new PlayroomKit.InitOptions()
{
maxPlayersPerRoom = 2,
roomCode = "abc",
matchmaking = false,
defaultPlayerStates = new() {
{"score", 0},
},
}, () =>
{
PlayroomKit.OnPlayerJoin(AddPlayer);
PlayroomKit.StartMatchmaking();
});
}
From my understanding the error is occurring when the room changes.
The fix might be this: Wait for the room change, (maybe by reading the URL) and only then call MyPlayer / or Update. I'll try this and report.
Resolved in #70
What happened?
In Unity, if I call InsertCoin with matchmaking == true, if seems to work fine. But I call InsertCoin with matchmaking == false, then call StartMatchmaking after that, I get an error.
Here is my code:
\
Version
0.0.14
What is your environment?
Unknown
Link to original discussion
https://discord.com/channels/997752993598419044/1228773906710528144
Relevant log output
In the console log image:
After that, I get even more errors: