Module nakama

The Nakama client SDK for Defold.

Functions

create_match_create_message () Create a match.
create_match_join_message (match_id, token, metadata) Add a current user to a match.
create_match_leave_message (match_id) Remove the current user from a match.
create_channel_message_send_message (channel_id, content) Send a channel chat message if the current user has permission.
create_channel_message_update_message (channel_id, message_id, content) Update a channel chat message if the current user has permission.
create_channel_message_remove_message (channel_id, message_id) Remove a channel chat message if the current user has permission.
create_channel_join_message (target, type, persistence, hidden) Add the current user to a chat channel.
create_channel_leave_message (channel_id) Remove the current user from a chat channel.
create_matchmaker_add_message (query, min_count, max_count, string_properties, numeric_properties) Add the current user to a matchmaker.
create_matchmaker_remove_message (ticket) Remove the current user from a matchmaker.
create_match_data_message (match_id, op_code, data) Send match data for the current user.
create_status_follow_message (user_ids) Subscribe the current user to follow another user's status updates.
create_status_unfollow_message (user_ids) Unsubscribe the current user from following another user's status updates.
create_status_update_message (status) Update the current user's status.
create_group_user_list_group_user (state_int, user_api_user) create_group_user_list_group_user A single user-role pair.
create_user_group_list_user_group (group_api_group, state_int) create_user_group_list_user_group A single group-role pair.
create_write_leaderboard_record_request_leaderboard_record_write (metadata_str, operator_api_operator, score_str, subscore_str) create_write_leaderboard_record_request_leaderboard_record_write Record values to write.
create_write_tournament_record_request_tournament_record_write (metadata_str, operator_api_operator, score_str, subscore_str) create_write_tournament_record_request_tournament_record_write Record values to write.
create_api_account (custom_id_str, devices_arr, disable_time_str, email_str, user_api_user, verify_time_str, wallet_str) create_api_account A user with additional account details.
create_api_account_apple (token_str, vars_obj) create_api_account_apple Send a Apple Sign In token to the server.
create_api_account_custom (id_str, vars_obj) create_api_account_custom Send a custom ID to the server.
create_api_account_device (id_str, vars_obj) create_api_account_device Send a device to the server.
create_api_account_email (email_str, password_str, vars_obj) create_api_account_email Send an email with password to the server.
create_api_account_facebook (token_str, vars_obj) create_api_account_facebook Send a Facebook token to the server.
create_api_account_facebook_instant_game (signed_player_info_str, vars_obj) create_api_account_facebook_instant_game Send a Facebook Instant Game token to the server.
create_api_account_game_center (bundle_id_str, player_id_str, public_key_url_str, salt_str, signature_str, timestamp_seconds_str, vars_obj) create_api_account_game_center Send Apple's Game Center account credentials to the server.
create_api_account_google (token_str, vars_obj) create_api_account_google Send a Google token to the server.
create_api_account_steam (token_str, vars_obj) create_api_account_steam Send a Steam token to the server.
create_api_channel_message (channel_id_str, code_int, content_str, create_time_str, group_id_str, message_id_str, persistent_bool, room_name_str, sender_id_str, update_time_str, user_id_one_str, user_id_two_str, username_str) create_api_channel_message A message sent on a channel.
create_api_channel_message_list (cacheable_cursor_str, messages_arr, next_cursor_str, prev_cursor_str) create_api_channel_message_list A list of channel messages, usually a result of a list operation.
create_api_create_group_request (avatar_url_str, description_str, lang_tag_str, max_count_int, name_str, open_bool) create_api_create_group_request Create a group with the current user as owner.
create_api_delete_storage_object_id (collection_str, key_str, version_str) create_api_delete_storage_object_id Storage objects to delete.
create_api_delete_storage_objects_request (object_ids_arr) create_api_delete_storage_objects_request Batch delete storage objects.
create_api_event (external_bool, name_str, properties_obj, timestamp_str) create_api_event Represents an event to be passed through the server to registered event handlers.
create_api_friend (state_int, update_time_str, user_api_user) create_api_friend A friend of a user.
create_api_friend_list (cursor_str, friends_arr) create_api_friend_list A collection of zero or more friends of the user.
create_api_group (avatar_url_str, create_time_str, creator_id_str, description_str, edge_count_int, id_str, lang_tag_str, max_count_int, metadata_str, name_str, open_bool, update_time_str) create_api_group A group in the server.
create_api_group_list (cursor_str, groups_arr) create_api_group_list One or more groups returned from a listing operation.
create_api_group_user_list (cursor_str, group_users_arr) create_api_group_user_list A list of users belonging to a group, along with their role.
create_api_leaderboard_record (create_time_str, expiry_time_str, leaderboard_id_str, max_num_score_int, metadata_str, num_score_int, owner_id_str, rank_str, score_str, subscore_str, update_time_str, username_str) create_api_leaderboard_record Represents a complete leaderboard record with all scores and associated metadata.
create_api_leaderboard_record_list (next_cursor_str, owner_records_arr, prev_cursor_str, records_arr) create_api_leaderboard_record_list A set of leaderboard records, may be part of a leaderboard records page or a batch of individual records.
create_api_link_steam_request (account_api_account_steam, sync_bool) create_api_link_steam_request Link Steam to the current user's account.
create_api_match (authoritative_bool, handler_name_str, label_str, match_id_str, size_int, tick_rate_int) create_api_match Represents a realtime match.
create_api_match_list (matches_arr) create_api_match_list A list of realtime matches.
create_api_notification (code_int, content_str, create_time_str, id_str, persistent_bool, sender_id_str, subject_str) create_api_notification A notification in the server.
create_api_notification_list (cacheable_cursor_str, notifications_arr) create_api_notification_list A collection of zero or more notifications.
create_api_read_storage_object_id (collection_str, key_str, user_id_str) create_api_read_storage_object_id Storage objects to get.
create_api_read_storage_objects_request (object_ids_arr) create_api_read_storage_objects_request Batch get storage objects.
create_api_rpc (http_key_str, id_str, payload_str) create_api_rpc Execute an Lua function on the server.
create_api_session (created_bool, refresh_token_str, token_str) create_api_session A user's session used to authenticate messages.
create_api_session_logout_request (refresh_token_str, token_str) create_api_session_logout_request Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user.
create_api_session_refresh_request (token_str, vars_obj) create_api_session_refresh_request Authenticate against the server with a refresh token.
create_api_storage_object (collection_str, create_time_str, key_str, permission_read_int, permission_write_int, update_time_str, user_id_str, value_str, version_str) create_api_storage_object An object within the storage engine.
create_api_storage_object_ack (collection_str, key_str, user_id_str, version_str) create_api_storage_object_ack A storage acknowledgement.
create_api_storage_object_acks (acks_arr) create_api_storage_object_acks Batch of acknowledgements for the storage object write.
create_api_storage_object_list (cursor_str, objects_arr) create_api_storage_object_list List of storage objects.
create_api_storage_objects (objects_arr) create_api_storage_objects Batch of storage objects.
create_api_tournament (can_enter_bool, category_int, create_time_str, description_str, duration_int, end_active_int, end_time_str, id_str, max_num_score_int, max_size_int, metadata_str, next_reset_int, operator_api_operator, prev_reset_int, size_int, sort_order_int, start_active_int, start_time_str, title_str) create_api_tournament A tournament on the server.
create_api_tournament_list (cursor_str, tournaments_arr) create_api_tournament_list A list of tournaments.
create_api_tournament_record_list (next_cursor_str, owner_records_arr, prev_cursor_str, records_arr) create_api_tournament_record_list A set of tournament records which may be part of a tournament records page or a batch of individual records.
create_api_update_account_request (avatar_url_str, display_name_str, lang_tag_str, location_str, timezone_str, username_str) create_api_update_account_request Update a user's account details.
create_api_update_group_request (avatar_url_str, description_str, group_id_str, lang_tag_str, name_str, open_bool) create_api_update_group_request Update fields in a given group.
create_api_user (apple_id_str, avatar_url_str, create_time_str, display_name_str, edge_count_int, facebook_id_str, facebook_instant_game_id_str, gamecenter_id_str, google_id_str, id_str, lang_tag_str, location_str, metadata_str, online_bool, steam_id_str, timezone_str, update_time_str, username_str) create_api_user A user in the server.
create_api_user_group_list (cursor_str, user_groups_arr) create_api_user_group_list A list of groups belonging to a user, along with the user's role in each group.
create_api_users (users_arr) create_api_users A collection of zero or more users.
create_api_validate_purchase_apple_request (receipt_str) create_api_validate_purchase_apple_request
create_api_validate_purchase_google_request (purchase_str) create_api_validate_purchase_google_request
create_api_validate_purchase_huawei_request (purchase_str, signature_str) create_api_validate_purchase_huawei_request
create_api_validate_purchase_response (validated_purchases_arr) create_api_validate_purchase_response
create_api_validated_purchase (create_time_str, environment_validated_purchase_environment, product_id_str, provider_response_str, purchase_time_str, store_validated_purchase_store, transaction_id_str, update_time_str) create_api_validated_purchase Validated Purchase stored by Nakama.
create_api_write_storage_object (collection_str, key_str, permission_read_int, permission_write_int, value_str, version_str) create_api_write_storage_object The object to store.
create_api_write_storage_objects_request (objects_arr) create_api_write_storage_objects_request Write objects to the storage engine.
create_protobuf_any (type_url_str, value_str) create_protobuf_any
create_rpc_status (code_int, details_arr, message_str) create_rpc_status
create_client (config) Create a Nakama client instance.
on_notification (socket, fn) On notification hook.
on_matchdata (socket, fn) On match data hook.
on_matchpresence (socket, fn) On match presence hook.
on_matchmakermatched (socket, fn) On matchmaker matched hook.
on_statuspresence (socket, fn) On status presence hook.
on_streampresence (socket, fn) On stream presence hook.
on_streamdata (socket, fn) On stream data hook.
on_channelmessage (socket, fn) On channel message hook.
on_channelpresence (socket, fn) On channel presence hook.
on_disconnect (socket, fn) On disconnect hook.
create_socket (client) Create a Nakama socket.
socket_connect (socket, callback) Attempt to connect a Nakama socket to the server.
socket_send (socket, message, callback) Send message on Nakama socket.
set_bearer_token (client, bearer_token) Set Nakama client bearer token.
healthcheck (client, callback) healthcheck A healthcheck which load balancers can use to check the service.
get_account (client, callback) get_account Fetch the current user's account.
update_account (client, body_api_update_account_request, callback) update_account Update fields in the current user's account.
authenticate_apple (client, body_api_account_apple, create_bool, username_str, callback) authenticate_apple Authenticate a user with an Apple ID against the server.
authenticate_custom (client, body_api_account_custom, create_bool, username_str, callback) authenticate_custom Authenticate a user with a custom id against the server.
authenticate_device (client, body_api_account_device, create_bool, username_str, callback) authenticate_device Authenticate a user with a device id against the server.
authenticate_email (client, body_api_account_email, create_bool, username_str, callback) authenticate_email Authenticate a user with an email+password against the server.
authenticate_facebook (client, body_api_account_facebook, create_bool, username_str, sync_bool, callback) authenticate_facebook Authenticate a user with a Facebook OAuth token against the server.
authenticate_facebook_instant_game (client, body_api_account_facebook_instant_game, create_bool, username_str, callback) authenticate_facebook_instant_game Authenticate a user with a Facebook Instant Game token against the server.
authenticate_game_center (client, body_api_account_game_center, create_bool, username_str, callback) authenticate_game_center Authenticate a user with Apple's GameCenter against the server.
authenticate_google (client, body_api_account_google, create_bool, username_str, callback) authenticate_google Authenticate a user with Google against the server.
authenticate_steam (client, body_api_account_steam, create_bool, username_str, sync_bool, callback) authenticate_steam Authenticate a user with Steam against the server.
link_apple (client, body_api_account_apple, callback) link_apple Add an Apple ID to the social profiles on the current user's account.
link_custom (client, body_api_account_custom, callback) link_custom Add a custom ID to the social profiles on the current user's account.
link_device (client, body_api_account_device, callback) link_device Add a device ID to the social profiles on the current user's account.
link_email (client, body_api_account_email, callback) link_email Add an email+password to the social profiles on the current user's account.
link_facebook (client, body_api_account_facebook, sync_bool, callback) link_facebook Add Facebook to the social profiles on the current user's account.
link_facebook_instant_game (client, body_api_account_facebook_instant_game, callback) link_facebook_instant_game Add Facebook Instant Game to the social profiles on the current user's account.
link_game_center (client, body_api_account_game_center, callback) link_game_center Add Apple's GameCenter to the social profiles on the current user's account.
link_google (client, body_api_account_google, callback) link_google Add Google to the social profiles on the current user's account.
link_steam (client, body_api_link_steam_request, callback) link_steam Add Steam to the social profiles on the current user's account.
session_refresh (client, body_api_session_refresh_request, callback) session_refresh Refresh a user's session using a refresh token retrieved from a previous authentication request.
unlink_apple (client, body_api_account_apple, callback) unlink_apple Remove the Apple ID from the social profiles on the current user's account.
unlink_custom (client, body_api_account_custom, callback) unlink_custom Remove the custom ID from the social profiles on the current user's account.
unlink_device (client, body_api_account_device, callback) unlink_device Remove the device ID from the social profiles on the current user's account.
unlink_email (client, body_api_account_email, callback) unlink_email Remove the email+password from the social profiles on the current user's account.
unlink_facebook (client, body_api_account_facebook, callback) unlink_facebook Remove Facebook from the social profiles on the current user's account.
unlink_facebook_instant_game (client, body_api_account_facebook_instant_game, callback) unlink_facebook_instant_game Remove Facebook Instant Game profile from the social profiles on the current user's account.
unlink_game_center (client, body_api_account_game_center, callback) unlink_game_center Remove Apple's GameCenter from the social profiles on the current user's account.
unlink_google (client, body_api_account_google, callback) unlink_google Remove Google from the social profiles on the current user's account.
unlink_steam (client, body_api_account_steam, callback) unlink_steam Remove Steam from the social profiles on the current user's account.
list_channel_messages (client, channel_id_str, limit_int, forward_bool, cursor_str, callback) list_channel_messages List a channel's message history.
event (client, body_api_event, callback) event Submit an event for processing in the server's registered runtime custom events handler.
delete_friends (client, ids_arr, usernames_arr, callback) delete_friends Delete one or more users by ID or username.
list_friends (client, limit_int, state_int, cursor_str, callback) list_friends List all friends for the current user.
add_friends (client, ids_arr, usernames_arr, callback) add_friends Add friends by ID or username to a user's account.
block_friends (client, ids_arr, usernames_arr, callback) block_friends Block one or more users by ID or username.
import_facebook_friends (client, body_api_account_facebook, reset_bool, callback) import_facebook_friends Import Facebook friends and add them to a user's account.
import_steam_friends (client, body_api_account_steam, reset_bool, callback) import_steam_friends Import Steam friends and add them to a user's account.
list_groups (client, name_str, cursor_str, limit_int, lang_tag_str, members_int, open_bool, callback) list_groups List groups based on given filters.
create_group (client, body_api_create_group_request, callback) create_group Create a new group with the current user as the owner.
delete_group (client, group_id_str, callback) delete_group Delete a group by ID.
update_group (client, group_id_str, body_api_update_group_request, callback) update_group Update fields in a given group.
add_group_users (client, group_id_str, user_ids_arr, callback) add_group_users Add users to a group.
ban_group_users (client, group_id_str, user_ids_arr, callback) ban_group_users Ban a set of users from a group.
demote_group_users (client, group_id_str, user_ids_arr, callback) demote_group_users Demote a set of users in a group to the next role down.
join_group (client, group_id_str, callback) join_group Immediately join an open group, or request to join a closed one.
kick_group_users (client, group_id_str, user_ids_arr, callback) kick_group_users Kick a set of users from a group.
leave_group (client, group_id_str, callback) leave_group Leave a group the user is a member of.
promote_group_users (client, group_id_str, user_ids_arr, callback) promote_group_users Promote a set of users in a group to the next role up.
list_group_users (client, group_id_str, limit_int, state_int, cursor_str, callback) list_group_users List all users that are part of a group.
validate_purchase_apple (client, body_api_validate_purchase_apple_request, callback) validate_purchase_apple Validate Apple IAP Receipt
validate_purchase_google (client, body_api_validate_purchase_google_request, callback) validate_purchase_google Validate Google IAP Receipt
validate_purchase_huawei (client, body_api_validate_purchase_huawei_request, callback) validate_purchase_huawei Validate Huawei IAP Receipt
delete_leaderboard_record (client, leaderboard_id_str, callback) delete_leaderboard_record Delete a leaderboard record.
list_leaderboard_records (client, leaderboard_id_str, owner_ids_arr, limit_int, cursor_str, expiry_str, callback) list_leaderboard_records List leaderboard records.
write_leaderboard_record (client, leaderboard_id_str, body_write_leaderboard_record_request_leaderboard_record_write, callback) write_leaderboard_record Write a record to a leaderboard.
list_leaderboard_records_around_owner (client, leaderboard_id_str, owner_id_str, limit_int, expiry_str, callback) list_leaderboard_records_around_owner List leaderboard records that belong to a user.
list_matches (client, limit_int, authoritative_bool, label_str, min_size_int, max_size_int, query_str, callback) list_matches Fetch list of running matches.
delete_notifications (client, ids_arr, callback) delete_notifications Delete one or more notifications for the current user.
list_notifications (client, limit_int, cacheable_cursor_str, callback) list_notifications Fetch list of notifications.
rpc_func2 (client, id_str, payload_str, http_key_str, callback) rpc_func2 Execute a Lua function on the server.
rpc_func (client, id_str, body_, http_key_str, callback) rpc_func Execute a Lua function on the server.
session_logout (client, body_api_session_logout_request, callback) session_logout Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user.
read_storage_objects (client, body_api_read_storage_objects_request, callback) read_storage_objects Get storage objects.
write_storage_objects (client, body_api_write_storage_objects_request, callback) write_storage_objects Write objects into the storage engine.
delete_storage_objects (client, body_api_delete_storage_objects_request, callback) delete_storage_objects Delete one or more objects by ID or username.
list_storage_objects (client, collection_str, user_id_str, limit_int, cursor_str, callback) list_storage_objects List publicly readable storage objects in a given collection.
list_storage_objects2 (client, collection_str, user_id_str, limit_int, cursor_str, callback) list_storage_objects2 List publicly readable storage objects in a given collection.
list_tournaments (client, category_start_int, category_end_int, start_time_int, end_time_int, limit_int, cursor_str, callback) list_tournaments List current or upcoming tournaments.
list_tournament_records (client, tournament_id_str, owner_ids_arr, limit_int, cursor_str, expiry_str, callback) list_tournament_records List tournament records.
write_tournament_record2 (client, tournament_id_str, body_write_tournament_record_request_tournament_record_write, callback) write_tournament_record2 Write a record to a tournament.
write_tournament_record (client, tournament_id_str, body_write_tournament_record_request_tournament_record_write, callback) write_tournament_record Write a record to a tournament.
join_tournament (client, tournament_id_str, callback) join_tournament Attempt to join an open and running tournament.
list_tournament_records_around_owner (client, tournament_id_str, owner_id_str, limit_int, expiry_str, callback) list_tournament_records_around_owner List tournament records for a given owner.
get_users (client, ids_arr, usernames_arr, facebook_ids_arr, callback) get_users Fetch zero or more users by ID and/or username.
list_user_groups (client, user_id_str, limit_int, state_int, cursor_str, callback) list_user_groups List groups the current user belongs to.

Fields

VALIDATEDPURCHASEENVIRONMENT_UNKNOWN validated_purchase_environment - UNKNOWN: Unknown environment.
VALIDATEDPURCHASESTORE_APPLE_APP_STORE validated_purchase_store - APPLE_APP_STORE: Apple App Store - GOOGLE_PLAY_STORE: Google Play Store - HUAWEI_APP_GALLERY: Huawei App Gallery
APIOPERATOR_NO_OVERRIDE api_operator Operator that can be used to override the one set in the leaderboard.


Functions

create_match_create_message ()
Create a match.

Returns:

    The result of match_create.
create_match_join_message (match_id, token, metadata)
Add a current user to a match.

Parameters:

  • match_id The match id string.
  • token The authorization token.
  • metadata A table of metadata.

Returns:

    The result of match_join.
create_match_leave_message (match_id)
Remove the current user from a match.

Parameters:

  • match_id The match id string.

Returns:

    The result of match_leave.
create_channel_message_send_message (channel_id, content)
Send a channel chat message if the current user has permission.

Parameters:

  • channel_id The channel id string.
  • content The message content string.

Returns:

    The result of channel_message_send.
create_channel_message_update_message (channel_id, message_id, content)
Update a channel chat message if the current user has permission.

Parameters:

  • channel_id The channel id string.
  • message_id The message id string.
  • content The message content string.

Returns:

    The result of channel_message_update.
create_channel_message_remove_message (channel_id, message_id)
Remove a channel chat message if the current user has permission.

Parameters:

  • channel_id The channel id string.
  • message_id The message id string.

Returns:

    The result of channel_message_remove.
create_channel_join_message (target, type, persistence, hidden)
Add the current user to a chat channel.

Parameters:

  • target The target channel id.
  • type The message type {"string","number"}.
  • persistence Is the message persistant boolean.
  • hidden Is the message hidden boolean.

Returns:

    The result of channel_join.
create_channel_leave_message (channel_id)
Remove the current user from a chat channel.

Parameters:

  • channel_id The channel id string.

Returns:

    The result of channel_leave.
create_matchmaker_add_message (query, min_count, max_count, string_properties, numeric_properties)
Add the current user to a matchmaker.

Parameters:

  • query The matchmaker query string.
  • min_count The minimum user count.
  • max_count The maximum user count.
  • string_properties A table of user string properties.
  • numeric_properties A table of user numeric properties.

Returns:

    The result of matchmaker_add.
create_matchmaker_remove_message (ticket)
Remove the current user from a matchmaker.

Parameters:

  • ticket The matchmaker ticket.

Returns:

    The result of matchmaker_remove.
create_match_data_message (match_id, op_code, data)
Send match data for the current user.

Parameters:

  • match_id The match id string.
  • op_code The op_code number.
  • data The data string.

