My Client’s request to join a match has it’s field “metadata” properly defined, but the parameter “metadata” received by the handler “match_join_attempt” is a empty table.
- Versions: Nakama 3.5, Docker, Godot (SDK) and 3.4
- Server Framework Runtime language Lua
In GDScript, the call to join_match_async (variable is_master
is true
):
var match_join_result: NakamaRTAPI.Match = yield(_socket.join_match_async(_world_id, {"is_master" : is_master}), "completed")
The Client’s debug message regarding the request sent. The “metadata” has it’s expected value:
=== Nakama : DEBUG === Sending async request: MatchJoin<match_id=[...].nakama1, token=Null, metadata={is_master:True}>
In the Lua Server Runtime’s match_join_attempt handler, when printing every key/value pair of the parameter metadata
, the table is empty:
local function metadata2string(metadata)
local txt = {"{ "}
for k, v in pairs(metadata) do
txt[#txt+1] = table.concat({" [",k," = ",v,"]"})
end
txt[#txt+1] = " }"
return table.concat(txt)
end
[...]
function world_control.match_join_attempt( context, dispatcher, tick, state, presence, metadata )
nakama.logger_debug(metadata2string) -- prints only "{ }"