Hello,
I am storing initial parameters of server authorative match in the match’s state.
{
…
initst={params.initst}
…
}
However, when finding the match using match_list,
the state is not returned. Instead, returns match_id, authoriative flag, and label (the docs do not appear to describe the schema of the match_list returned object, so above is just my understanding of what I see during the debugging)
Label field, from my understanding, can only be 256 chars long.
And that’s not enough length to represent my params.initst (I have a function that can serialize a flat json object into key=val pairs just so that I can put anything in the label, but the allowed length of the label is not enough).
Therefore, wanted to ask what would be a recommended design pattern for the cases where I would like to retrieve a portion or full json object representing match state via match_list
Here is the match_list invocation:
local matches = nk.match_list(limit, isauthoritative, nil, min_size, max_size,nil)
Here is my match_init that captures the initst
and stores into match state (initparm is currently empty, just relying on initst custome field, at the moment) :
local function match_init(context, params)
local state = {
debug = (params and params.debug) or false,
initparm=params.initparm,
initst = params.initst
}
if state.debug then
print("match init context:\n" .. du.print_r(context) .. "match init params:\n" .. du.print_r(params))
end
local tick_rate = 1
return state, tick_rate, "add_useful_256chars_label_later"
end
I am running latest version of Nakama server (as of today) built from tip of the source tree.
I read somewhere, (may be somewhere in the comments), that there was an effort to migrate from label as string, to using label as json object . This would, potentially, work for what I needed, but when trying to return {…} rather than string from match_init, I got an error saying that 3rd return object must be string.