Returns:

    The result of match_data_send.
create_status_follow_message (user_ids)
Subscribe the current user to follow another user's status updates.

Parameters:

  • user_ids The user id string to follow.

Returns:

    The result of status_follow.
create_status_unfollow_message (user_ids)
Unsubscribe the current user from following another user's status updates.

Parameters:

  • user_ids The user id string to unfollow.

Returns:

    The result of status_unfollow.
create_status_update_message (status)
Update the current user's status.

Parameters:

  • status The status update string.

Returns:

    The result of status_update.
create_group_user_list_group_user (state_int, user_api_user)
create_group_user_list_group_user A single user-role pair.

Parameters:

  • state_int
  • user_api_user 'table' (api_user) User.
create_user_group_list_user_group (group_api_group, state_int)
create_user_group_list_user_group A single group-role pair.

Parameters:

  • group_api_group
  • state_int 'number' () The user's relationship to the group.
create_write_leaderboard_record_request_leaderboard_record_write (metadata_str, operator_api_operator, score_str, subscore_str)
create_write_leaderboard_record_request_leaderboard_record_write Record values to write.

Parameters:

  • metadata_str
  • operator_api_operator
  • score_str
  • subscore_str 'string' () An optional secondary value.
create_write_tournament_record_request_tournament_record_write (metadata_str, operator_api_operator, score_str, subscore_str)
create_write_tournament_record_request_tournament_record_write Record values to write.

Parameters:

  • metadata_str
  • operator_api_operator
  • score_str
  • subscore_str 'string' () An optional secondary value.
create_api_account (custom_id_str, devices_arr, disable_time_str, email_str, user_api_user, verify_time_str, wallet_str)
create_api_account A user with additional account details. Always the current user.

Parameters:

  • custom_id_str
  • devices_arr
  • disable_time_str
  • email_str
  • user_api_user
  • verify_time_str
  • wallet_str 'string' () The user's wallet data.
create_api_account_apple (token_str, vars_obj)
create_api_account_apple Send a Apple Sign In token to the server. Used with authenticate/link/unlink.

Parameters:

  • token_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_account_custom (id_str, vars_obj)
create_api_account_custom Send a custom ID to the server. Used with authenticate/link/unlink.

Parameters:

  • id_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_account_device (id_str, vars_obj)
create_api_account_device Send a device to the server. Used with authenticate/link/unlink and user.

Parameters:

  • id_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_account_email (email_str, password_str, vars_obj)
create_api_account_email Send an email with password to the server. Used with authenticate/link/unlink.

Parameters:

  • email_str
  • password_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_account_facebook (token_str, vars_obj)
create_api_account_facebook Send a Facebook token to the server. Used with authenticate/link/unlink.

Parameters:

  • token_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_account_facebook_instant_game (signed_player_info_str, vars_obj)
create_api_account_facebook_instant_game Send a Facebook Instant Game token to the server. Used with authenticate/link/unlink.

Parameters:

  • signed_player_info_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_account_game_center (bundle_id_str, player_id_str, public_key_url_str, salt_str, signature_str, timestamp_seconds_str, vars_obj)
create_api_account_game_center Send Apple's Game Center account credentials to the server. Used with authenticate/link/unlink.

Parameters:

  • bundle_id_str
  • player_id_str
  • public_key_url_str
  • salt_str
  • signature_str
  • timestamp_seconds_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_account_google (token_str, vars_obj)
create_api_account_google Send a Google token to the server. Used with authenticate/link/unlink.

Parameters:

  • token_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_account_steam (token_str, vars_obj)
create_api_account_steam Send a Steam token to the server. Used with authenticate/link/unlink.

Parameters:

  • token_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_channel_message (channel_id_str, code_int, content_str, create_time_str, group_id_str, message_id_str, persistent_bool, room_name_str, sender_id_str, update_time_str, user_id_one_str, user_id_two_str, username_str)
create_api_channel_message A message sent on a channel.

Parameters:

  • channel_id_str
  • code_int
  • content_str
  • create_time_str
  • group_id_str
  • message_id_str
  • persistent_bool
  • room_name_str
  • sender_id_str
  • update_time_str
  • user_id_one_str
  • user_id_two_str
  • username_str 'string' () The username of the message sender, if any.
create_api_channel_message_list (cacheable_cursor_str, messages_arr, next_cursor_str, prev_cursor_str)
create_api_channel_message_list A list of channel messages, usually a result of a list operation.

Parameters:

  • cacheable_cursor_str
  • messages_arr
  • next_cursor_str
  • prev_cursor_str 'string' () The cursor to send when retrieving the previous page, if any.
create_api_create_group_request (avatar_url_str, description_str, lang_tag_str, max_count_int, name_str, open_bool)
create_api_create_group_request Create a group with the current user as owner.

Parameters:

  • avatar_url_str
  • description_str
  • lang_tag_str
  • max_count_int
  • name_str
  • open_bool 'boolean' () Mark a group as open or not where only admins can accept members.
create_api_delete_storage_object_id (collection_str, key_str, version_str)
create_api_delete_storage_object_id Storage objects to delete.

Parameters:

  • collection_str
  • key_str
  • version_str 'string' () The version hash of the object.
create_api_delete_storage_objects_request (object_ids_arr)
create_api_delete_storage_objects_request Batch delete storage objects.

Parameters:

  • object_ids_arr 'table' () Batch of storage objects.
create_api_event (external_bool, name_str, properties_obj, timestamp_str)
create_api_event Represents an event to be passed through the server to registered event handlers.

Parameters:

  • external_bool
  • name_str
  • properties_obj
  • timestamp_str 'string' () The time when the event was triggered.
create_api_friend (state_int, update_time_str, user_api_user)
create_api_friend A friend of a user.

Parameters:

  • state_int
  • update_time_str
  • user_api_user 'table' (api_user) The user object.
create_api_friend_list (cursor_str, friends_arr)
create_api_friend_list A collection of zero or more friends of the user.

Parameters:

  • cursor_str
  • friends_arr 'table' () The Friend objects.
create_api_group (avatar_url_str, create_time_str, creator_id_str, description_str, edge_count_int, id_str, lang_tag_str, max_count_int, metadata_str, name_str, open_bool, update_time_str)
create_api_group A group in the server.

Parameters:

  • avatar_url_str
  • create_time_str
  • creator_id_str
  • description_str
  • edge_count_int
  • id_str
  • lang_tag_str
  • max_count_int
  • metadata_str
  • name_str
  • open_bool
  • update_time_str 'string' () The UNIX time when the group was last updated.
create_api_group_list (cursor_str, groups_arr)
create_api_group_list One or more groups returned from a listing operation.

Parameters:

  • cursor_str
  • groups_arr 'table' () One or more groups.
create_api_group_user_list (cursor_str, group_users_arr)
create_api_group_user_list A list of users belonging to a group, along with their role.

Parameters:

  • cursor_str
  • group_users_arr 'table' () User-role pairs for a group.
create_api_leaderboard_record (create_time_str, expiry_time_str, leaderboard_id_str, max_num_score_int, metadata_str, num_score_int, owner_id_str, rank_str, score_str, subscore_str, update_time_str, username_str)
create_api_leaderboard_record Represents a complete leaderboard record with all scores and associated metadata.

Parameters:

  • create_time_str
  • expiry_time_str
  • leaderboard_id_str
  • max_num_score_int
  • metadata_str
  • num_score_int
  • owner_id_str
  • rank_str
  • score_str
  • subscore_str
  • update_time_str
  • username_str 'string' () The username of the score owner, if the owner is a user.
create_api_leaderboard_record_list (next_cursor_str, owner_records_arr, prev_cursor_str, records_arr)
create_api_leaderboard_record_list A set of leaderboard records, may be part of a leaderboard records page or a batch of individual records.

Parameters:

  • next_cursor_str
  • owner_records_arr
  • prev_cursor_str
  • records_arr 'table' () A list of leaderboard records.
create_api_link_steam_request (account_api_account_steam, sync_bool)
create_api_link_steam_request Link Steam to the current user's account.

Parameters:

  • account_api_account_steam
  • sync_bool 'boolean' () Import Steam friends for the user.
create_api_match (authoritative_bool, handler_name_str, label_str, match_id_str, size_int, tick_rate_int)
create_api_match Represents a realtime match.

Parameters:

  • authoritative_bool
  • handler_name_str
  • label_str
  • match_id_str
  • size_int
  • tick_rate_int 'number' ()
create_api_match_list (matches_arr)
create_api_match_list A list of realtime matches.

Parameters:

  • matches_arr 'table' () A number of matches corresponding to a list operation.
create_api_notification (code_int, content_str, create_time_str, id_str, persistent_bool, sender_id_str, subject_str)
create_api_notification A notification in the server.

Parameters:

  • code_int
  • content_str
  • create_time_str
  • id_str
  • persistent_bool
  • sender_id_str
  • subject_str 'string' () Subject of the notification.
create_api_notification_list (cacheable_cursor_str, notifications_arr)
create_api_notification_list A collection of zero or more notifications.

Parameters:

  • cacheable_cursor_str
  • notifications_arr 'table' () Collection of notifications.
create_api_read_storage_object_id (collection_str, key_str, user_id_str)
create_api_read_storage_object_id Storage objects to get.

Parameters:

  • collection_str
  • key_str
  • user_id_str 'string' () The user owner of the object.
create_api_read_storage_objects_request (object_ids_arr)
create_api_read_storage_objects_request Batch get storage objects.

Parameters:

  • object_ids_arr 'table' () Batch of storage objects.
create_api_rpc (http_key_str, id_str, payload_str)
create_api_rpc Execute an Lua function on the server.

Parameters:

  • http_key_str
  • id_str
  • payload_str 'string' () The payload of the function which must be a JSON object.
create_api_session (created_bool, refresh_token_str, token_str)
create_api_session A user's session used to authenticate messages.

Parameters:

  • created_bool
  • refresh_token_str
  • token_str 'string' () Authentication credentials.
create_api_session_logout_request (refresh_token_str, token_str)
create_api_session_logout_request Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user.

Parameters:

  • refresh_token_str
  • token_str 'string' () Session token to log out.
create_api_session_refresh_request (token_str, vars_obj)
create_api_session_refresh_request Authenticate against the server with a refresh token.

Parameters:

  • token_str
  • vars_obj 'table' () Extra information that will be bundled in the session token.
create_api_storage_object (collection_str, create_time_str, key_str, permission_read_int, permission_write_int, update_time_str, user_id_str, value_str, version_str)
create_api_storage_object An object within the storage engine.

Parameters:

  • collection_str
  • create_time_str
  • key_str
  • permission_read_int
  • permission_write_int
  • update_time_str
  • user_id_str
  • value_str
  • version_str 'string' () The version hash of the object.
create_api_storage_object_ack (collection_str, key_str, user_id_str, version_str)
create_api_storage_object_ack A storage acknowledgement.

Parameters:

  • collection_str
  • key_str
  • user_id_str
  • version_str 'string' () The version hash of the object.
create_api_storage_object_acks (acks_arr)
create_api_storage_object_acks Batch of acknowledgements for the storage object write.

Parameters:

  • acks_arr 'table' () Batch of storage write acknowledgements.
create_api_storage_object_list (cursor_str, objects_arr)
create_api_storage_object_list List of storage objects.

Parameters:

  • cursor_str
  • objects_arr 'table' () The list of storage objects.
create_api_storage_objects (objects_arr)
create_api_storage_objects Batch of storage objects.

Parameters:

  • objects_arr 'table' () The batch of storage objects.
create_api_tournament (can_enter_bool, category_int, create_time_str, description_str, duration_int, end_active_int, end_time_str, id_str, max_num_score_int, max_size_int, metadata_str, next_reset_int, operator_api_operator, prev_reset_int, size_int, sort_order_int, start_active_int, start_time_str, title_str)
create_api_tournament A tournament on the server.

Parameters:

  • can_enter_bool
  • category_int
  • create_time_str
  • description_str
  • duration_int
  • end_active_int
  • end_time_str
  • id_str
  • max_num_score_int
  • max_size_int
  • metadata_str
  • next_reset_int
  • operator_api_operator
  • prev_reset_int
  • size_int
  • sort_order_int
  • start_active_int
  • start_time_str
  • title_str 'string' () The title for the tournament.
create_api_tournament_list (cursor_str, tournaments_arr)
create_api_tournament_list A list of tournaments.

Parameters:

  • cursor_str
  • tournaments_arr 'table' () The list of tournaments returned.
create_api_tournament_record_list (next_cursor_str, owner_records_arr, prev_cursor_str, records_arr)
create_api_tournament_record_list A set of tournament records which may be part of a tournament records page or a batch of individual records.

Parameters:

  • next_cursor_str
  • owner_records_arr
  • prev_cursor_str
  • records_arr 'table' () A list of tournament records.
create_api_update_account_request (avatar_url_str, display_name_str, lang_tag_str, location_str, timezone_str, username_str)
create_api_update_account_request Update a user's account details.

Parameters:

  • avatar_url_str
  • display_name_str
  • lang_tag_str
  • location_str
  • timezone_str
  • username_str 'string' () The username of the user's account.
create_api_update_group_request (avatar_url_str, description_str, group_id_str, lang_tag_str, name_str, open_bool)
create_api_update_group_request Update fields in a given group.

Parameters:

  • avatar_url_str
  • description_str
  • group_id_str
  • lang_tag_str
  • name_str
  • open_bool 'boolean' () Open is true if anyone should be allowed to join, or false if joins must be approved by a group admin.
create_api_user (apple_id_str, avatar_url_str, create_time_str, display_name_str, edge_count_int, facebook_id_str, facebook_instant_game_id_str, gamecenter_id_str, google_id_str, id_str, lang_tag_str, location_str, metadata_str, online_bool, steam_id_str, timezone_str, update_time_str, username_str)
create_api_user A user in the server.

Parameters:

  • apple_id_str
  • avatar_url_str
  • create_time_str
  • display_name_str
  • edge_count_int
  • facebook_id_str
  • facebook_instant_game_id_str
  • gamecenter_id_str
  • google_id_str
  • id_str
  • lang_tag_str
  • location_str
  • metadata_str
  • online_bool
  • steam_id_str
  • timezone_str
  • update_time_str
  • username_str 'string' () The username of the user's account.
create_api_user_group_list (cursor_str, user_groups_arr)
create_api_user_group_list A list of groups belonging to a user, along with the user's role in each group.

Parameters:

  • cursor_str
  • user_groups_arr 'table' () Group-role pairs for a user.
create_api_users (users_arr)
create_api_users A collection of zero or more users.

Parameters:

  • users_arr 'table' () The User objects.
create_api_validate_purchase_apple_request (receipt_str)
create_api_validate_purchase_apple_request

Parameters:

  • receipt_str 'string' () Base64 encoded Apple receipt data payload.
create_api_validate_purchase_google_request (purchase_str)
create_api_validate_purchase_google_request

Parameters:

  • purchase_str 'string' () JSON encoded Google purchase payload.
