Module nakama.socket

Manage sockets

Functions

connect (socket, callback) Attempt to connect a Nakama socket to the server.
disconnect (socket) Disconnect a Nakama socket from the server.
send (socket, message, callback) Send message on Nakama socket.
on_disconnect (socket, fn) On disconnect hook.
channel_leave (socket, channel_id, callback) channel_leave
channel_message_send (socket, channel_id, content, callback) channel_message_send
channel_message_remove (socket, channel_id, message_id, callback) channel_message_remove
channel_message_update (socket, channel_id, message_id, content, callback) channel_message_update
match_data_send (socket, match_id, op_code, data, presences, reliable, callback) match_data_send
match_create (socket, name, callback) match_create
match_join (socket, match_id, token, metadata, callback) match_join
match_leave (socket, match_id, callback) match_leave
matchmaker_add (socket, min_count, max_count, query, string_properties, numeric_properties, count_multiple, callback) matchmaker_add
matchmaker_remove (socket, ticket, callback) matchmaker_remove
party_create (socket, open, max_size, callback) party_create
party_join (socket, party_id, callback) party_join
party_leave (socket, party_id, callback) party_leave
party_promote (socket, party_id, presence, callback) party_promote
party_accept (socket, party_id, presence, callback) party_accept
party_remove (socket, party_id, presence, callback) party_remove
party_close (socket, party_id, callback) party_close
party_join_request_list (socket, party_id, callback) party_join_request_list
party_matchmaker_add (socket, party_id, min_count, max_count, query, string_properties, numeric_properties, count_multiple, callback) party_matchmaker_add
party_matchmaker_remove (socket, party_id, ticket, callback) party_matchmaker_remove
party_data_send (socket, party_id, op_code, data, callback) party_data_send
status_follow (socket, user_ids, usernames, callback) status_follow
status_unfollow (socket, user_ids, callback) status_unfollow
status_update (socket, status, callback) status_update
on_channel_presence_event (socket, fn) on_channel_presence_event
on_match_presence_event (socket, fn) on_match_presence_event
on_match_data (socket, fn) on_match_data
on_match (socket, fn) on_match
on_matchmaker_matched (socket, fn) on_matchmaker_matched
on_notifications (socket, fn) on_notifications
on_party_presence_event (socket, fn) on_party_presence_event
on_party (socket, fn) on_party
on_party_data (socket, fn) on_party_data
on_party_join_request (socket, fn) on_party_join_request
on_party_leader (socket, fn) on_party_leader
on_status_presence_event (socket, fn) on_status_presence_event
on_status (socket, fn) on_status
on_stream_data (socket, fn) on_stream_data
on_error (socket, fn) on_error
on_channel_message (socket, fn) on_channel_message


Functions

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.
disconnect (socket)
Disconnect a Nakama socket from the server.

Parameters:

  • socket The client socket to disconnect (from call to create_socket).
send (socket, message, callback)
Send message on Nakama socket.

Parameters:

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

Returns:

    If no callback is provided the function returns the result.
on_disconnect (socket, fn)
On disconnect hook.

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
channel_leave (socket, channel_id, callback)
channel_leave

Parameters:

  • socket
  • channel_id
  • callback
channel_message_send (socket, channel_id, content, callback)
channel_message_send

Parameters:

  • socket
  • channel_id
  • content
  • callback
channel_message_remove (socket, channel_id, message_id, callback)
channel_message_remove

Parameters:

  • socket
  • channel_id
  • message_id
  • callback
channel_message_update (socket, channel_id, message_id, content, callback)
channel_message_update

Parameters:

  • socket
  • channel_id
  • message_id
  • content
  • callback
match_data_send (socket, match_id, op_code, data, presences, reliable, callback)
match_data_send

Parameters:

  • socket
  • match_id
  • op_code
  • data
  • presences
  • reliable
  • callback
match_create (socket, name, callback)
match_create

Parameters:

  • socket
  • name
  • callback
match_join (socket, match_id, token, metadata, callback)
match_join

Parameters:

  • socket
  • match_id
  • token
  • metadata
  • callback
match_leave (socket, match_id, callback)
match_leave

Parameters:

  • socket
  • match_id
  • callback
matchmaker_add (socket, min_count, max_count, query, string_properties, numeric_properties, count_multiple, callback)
matchmaker_add

Parameters:

  • socket
  • min_count
  • max_count
  • query
  • string_properties
  • numeric_properties
  • count_multiple
  • callback
matchmaker_remove (socket, ticket, callback)
matchmaker_remove

Parameters:

  • socket
  • ticket
  • callback
party_create (socket, open, max_size, callback)
party_create

Parameters:

  • socket
  • open
  • max_size
  • callback
party_join (socket, party_id, callback)
party_join

Parameters:

  • socket
  • party_id
  • callback
party_leave (socket, party_id, callback)
party_leave

Parameters:

  • socket
  • party_id
  • callback
party_promote (socket, party_id, presence, callback)
party_promote

Parameters:

  • socket
  • party_id
  • presence
  • callback
party_accept (socket, party_id, presence, callback)
party_accept

Parameters:

  • socket
  • party_id
  • presence
  • callback
party_remove (socket, party_id, presence, callback)
party_remove

Parameters:

  • socket
  • party_id
  • presence
  • callback
party_close (socket, party_id, callback)
party_close

Parameters:

  • socket
  • party_id
  • callback
party_join_request_list (socket, party_id, callback)
party_join_request_list

Parameters:

  • socket
  • party_id
  • callback
party_matchmaker_add (socket, party_id, min_count, max_count, query, string_properties, numeric_properties, count_multiple, callback)
party_matchmaker_add

Parameters:

  • socket
  • party_id
  • min_count
  • max_count
  • query
  • string_properties
  • numeric_properties
  • count_multiple
  • callback
party_matchmaker_remove (socket, party_id, ticket, callback)
party_matchmaker_remove

Parameters:

  • socket
  • party_id
  • ticket
  • callback
party_data_send (socket, party_id, op_code, data, callback)
party_data_send

Parameters:

  • socket
  • party_id
  • op_code
  • data
  • callback
status_follow (socket, user_ids, usernames, callback)
status_follow

Parameters:

  • socket
  • user_ids
  • usernames
  • callback
status_unfollow (socket, user_ids, callback)
status_unfollow

Parameters:

  • socket
  • user_ids
  • callback
status_update (socket, status, callback)
status_update

Parameters:

  • socket
  • status
  • callback
on_channel_presence_event (socket, fn)
on_channel_presence_event

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_match_presence_event (socket, fn)
on_match_presence_event

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_match_data (socket, fn)
on_match_data

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_match (socket, fn)
on_match

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_matchmaker_matched (socket, fn)
on_matchmaker_matched

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_notifications (socket, fn)
on_notifications

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_party_presence_event (socket, fn)
on_party_presence_event

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_party (socket, fn)
on_party

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_party_data (socket, fn)
on_party_data

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_party_join_request (socket, fn)
on_party_join_request

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_party_leader (socket, fn)
on_party_leader

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_status_presence_event (socket, fn)
on_status_presence_event

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_status (socket, fn)
on_status

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_stream_data (socket, fn)
on_stream_data

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_error (socket, fn)
on_error

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
on_channel_message (socket, fn)
on_channel_message

Parameters:

  • socket Nakama Client Socket.
  • fn The callback function.
generated by LDoc 1.5.0 Last updated 2025-10-18 15:04:29