Created
July 3, 2018 22:31
-
-
Save c0ldfront/4a03a110852c25e72306e16ae06538cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----- LOG -- | |
{"level":"info","ts":"2018-07-03T22:29:40.538Z","msg":"Startup done"} | |
----- Context ---------- | |
----- Context "env" :: "table: 0xc4204b6480" :: "table"----- | |
----- Context "execution_mode" :: "after" :: "string"----- | |
----- Context "query_params" :: "table: 0xc420538b40" :: "table"----- | |
----- End Context ----- | |
----- Payload ---------- | |
----- Payload "token" :: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" :: "string"----- | |
----- End Payload ----- | |
----- inituser.lua -- | |
local nk = require("nakama") | |
local function initialize_user(context, payload) | |
local context_object = ("context: %q"):format(context) | |
local payload_object = ("payload: %q"):format(payload) | |
-- local context_userid = ("context user_id: %q"):format(context.user_id) | |
-- local payload_userid = ("payload user_id: %q"):format(payload.user_id) | |
-- local context_username = ("context username: %q"):format(context.username) | |
-- local payload_username = ("payload username: %q"):format(payload.username) | |
-- local context_sessionid = ("context session_id: %q"):format(context.session_id) | |
-- local payload_sessionid = ("payload session_id: %q"):format(payload.session_id) | |
print("----- Context ----------") | |
for ck, cv in pairs(context) do | |
print(("----- Context %q :: %q :: %q-----"):format(ck, cv, type(cv))) | |
end | |
print("----- End Context -----") | |
print("") | |
print("----- Payload ----------") | |
for pk, pv in pairs(payload) do | |
print(("----- Payload %q :: %q :: %q-----"):format(pk, pv, type(pv))) | |
end | |
print("----- End Payload -----") | |
end | |
nk.register_req_after(initialize_user, "AuthenticateEmail") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment