Hey,
I’ve been playing around learning Nakama and trying out how the authoritative server works now. I’m trying the example from the documentation as is, but I’m getting this error:
nakama | {“level”:“error”,“ts”:“2020-11-17T09:40:30.517Z”,“caller”:“server/pipeline_matchmaker.go:85”,“msg”:“Error running Matchmaker Matched hook.”,“error”:“Error running runtime Matchmaker Matched hook: /nakama/data/modules/custommatch.lua:23: attempt to index a non-table object(string) with key ‘format’\nstack traceback:\n\t/nakama/data/modules/custommatch.lua:23: in main chunk\n\t[G]: ?”}
This refers to the code from the authoritative server page, this line:
nk.logger_info(("Matched user '%s' named '%s'"):format(presence.user_id, presence.username))
I haven’t used Lua much in the past few years, so maybe it’s just a Lua-noob issue. I found some object dump code, and tried that and the ‘matched_users’ do look correct, it does include users with both user_id:s and usernames.
EDIT: Got it working by changing how format was handled, to this:
nk.logger_info(string.format(“Matched user ‘%s’ named ‘%s’”,presence.user_id, presence.username))
Unsure why this is, but found out this other way of writing format. Maybe some Lua version missmatch?
Thanks!
Niklas