create_api_validate_purchase_huawei_request (purchase_str, signature_str)
create_api_validate_purchase_huawei_request

Parameters:

  • purchase_str
  • signature_str 'string' () InAppPurchaseData signature.
create_api_validate_purchase_response (validated_purchases_arr)
create_api_validate_purchase_response

Parameters:

  • validated_purchases_arr 'table' () Newly seen validated purchases.
create_api_validated_purchase (create_time_str, environment_validated_purchase_environment, product_id_str, provider_response_str, purchase_time_str, store_validated_purchase_store, transaction_id_str, update_time_str)
create_api_validated_purchase Validated Purchase stored by Nakama.

Parameters:

  • create_time_str
  • environment_validated_purchase_environment
  • product_id_str
  • provider_response_str
  • purchase_time_str
  • store_validated_purchase_store
  • transaction_id_str
  • update_time_str 'string' () UNIX Timestamp when the receipt validation was updated in DB.
create_api_write_storage_object (collection_str, key_str, permission_read_int, permission_write_int, value_str, version_str)
create_api_write_storage_object The object to store.

Parameters:

create_api_write_storage_objects_request (objects_arr)
create_api_write_storage_objects_request Write objects to the storage engine.

Parameters:

  • objects_arr 'table' () The objects to store on the server.
create_protobuf_any (type_url_str, value_str)
create_protobuf_any

Parameters:

  • type_url_str
  • value_str 'string' ()
create_rpc_status (code_int, details_arr, message_str)
create_rpc_status

Parameters:

  • code_int
  • details_arr
  • message_str 'string' ()
create_client (config)
Create a Nakama client instance.

Parameters:

  • config A table of configuration options. config.engine - Engine specific implementations. config.host config.port config.timeout config.use_ssl - Use secure or non-secure sockets. config.bearer_token config.username config.password

Returns:

    Nakama Client instance.
on_notification (socket, fn)
On notification hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_matchdata (socket, fn)
On match data hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_matchpresence (socket, fn)
On match presence hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_matchmakermatched (socket, fn)
On matchmaker matched hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_statuspresence (socket, fn)
On status presence hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_streampresence (socket, fn)
On stream presence hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_streamdata (socket, fn)
On stream data hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_channelmessage (socket, fn)
On channel message hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_channelpresence (socket, fn)
On channel presence hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_disconnect (socket, fn)
On disconnect hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
create_socket (client)
Create a Nakama socket.

Parameters:

  • client The client to create the socket for.

Returns:

    Socket instance.
socket_connect (socket, callback)
Attempt to connect a Nakama socket to the server.

Parameters:

  • socket The client socket to connect (from call to create_socket).
  • callback Optional callback to invoke with the result.

Returns:

    If no callback is provided the function returns the result.
socket_send (socket, message, callback)
Send message on Nakama socket.

Parameters:

  • socket The client socket to use when sending the message.
  • message The messaage string.
  • callback Optional callback to invoke with the result.

Returns:

    If no callback is provided the function returns the result.
set_bearer_token (client, bearer_token)
Set Nakama client bearer token.

Parameters:

  • client Nakama client.
  • bearer_token Authorization bearer token.
healthcheck (client, callback)
healthcheck A healthcheck which load balancers can use to check the service.

Parameters:

  • client Nakama client.
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
get_account (client, callback)
get_account Fetch the current user's account.

Parameters:

  • client Nakama client.
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
update_account (client, body_api_update_account_request, callback)
update_account Update fields in the current user's account.

Parameters:

  • client Nakama client.
  • body_api_update_account_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_apple (client, body_api_account_apple, create_bool, username_str, callback)
authenticate_apple Authenticate a user with an Apple ID against the server.

Parameters:

  • client Nakama client.
  • body_api_account_apple (table) The Apple account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_custom (client, body_api_account_custom, create_bool, username_str, callback)
authenticate_custom Authenticate a user with a custom id against the server.

Parameters:

  • client Nakama client.
  • body_api_account_custom (table) The custom account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_device (client, body_api_account_device, create_bool, username_str, callback)
authenticate_device Authenticate a user with a device id against the server.

Parameters:

  • client Nakama client.
  • body_api_account_device (table) The device account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_email (client, body_api_account_email, create_bool, username_str, callback)
authenticate_email Authenticate a user with an email+password against the server.

Parameters:

  • client Nakama client.
  • body_api_account_email (table) The email account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_facebook (client, body_api_account_facebook, create_bool, username_str, sync_bool, callback)
authenticate_facebook Authenticate a user with a Facebook OAuth token against the server.

Parameters:

  • client Nakama client.
  • body_api_account_facebook (table) The Facebook account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • sync_bool (boolean) Import Facebook friends for the user..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_facebook_instant_game (client, body_api_account_facebook_instant_game, create_bool, username_str, callback)
authenticate_facebook_instant_game Authenticate a user with a Facebook Instant Game token against the server.

Parameters:

  • client Nakama client.
  • body_api_account_facebook_instant_game (table) The Facebook Instant Game account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_game_center (client, body_api_account_game_center, create_bool, username_str, callback)
authenticate_game_center Authenticate a user with Apple's GameCenter against the server.

Parameters:

  • client Nakama client.
  • body_api_account_game_center (table) The Game Center account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_google (client, body_api_account_google, create_bool, username_str, callback)
authenticate_google Authenticate a user with Google against the server.

Parameters:

  • client Nakama client.
  • body_api_account_google (table) The Google account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
authenticate_steam (client, body_api_account_steam, create_bool, username_str, sync_bool, callback)
authenticate_steam Authenticate a user with Steam against the server.

Parameters:

  • client Nakama client.
  • body_api_account_steam (table) The Steam account details..
  • create_bool (boolean) Register the account if the user does not already exist..
  • username_str (string) Set the username on the account at register. Must be unique..
  • sync_bool (boolean) Import Steam friends for the user..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_apple (client, body_api_account_apple, callback)
