Hello. I am getting the following error:
{“level”:“error”,“ts”:“2024-06-17T17:06:42.425Z”,“caller”:“server/runtime_javascript_logger.go:94”,“msg”:“GoError: error creating match: error creating match: cannot encode params”,“mode”:“matchmaker”}
My match is coming out as a relayed match instead of an authoritative match. What could I be doing wrong?
The nk.matchCreate
function is failing to create the match, the params
argument should be void
or an object (nakama-common/index.d.ts at master · heroiclabs/nakama-common · GitHub).
If the param is correct and the function still throws an error please share a code snippet with how you’re calling nk.MatchCreate()
.
Hope this helps.
I removed the parameters completely for now. If I figure out I need to use them in the future and I still get an error, I’ll come back to this post. What do you think would be a good example of using params for a turn-based authoritative crazy eights game?
I’m still learning.
I suggest you have a look at our authoritative tic-tac-toe implementation example: GitHub - heroiclabs/nakama-project-template: An example project on how to set up and write custom server code in Nakama server..
In the template matchCreate
params are used to start “normal” or “fast” mode matches, the latter having shorter turns so the players have to play faster.
Hope it helps!
1 Like