I am trying to initialise the services to connect to our internal server, and I was creating them in the nk.run_once() method, so it’s only created once. Now I wanted to store this object somewhere I could see from inside the match handlers for when I have a new match I can ask configurations to the internal server. Where can I do this? I tried putting into the context, but it’s not there when I’m inside the handlers.
nk.run_once(function(context) nk.logger_info("Initializing services") context.server_client = ServerClient:create() end) function M.match_init(context, setupstate) local gamestate = game.create() local tickrate = 1 local label = "TexasHoldem" local response = context.server_client:config_retrieve() -- DO SOMETHING HERE return gamestate, tickrate, label end