link_apple Add an Apple ID to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_apple (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_custom (client, body_api_account_custom, callback)
link_custom Add a custom ID to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_custom (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_device (client, body_api_account_device, callback)
link_device Add a device ID to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_device (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_email (client, body_api_account_email, callback)
link_email Add an email+password to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_email (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_facebook (client, body_api_account_facebook, sync_bool, callback)
link_facebook Add Facebook to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_facebook (table) The Facebook account details..
  • sync_bool (boolean) Import Facebook friends for the user..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_facebook_instant_game (client, body_api_account_facebook_instant_game, callback)
link_facebook_instant_game Add Facebook Instant Game to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_facebook_instant_game (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_game_center (client, body_api_account_game_center, callback)
link_game_center Add Apple's GameCenter to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_game_center (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_google (client, body_api_account_google, callback)
link_google Add Google to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_google (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
link_steam (client, body_api_link_steam_request, callback)
link_steam Add Steam to the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_link_steam_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
session_refresh (client, body_api_session_refresh_request, callback)
session_refresh Refresh a user's session using a refresh token retrieved from a previous authentication request.

Parameters:

  • client Nakama client.
  • body_api_session_refresh_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_apple (client, body_api_account_apple, callback)
unlink_apple Remove the Apple ID from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_apple (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_custom (client, body_api_account_custom, callback)
unlink_custom Remove the custom ID from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_custom (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_device (client, body_api_account_device, callback)
unlink_device Remove the device ID from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_device (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_email (client, body_api_account_email, callback)
unlink_email Remove the email+password from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_email (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_facebook (client, body_api_account_facebook, callback)
unlink_facebook Remove Facebook from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_facebook (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_facebook_instant_game (client, body_api_account_facebook_instant_game, callback)
unlink_facebook_instant_game Remove Facebook Instant Game profile from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_facebook_instant_game (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_game_center (client, body_api_account_game_center, callback)
unlink_game_center Remove Apple's GameCenter from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_game_center (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_google (client, body_api_account_google, callback)
unlink_google Remove Google from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_google (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
unlink_steam (client, body_api_account_steam, callback)
unlink_steam Remove Steam from the social profiles on the current user's account.

Parameters:

  • client Nakama client.
  • body_api_account_steam (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_channel_messages (client, channel_id_str, limit_int, forward_bool, cursor_str, callback)
list_channel_messages List a channel's message history.

Parameters:

  • client Nakama client.
  • channel_id_str (string) The channel ID to list from..
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • forward_bool (boolean) True if listing should be older messages to newer, false if reverse..
  • cursor_str (string) A pagination cursor, if any..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
event (client, body_api_event, callback)
event Submit an event for processing in the server's registered runtime custom events handler.

Parameters:

  • client Nakama client.
  • body_api_event (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
delete_friends (client, ids_arr, usernames_arr, callback)
delete_friends Delete one or more users by ID or username.

Parameters:

  • client Nakama client.
  • ids_arr (table) The account id of a user..
  • usernames_arr (table) The account username of a user..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_friends (client, limit_int, state_int, cursor_str, callback)
list_friends List all friends for the current user.

Parameters:

  • client Nakama client.
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • state_int (number) The friend state to list..
  • cursor_str (string) An optional next page cursor..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
add_friends (client, ids_arr, usernames_arr, callback)
add_friends Add friends by ID or username to a user's account.

Parameters:

  • client Nakama client.
  • ids_arr (table) The account id of a user..
  • usernames_arr (table) The account username of a user..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
block_friends (client, ids_arr, usernames_arr, callback)
block_friends Block one or more users by ID or username.

Parameters:

  • client Nakama client.
  • ids_arr (table) The account id of a user..
  • usernames_arr (table) The account username of a user..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
import_facebook_friends (client, body_api_account_facebook, reset_bool, callback)
import_facebook_friends Import Facebook friends and add them to a user's account.

Parameters:

  • client Nakama client.
  • body_api_account_facebook (table) The Facebook account details..
  • reset_bool (boolean) Reset the current user's friends list..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
import_steam_friends (client, body_api_account_steam, reset_bool, callback)
import_steam_friends Import Steam friends and add them to a user's account.

Parameters:

  • client Nakama client.
  • body_api_account_steam (table) The Facebook account details..
  • reset_bool (boolean) Reset the current user's friends list..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_groups (client, name_str, cursor_str, limit_int, lang_tag_str, members_int, open_bool, callback)
list_groups List groups based on given filters.

Parameters:

  • client Nakama client.
  • name_str (string) List groups that contain this value in their names..
  • cursor_str (string) Optional pagination cursor..
  • limit_int (number) Max number of groups to return. Between 1 and 100..
  • lang_tag_str (string) Language tag filter..
  • members_int (number) Number of group members..
  • open_bool (boolean) Optional Open/Closed filter..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
create_group (client, body_api_create_group_request, callback)
create_group Create a new group with the current user as the owner.

Parameters:

  • client Nakama client.
  • body_api_create_group_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
delete_group (client, group_id_str, callback)
delete_group Delete a group by ID.

Parameters:

  • client Nakama client.
  • group_id_str (string) The id of a group..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
update_group (client, group_id_str, body_api_update_group_request, callback)
update_group Update fields in a given group.

Parameters:

  • client Nakama client.
  • group_id_str (string) The ID of the group to update..
  • body_api_update_group_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
add_group_users (client, group_id_str, user_ids_arr, callback)
add_group_users Add users to a group.

Parameters:

  • client Nakama client.
  • group_id_str (string) The group to add users to..
  • user_ids_arr (table) The users to add..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
ban_group_users (client, group_id_str, user_ids_arr, callback)
ban_group_users Ban a set of users from a group.

Parameters:

  • client Nakama client.
  • group_id_str (string) The group to ban users from..
  • user_ids_arr (table) The users to ban..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
demote_group_users (client, group_id_str, user_ids_arr, callback)
demote_group_users Demote a set of users in a group to the next role down.

Parameters:

  • client Nakama client.
  • group_id_str (string) The group ID to demote in..
  • user_ids_arr (table) The users to demote..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
join_group (client, group_id_str, callback)
join_group Immediately join an open group, or request to join a closed one.

Parameters:

  • client Nakama client.
  • group_id_str (string) The group ID to join. The group must already exist..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
kick_group_users (client, group_id_str, user_ids_arr, callback)
kick_group_users Kick a set of users from a group.

Parameters:

  • client Nakama client.
  • group_id_str (string) The group ID to kick from..
  • user_ids_arr (table) The users to kick..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
leave_group (client, group_id_str, callback)
leave_group Leave a group the user is a member of.

Parameters:

  • client Nakama client.
  • group_id_str (string) The group ID to leave..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
promote_group_users (client, group_id_str, user_ids_arr, callback)
promote_group_users Promote a set of users in a group to the next role up.

Parameters:

  • client Nakama client.
  • group_id_str (string) The group ID to promote in..
  • user_ids_arr (table) The users to promote..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_group_users (client, group_id_str, limit_int, state_int, cursor_str, callback)
list_group_users List all users that are part of a group.

Parameters:

  • client Nakama client.
  • group_id_str (string) The group ID to list from..
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • state_int (number) The group user state to list..
  • cursor_str (string) An optional next page cursor..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
validate_purchase_apple (client, body_api_validate_purchase_apple_request, callback)
validate_purchase_apple Validate Apple IAP Receipt

Parameters:

  • client Nakama client.
  • body_api_validate_purchase_apple_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
validate_purchase_google (client, body_api_validate_purchase_google_request, callback)
validate_purchase_google Validate Google IAP Receipt

Parameters:

  • client Nakama client.
  • body_api_validate_purchase_google_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
validate_purchase_huawei (client, body_api_validate_purchase_huawei_request, callback)
validate_purchase_huawei Validate Huawei IAP Receipt

Parameters:

  • client Nakama client.
  • body_api_validate_purchase_huawei_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
delete_leaderboard_record (client, leaderboard_id_str, callback)
delete_leaderboard_record Delete a leaderboard record.

Parameters:

  • client Nakama client.
  • leaderboard_id_str (string) The leaderboard ID to delete from..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_leaderboard_records (client, leaderboard_id_str, owner_ids_arr, limit_int, cursor_str, expiry_str, callback)
list_leaderboard_records List leaderboard records.

Parameters:

  • client Nakama client.
  • leaderboard_id_str (string) The ID of the leaderboard to list for..
  • owner_ids_arr (table) One or more owners to retrieve records for..
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • cursor_str (string) A next or previous page cursor..
  • expiry_str (string) Expiry in seconds (since epoch) to begin fetching records from. Optional. 0 means from current time..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
write_leaderboard_record (client, leaderboard_id_str, body_write_leaderboard_record_request_leaderboard_record_write, callback)
write_leaderboard_record Write a record to a leaderboard.

Parameters:

  • client Nakama client.
  • leaderboard_id_str (string) The ID of the leaderboard to write to..
  • body_write_leaderboard_record_request_leaderboard_record_write (table) Record input..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_leaderboard_records_around_owner (client, leaderboard_id_str, owner_id_str, limit_int, expiry_str, callback)
list_leaderboard_records_around_owner List leaderboard records that belong to a user.

Parameters:

  • client Nakama client.
  • leaderboard_id_str (string) The ID of the tournament to list for..
  • owner_id_str (string) The owner to retrieve records around..
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • expiry_str (string) Expiry in seconds (since epoch) to begin fetching records from..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_matches (client, limit_int, authoritative_bool, label_str, min_size_int, max_size_int, query_str, callback)
list_matches Fetch list of running matches.

Parameters:

  • client Nakama client.
  • limit_int (number) Limit the number of returned matches..
  • authoritative_bool (boolean) Authoritative or relayed matches..
  • label_str (string) Label filter..
  • min_size_int (number) Minimum user count..
  • max_size_int (number) Maximum user count..
  • query_str (string) Arbitrary label query..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
delete_notifications (client, ids_arr, callback)
delete_notifications Delete one or more notifications for the current user.

Parameters:

  • client Nakama client.
  • ids_arr (table) The id of notifications..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_notifications (client, limit_int, cacheable_cursor_str, callback)
list_notifications Fetch list of notifications.

Parameters:

  • client Nakama client.
  • limit_int (number) The number of notifications to get. Between 1 and 100..
  • cacheable_cursor_str (string) A cursor to page through notifications. May be cached by clients to get from point in time forwards..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
rpc_func2 (client, id_str, payload_str, http_key_str, callback)
rpc_func2 Execute a Lua function on the server.

Parameters:

  • client Nakama client.
  • id_str (string) The identifier of the function..
  • payload_str (string) The payload of the function which must be a JSON object..
  • http_key_str (string) The authentication key used when executed as a non-client HTTP request..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
rpc_func (client, id_str, body_, http_key_str, callback)
rpc_func Execute a Lua function on the server.

Parameters:

  • client Nakama client.
  • id_str (string) The identifier of the function..
  • body_ (table) The payload of the function which must be a JSON object..
  • http_key_str (string) The authentication key used when executed as a non-client HTTP request..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
session_logout (client, body_api_session_logout_request, callback)
session_logout Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user.

Parameters:

  • client Nakama client.
  • body_api_session_logout_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
read_storage_objects (client, body_api_read_storage_objects_request, callback)
read_storage_objects Get storage objects.

Parameters:

  • client Nakama client.
  • body_api_read_storage_objects_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
write_storage_objects (client, body_api_write_storage_objects_request, callback)
write_storage_objects Write objects into the storage engine.

Parameters:

  • client Nakama client.
  • body_api_write_storage_objects_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
delete_storage_objects (client, body_api_delete_storage_objects_request, callback)
delete_storage_objects Delete one or more objects by ID or username.

Parameters:

  • client Nakama client.
  • body_api_delete_storage_objects_request (table) .
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_storage_objects (client, collection_str, user_id_str, limit_int, cursor_str, callback)
list_storage_objects List publicly readable storage objects in a given collection.

Parameters:

  • client Nakama client.
  • collection_str (string) The collection which stores the object..
  • user_id_str (string) ID of the user..
  • limit_int (number) The number of storage objects to list. Between 1 and 100..
  • cursor_str (string) The cursor to page through results from..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_storage_objects2 (client, collection_str, user_id_str, limit_int, cursor_str, callback)
list_storage_objects2 List publicly readable storage objects in a given collection.

Parameters:

  • client Nakama client.
  • collection_str (string) The collection which stores the object..
  • user_id_str (string) ID of the user..
  • limit_int (number) The number of storage objects to list. Between 1 and 100..
  • cursor_str (string) The cursor to page through results from..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_tournaments (client, category_start_int, category_end_int, start_time_int, end_time_int, limit_int, cursor_str, callback)
list_tournaments List current or upcoming tournaments.

Parameters:

  • client Nakama client.
  • category_start_int (number) The start of the categories to include. Defaults to 0..
  • category_end_int (number) The end of the categories to include. Defaults to 128..
  • start_time_int (number) The start time for tournaments. Defaults to epoch..
  • end_time_int (number) The end time for tournaments. Defaults to +1 year from current Unix time..
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • cursor_str (string) A next page cursor for listings (optional)..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_tournament_records (client, tournament_id_str, owner_ids_arr, limit_int, cursor_str, expiry_str, callback)
list_tournament_records List tournament records.

Parameters:

  • client Nakama client.
  • tournament_id_str (string) The ID of the tournament to list for..
  • owner_ids_arr (table) One or more owners to retrieve records for..
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • cursor_str (string) A next or previous page cursor..
  • expiry_str (string) Expiry in seconds (since epoch) to begin fetching records from..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
write_tournament_record2 (client, tournament_id_str, body_write_tournament_record_request_tournament_record_write, callback)
write_tournament_record2 Write a record to a tournament.

Parameters:

  • client Nakama client.
  • tournament_id_str (string) The tournament ID to write the record for..
  • body_write_tournament_record_request_tournament_record_write (table) Record input..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
write_tournament_record (client, tournament_id_str, body_write_tournament_record_request_tournament_record_write, callback)
write_tournament_record Write a record to a tournament.

Parameters:

  • client Nakama client.
  • tournament_id_str (string) The tournament ID to write the record for..
  • body_write_tournament_record_request_tournament_record_write (table) Record input..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
join_tournament (client, tournament_id_str, callback)
join_tournament Attempt to join an open and running tournament.

Parameters:

  • client Nakama client.
  • tournament_id_str (string) The ID of the tournament to join. The tournament must already exist..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_tournament_records_around_owner (client, tournament_id_str, owner_id_str, limit_int, expiry_str, callback)
list_tournament_records_around_owner List tournament records for a given owner.

Parameters:

  • client Nakama client.
  • tournament_id_str (string) The ID of the tournament to list for..
  • owner_id_str (string) The owner to retrieve records around..
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • expiry_str (string) Expiry in seconds (since epoch) to begin fetching records from..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
get_users (client, ids_arr, usernames_arr, facebook_ids_arr, callback)
get_users Fetch zero or more users by ID and/or username.

Parameters:

  • client Nakama client.
  • ids_arr (table) The account id of a user..
  • usernames_arr (table) The account username of a user..
  • facebook_ids_arr (table) The Facebook ID of a user..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.
list_user_groups (client, user_id_str, limit_int, state_int, cursor_str, callback)
list_user_groups List groups the current user belongs to.

Parameters:

  • client Nakama client.
  • user_id_str (string) ID of the user..
  • limit_int (number) Max number of records to return. Between 1 and 100..
  • state_int (number) The user group state to list..
  • cursor_str (string) An optional next page cursor..
  • callback Optional callback function. A coroutine is used and the result returned if no function is provided.

Returns:

    The result.

Fields

VALIDATEDPURCHASEENVIRONMENT_UNKNOWN
validated_purchase_environment - UNKNOWN: Unknown environment. - SANDBOX: Sandbox/test environment. - PRODUCTION: Production environment.
VALIDATEDPURCHASESTORE_APPLE_APP_STORE
validated_purchase_store - APPLE_APP_STORE: Apple App Store - GOOGLE_PLAY_STORE: Google Play Store - HUAWEI_APP_GALLERY: Huawei App Gallery
APIOPERATOR_NO_OVERRIDE
api_operator Operator that can be used to override the one set in the leaderboard.

- NO_OVERRIDE: Do not override the leaderboard operator. - BEST: Override the leaderboard operator with BEST. - SET: Override the leaderboard operator with SET. - INCREMENT: Override the leaderboard operator with INCREMENT. - DECREMENT: Override the leaderboard operator with DECREMENT.

generated by LDoc 1.4.6 Last updated 2021-11-05 15:42:41