Skip to content

$net

Networking: whether you are the server, and which fields replicate.

203 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).

add_lp2p_friend_history

$net.add_lp2p_friend_history(name: string, key: string, language: string)

Adds a friend key to the play history

ParameterTypeMeaning
namestringThe name of the friend.
keystringThe friend key encoded as a base64 string.
languagestringThe language of the friend.

authenticate

$net.authenticate(user: User, reconnect: bool, platform_only: bool, user_acknowledged: bool, accept_data_transfer: bool)

Authenticate with the Viper online backend.

ParameterTypeMeaning
userUserThe user handle.
reconnectboolAttempt to reconnect to an existing session.
platform_onlyboolOnly sign into the online platform. Don't connect to a backend.
user_acknowledgedboolDid the user acknowledge a sign-in prompt?
accept_data_transferboolAccept data transfer agreement.

authenticate_game_server

$net.authenticate_game_server(reconnect: bool)

Authenticate a game server.

ParameterTypeMeaning
reconnectboolTrue if the game is reconnecting

cache_new_player_matchmaking_history

$net.cache_new_player_matchmaking_history(winning_team_id: int, mvp_user: User)

Stash the new player matchmaking history - should only be called by game servers. Call finalize_game_result to apply the changes.

ParameterTypeMeaning
winning_team_idintThe winning teams id.
mvp_userUserThe user who was the games mvp.

cache_ranked_game_result

$net.cache_ranked_game_result(team_id: int, result: int)

Stash the results of a match - should only be called by game servers. Call finalize_game_result to apply the changes.

ParameterTypeMeaning
team_idintThe team id to update.
resultintThe result of the match - see vonline_match_result_state_t

cache_unranked_game_result

$net.cache_unranked_game_result(winning_id: int, losing_id: int, tie_game: bool, match_start_time: int, match_end_time: int, match_flow_type: int, skill_change_factor: float)

Stash the results of a match - should only be called by game servers. Call finalize_game_result to apply the changes.

ParameterTypeMeaning
winning_idintThe team id of the winning team.
losing_idintThe team id of the losing team.
tie_gameboolTrue if the game was a tie and neither team won/lost.
match_start_timeintThe time the match started in ms.
match_end_timeintThe time the match ended in ms.
match_flow_typeintThe match flow type.
skill_change_factorfloatSkill changes are multiplied by this number to compensate for high team counts

cancel_matchmaking

$net.cancel_matchmaking()

Cancel a request to join an online game through the matchmaking service. Should only be used by internet games.

cancel_replace_dropped_players

$net.cancel_replace_dropped_players()

Cancel a request to replace players who dropped from the game. Should only be called by game servers.

cancel_replace_dropped_players_by_team

$net.cancel_replace_dropped_players_by_team(team_id: int)

Cancel a request to replace players on a given team who dropped from the game. Should only be called by game servers.

ParameterTypeMeaning
team_idintThe team id to add a player to.

crossplay_enabled_for_user

read-only
$net.crossplay_enabled_for_user(user: User) -> bool

Determine if crossplay is enabled for a user on the server.

ParameterTypeMeaning
userUserThe user handle.

Returns bool: True if the user has crossplay enabled

debug_set_utc

read-only
$net.debug_set_utc(utc_s: int)

Set the current time in seconds since 00:00:00 01/01/1970. Use www.epochconverter.com to generate timestamps for features.

ParameterTypeMeaning
utc_sintSeconds since 00:00:00 01/01/1970.

determine_if_crossplay_game

$net.determine_if_crossplay_game() -> bool

Determine if the game on this server is crossplay based on users connected & update vonline.

Returns bool: True if this game has ever been a crossplay game.

disconnect_from_backend

$net.disconnect_from_backend(reason: string)

Disconnect from the Viper online backend.

ParameterTypeMeaning
reasonstringThe reason for disconnecting.

disconnect_from_server

$net.disconnect_from_server() -> bool

Disconnect from the current server - should only be called by clients.

Returns bool: True if we started a server.

dump_unacknowledged_views

read-only
$net.dump_unacknowledged_views(package: Reference)

Dump all replicated entities in a package that have not been acknowledged by all connected users.

ParameterTypeMeaning
packageReferenceReference to package file.

finalize_game_result

$net.finalize_game_result(season: int)

Finalize the results of a match - should only be called by game servers.

ParameterTypeMeaning
seasonintThe current season.

game_server_autodetect_datacenter

read-only
$net.game_server_autodetect_datacenter() -> string

Autodetected cloud datacenter name for the game server.

Returns string: Cloud datacenter name, if available.

game_server_multiplay_id

read-only
$net.game_server_multiplay_id() -> int

The integer server id assigned by Multiplay.

Returns int: The integer server id assigned by Multiplay, if available.

game_server_next_datacenter

read-only
$net.game_server_next_datacenter() -> string

Network Next datacenter name for the game server.

Returns string: Datacenter name, if available.

game_server_uuid

read-only
$net.game_server_uuid() -> string

The UUID for the game server.

Returns string: The UUID for the game server, if available.

get_active_playlists

read-only
$net.get_active_playlists(match_flow: int) -> list

Get a list of all active match_defs.

ParameterTypeMeaning
match_flowintThe match flow to check activity for

Returns list: All active match defs.

get_active_remote_connections

read-only
$net.get_active_remote_connections() -> list

Get a list of indices of all remote connections in the connected state.

Returns list: List of remote connections.

get_all_connections

read-only
$net.get_all_connections() -> list

Get a list of all connection indices, including self.

Returns list: List of all connections.

get_assigned_team

$net.get_assigned_team(user: User) -> int

Get the team for a user. Returns -1 if the team is not found. Server only.

ParameterTypeMeaning
userUserThe user handle.

Returns int: The id for the assigned team.

get_backend_switch

read-only
$net.get_backend_switch(name: string) -> bool

Get a backend switch value.

ParameterTypeMeaning
namestringThe switch name.

Returns bool: Switch value.

get_backend_tunable

read-only
$net.get_backend_tunable(name: string) -> int

Get a backend tunable value.

ParameterTypeMeaning
namestringThe tunable name.

Returns int: Tunable value.

get_backend_tunable_exists

read-only
$net.get_backend_tunable_exists(name: string) -> bool

Determine if a backend tunable has been received.

ParameterTypeMeaning
namestringThe tunable name.

Returns bool: True if the tunable exists, false otherwise.

get_breadcrumb_step

read-only
$net.get_breadcrumb_step(user: User) -> int

Get the persistent value for the user's current breacrumb step

ParameterTypeMeaning
userUserThe local user.

Returns int: Current breadcrumb step.

get_client_reconnect_attempt_limit

read-only
$net.get_client_reconnect_attempt_limit() -> int

Get the number of times a client should attempt to reconnect.

Returns int: The reconnect limit.

get_content_update_download_progress

read-only
$net.get_content_update_download_progress() -> float

Get the progress of the content update download in MB.

Returns float: The progress of the content update download in MB.

get_content_update_download_size

read-only
$net.get_content_update_download_size() -> float

Get the size of the content update download in MB.

Returns float: The size of the content update download in MB.

get_country_code

read-only
$net.get_country_code() -> string

Return the local user's ISO 3166 country code. See https://www.iban.com/country-codes

Returns string: The local user's country code

get_custom_error_message

read-only
$net.get_custom_error_message() -> string

Return the custom error message from the server, if applicable.

Returns string: The custom error message.

get_disable_market_bundles

read-only
$net.get_disable_market_bundles() -> bool

Return whether market bundles are disabled in the UI. This is controlled by a chicken switch on the backend.

Returns bool: Are market bundles disabled?

get_epic_verification_code

read-only
$net.get_epic_verification_code() -> string

Returns a code the user needs to enter to complete Epic authentication.

Returns string: The verification code.

get_epic_verification_expires_seconds

read-only
$net.get_epic_verification_expires_seconds() -> int

Returns the number of seconds remaining to complete verification for Epic authentication.

Returns int: Remaining time in seconds.

get_epic_verification_reason

read-only
$net.get_epic_verification_reason() -> int

Returns the reason for needing to visit an Epic Online Services verification URL.

Returns int: A k_eos_verification_reason_* enum constant.

get_epic_verification_url

read-only
$net.get_epic_verification_url() -> string

Returns the URL the user needs to visit to complete Epic authentication.

Returns string: The URL.

get_epic_verification_url_complete

read-only
$net.get_epic_verification_url_complete() -> string

Returns the URL the user needs to visit to complete Epic authentication, code included.

Returns string: The URL.

get_error_action

read-only
$net.get_error_action() -> int

Return the current error action, or k_online_error_action_none if none.

Returns int: The highest priority error action.

get_error_allocation_id

read-only
$net.get_error_allocation_id() -> string

Get the Multiplay UUID for the game server that was unexpectedly disconnected, if available

Returns string: The string UUID.

get_error_code

read-only
$net.get_error_code() -> int

Return the highest priority error code, or zero if none.

Returns int: The highest priority error code, any non-zero number represents an error.

get_error_level

read-only
$net.get_error_level() -> int

Return the current error level.

Returns int: The highest priority error level.

get_error_server_id

read-only
$net.get_error_server_id() -> int

Get the Multiplay 'server id' for the game server that was unexpectedly disconnected, if available.

Returns int: The integer id.

get_error_system_code

read-only
$net.get_error_system_code() -> int

Return the error code provided by the system library.

Returns int: Error code provided by system library.

get_expected_player_count

read-only
$net.get_expected_player_count() -> int

Get a count of the expected players connecting to this server. Server only.

Returns int: Count of expected players.

get_expected_users

read-only
$net.get_expected_users() -> list

Get a list of users that the game server is expecting to connect. Should only be called by game servers.

Returns list: List of users.

get_ftue_step

read-only
$net.get_ftue_step(user: User) -> int

Get the persistent value for the user's current FTUE step

ParameterTypeMeaning
userUserThe local user.

Returns int: Current FTUE step.

get_game_server_playlist

read-only
$net.get_game_server_playlist(match_defs: list) -> list

Get the match flow and playlist the game server has been configured for.

ParameterTypeMeaning
match_defslistAll available match defs.

Returns list: The match flow and, if valid, the match def, or NULL.

get_inactivity_timeouts

read-only
$net.get_inactivity_timeouts() -> list

Gets the inactivity timeouts from the backend.

Returns list: A list of timeouts.

get_jitter

$net.get_jitter() -> int

Get millisecond jitter value.

Returns int: The latest jitter value in ms.

get_last_netrep_event_client_index

read-only
$net.get_last_netrep_event_client_index() -> int

Get the last client index that sent a netrep event to script, or -1 if outside a netrep event call chain.

Returns int: The client index.

get_local_connection

read-only
$net.get_local_connection() -> int

Get the index of the local network connection.

Returns int: The local client index.

get_local_network_permissions

$net.get_local_network_permissions() -> int

Has permission to access the local network been granted?

Returns int: vsocket_local_network_permission_value_t value

get_lp2p_channel

$net.get_lp2p_channel() -> int

Get the channel being used by this device in LP2P mode

Returns int: Channel, or 0

get_lp2p_comms_age

read-only
$net.get_lp2p_comms_age(user: User) -> int

Find the delta packet counter for a session user.

ParameterTypeMeaning
userUserThe user.

Returns int: How outdated is the roundtrip of our packet counter with a peer.

get_lp2p_game_key

$net.get_lp2p_game_key() -> string

Gets the lp2p game key encoded as base64

Returns string: The game key encoded as base64

get_lp2p_has_group_create_error

read-only
$net.get_lp2p_has_group_create_error() -> bool

Get if the lp2p system currently has an error trying to start the lp2p group.

Returns bool: True if there is an error on group create.

get_lp2p_is_hosting

read-only
$net.get_lp2p_is_hosting() -> bool

Gets if the lp2p group is setup and hosting

Returns bool: True if hosting

get_lp2p_is_pairing

read-only
$net.get_lp2p_is_pairing() -> bool

Gets if the lp2p group is setup for pairing

Returns bool: True if setup for pairing

get_lp2p_is_showing_error

read-only
$net.get_lp2p_is_showing_error() -> bool

Get if the lp2p system is currently showing the user an error message.

Returns bool: True if there is an error on screen.

get_lp2p_local_friend_key_base64

$net.get_lp2p_local_friend_key_base64() -> string

Get the local friend key as a base64 encoded string to be sent over the network

Returns string: base64 encoded friend key

get_lp2p_local_friend_language

$net.get_lp2p_local_friend_language() -> string

Get the local friend language to be sent over the network

Returns string: local friend language

get_lp2p_needs_hosting_update

$net.get_lp2p_needs_hosting_update() -> bool

Gets if the lp2p group is in need of a hosting update

Returns bool: True if hosting needs update

get_lp2p_ssid

$net.get_lp2p_ssid() -> string

Get the SSID being broadcast by this device in LP2P mode

Returns string: SSID, or empty string

get_manual_region_selection_allowed

read-only
$net.get_manual_region_selection_allowed() -> bool

Return whether we're allowed manually select our data center region. This is controlled by a chicken switch on the backend.

Returns bool: Are we allowed to manually select our data center?

get_match_flow

read-only
$net.get_match_flow() -> int

Get the match flow.

Returns int: The match flow.

get_matchmade_group_size

$net.get_matchmade_group_size(user: User) -> int

Get the number of players a user matchmade into the game with. Returns -1 if the user is not found. Game servers only.

ParameterTypeMeaning
userUserThe user handle.

Returns int: The group size.

get_matchmaking_custom_match_options

read-only
$net.get_matchmaking_custom_match_options() -> list

Get the custom private match options for map, ball and bot usage in matchmaking.

Returns list: The map, ball and bot usage options

get_matchmaking_join_notes

$net.get_matchmaking_join_notes() -> string

Get the join notes for current matchmaking session.

Returns string: Matchmaking join notes, if available

get_matchmaking_playlist

read-only
$net.get_matchmaking_playlist(match_defs: list) -> list

Get the match flow and playlist the user is matchmaking into.

ParameterTypeMeaning
match_defslistAll available match defs.

Returns list: The match flow and, if valid, the match def, or NULL.

get_matchmaking_status

read-only
$net.get_matchmaking_status() -> int

Returns the state of matchmaking

Returns int: Enum value of type vonline_matchmaking_status_t

get_midnight_madness_playlist

read-only
$net.get_midnight_madness_playlist() -> Reference

Get the midnight madness match def.

Returns Reference: Midnight madness match def.

get_new_news_messages_bg_image_index

read-only
$net.get_new_news_messages_bg_image_index(tab_type: int) -> int

Get the background image index of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns int: The background image index of new news messages.

get_new_news_messages_cta_1

read-only
$net.get_new_news_messages_cta_1(tab_type: int) -> string

Get the first cta text of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns string: The first cta text of new news messages.

get_new_news_messages_cta_2

read-only
$net.get_new_news_messages_cta_2(tab_type: int) -> string

Get the second cta text of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns string: The second cta text of new news messages.

get_new_news_messages_cta_base_color

read-only
$net.get_new_news_messages_cta_base_color(tab_type: int) -> vec4

Get the CTA hologram base color of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns vec4: The CTA hologram base color of new news messages.

get_new_news_messages_cta_energy_color

read-only
$net.get_new_news_messages_cta_energy_color(tab_type: int) -> vec4

Get the CTA hologram energy color of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns vec4: The CTA hologram energy color of new news messages.

get_new_news_messages_fg_image_index

read-only
$net.get_new_news_messages_fg_image_index(tab_type: int) -> int

Get the foreground image index of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns int: The foreground image index of new news messages.

get_new_news_messages_length

read-only
$net.get_new_news_messages_length() -> int

Get the length of new news messages.

Returns int: The length of new news messages.

get_new_news_messages_message

read-only
$net.get_new_news_messages_message(tab_type: int) -> string

Get the description message of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns string: The description message of new news messages.

get_new_news_messages_tab_title

read-only
$net.get_new_news_messages_tab_title(tab_type: int) -> string

Get the tab title of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns string: The tab title of new news messages.

get_new_news_messages_tab_type_list

read-only
$net.get_new_news_messages_tab_type_list() -> list

Get the tab type list of new news messages.

Returns list: The tab type list of new news messages.

get_new_news_messages_target_bundle_index

read-only
$net.get_new_news_messages_target_bundle_index(tab_type: int) -> int

Get the target bundle index of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns int: The target bundle index of new news messages.

get_new_news_messages_title

read-only
$net.get_new_news_messages_title(tab_type: int) -> string

Get the title of new news messages.

ParameterTypeMeaning
tab_typeintThe tab type of the new news message to look up.

Returns string: The title of new news messages.

get_nic_address

read-only
$net.get_nic_address(name: string) -> int

Get the local address of a named network interface.

ParameterTypeMeaning
namestringName of a network interface. Should be one of the names returned by net.get_nic_list().

Returns int: Local address or 0.0.0.0 if the named interface was not found.

get_nic_list

read-only
$net.get_nic_list() -> list

Gather list of all operational network interfaces.

Returns list: List of adapter names.

get_packet_loss

$net.get_packet_loss() -> int

Get packet loss value.

Returns int: The latest packet loss value.

get_percent_time_in_match

$net.get_percent_time_in_match(user: User, match_start_time: int, match_end_time: int) -> float

Get the percent time a user spent in game, given the start and end of the match. Server only.

ParameterTypeMeaning
userUserThe user handle.
match_start_timeintThe time the match started, in seconds.
match_end_timeintThe time the match ended (or is expected to end), in seconds.

Returns float: The chance the given team will place in first.

get_ping

$net.get_ping() -> int

Get millisecond ping value.

Returns int: The latest ping value in ms.

get_platform_network_user_kind

read-only
$net.get_platform_network_user_kind() -> int

Get the vuser_id_kind_t of users on the platform we're running on.

Returns int: The vuser_id_kind_t associated with the platform.

get_reconnect_interval_ms

read-only
$net.get_reconnect_interval_ms() -> int

Get the interval which we should attempt to reconnect to the backend.

Returns int: The interval in ms.

get_region_count

read-only
$net.get_region_count() -> int

Get number of available regions.

Returns int: The region count.

get_region_name

read-only
$net.get_region_name(region_index: int) -> string

Get the name of the region at region_index.

ParameterTypeMeaning
region_indexintThe index of the region.

Returns string: The name of the region.

get_region_override_indices

$net.get_region_override_indices() -> list

Get the preferred regions by region_index.

Returns list: The list of preferred region indices.

get_region_ping

read-only
$net.get_region_ping(region_index: int) -> int

Get the ping of the region at region_index.

ParameterTypeMeaning
region_indexintThe index of the region.

Returns int: The ping of the region.

get_region_ping_string

read-only
$net.get_region_ping_string(region_index: int) -> string

Get the ping display string of the region at region_index.

ParameterTypeMeaning
region_indexintThe index of the region.

Returns string: The display ping of the region.

get_remote_connections

read-only
$net.get_remote_connections() -> list

Get a list of indices of all remote connections.

Returns list: List of remote connections.

get_report_error_code

$net.get_report_error_code() -> int

Get the error code for an unsuccessful report.

Returns int: The error code for the last report.

get_report_uuid

$net.get_report_uuid() -> string

Get the UUID for a successful report.

Returns string: The UUID for the last report.

get_sanction_expires_utc_seconds

read-only
$net.get_sanction_expires_utc_seconds() -> int

Return the expiration time of the sanction against the user, if there is one.

Returns int: The sanction expiration time in UTC seconds.

get_sanction_reference_id

read-only
$net.get_sanction_reference_id() -> string

Return the reference ID of the sanction against the user, if there is one.

Returns string: The sanction reference UUID.

get_server_connection

read-only
$net.get_server_connection() -> int

Get the index of server connection.

Returns int: The server index.

get_server_connection_state

read-only
$net.get_server_connection_state() -> int

Check if we are connected to a game server.

Returns int: Get our current connection status to the server. If less than 0, we were ungracefully disconnected.

get_server_custom_match_options

read-only
$net.get_server_custom_match_options() -> list

Get the custom private match options for map, ball and bot usage from the game server.

Returns list: The map, ball and bot usage options

get_server_debug_events_allowed

read-only
$net.get_server_debug_events_allowed() -> bool

Return whether we're allowed to run debug events. This is controlled by a chicken switch on the backend.

Returns bool: Are we allowed to run debug events?

get_server_reconnect_attempt_limit

read-only
$net.get_server_reconnect_attempt_limit() -> int

Get the number of times a server should attempt to reconnect.

Returns int: The reconnect limit.

get_server_region

$net.get_server_region() -> string

Get the region ID for a server. Only valid on a server after matchmaking has happened.

Returns string: The region ID for the server.

get_sorted_region_indices

read-only
$net.get_sorted_region_indices() -> list

Get the list of region indices sorted alphabetically by name.

Returns list: The list of region indices sorted by name.

get_training_item_progress

$net.get_training_item_progress(user: User, ftue_training_item_index: int) -> int

Get the persistent value for the a FTUE training item

ParameterTypeMeaning
userUserThe local user.
ftue_training_item_indexintThe FTUE training item index

Returns int: Current FTUE training item progress.

get_training_number

$net.get_training_number(user: User) -> int

Get the persistent value for the user's current FTUE training set

ParameterTypeMeaning
userUserThe local user.

Returns int: Current FTUE training number.

get_unified_messaging_item_image_index

read-only
$net.get_unified_messaging_item_image_index(index: int) -> int

Get the image index for a Unified Messaging item.

ParameterTypeMeaning
indexintThe index of the item on vonline

Returns int: The image index for the Unified Messaging item

get_unified_messaging_item_text

read-only
$net.get_unified_messaging_item_text(index: int) -> string

Get the text for a Unified Messaging item.

ParameterTypeMeaning
indexintThe index of the item on vonline

Returns string: The text for a Unified Messaging item

get_unified_messaging_item_title

read-only
$net.get_unified_messaging_item_title(index: int) -> string

Get the title for a Unified Messaging item.

ParameterTypeMeaning
indexintThe index of the item on vonline

Returns string: The title for a Unified Messaging item

get_unified_messaging_state

read-only
$net.get_unified_messaging_state() -> int

Get the state of Unified Messaging.

Returns int: Enum value of type vonline_get_unified_messages_state_t

get_user_to_spectate

read-only
$net.get_user_to_spectate(user: User) -> User

Get the user the passed-in user wants to spectate.

ParameterTypeMeaning
userUserThe user.

Returns User: The user to spectate, the returned user may be invalid.

get_utc

read-only
$net.get_utc() -> int

Get the current time in seconds since 00:00:00 01/01/1970. Use www.epochconverter.com to generate timestamps for features.

Returns int: The current time in seconds since 00:00:00 01/01/1970

get_vpn_address

read-only
$net.get_vpn_address() -> int

Get the IP address of the active VPN connection.

Returns int: VPN address or 0.0.0.0 if a VPN connection was not active.

get_win_chance

$net.get_win_chance(team_id: int, match_start_time: int, match_end_time: int) -> float

Get the chance a given team win. Server only.

ParameterTypeMeaning
team_idintThe team to calculate for.
match_start_timeintThe time the match started, in seconds.
match_end_timeintThe time the match ended (or is expected to end), in seconds.

Returns float: The chance the given team will place in first.

grant_achievement

$net.grant_achievement(id: int, token: string)

Given an id and token, grant an achievement for the first party user.

ParameterTypeMeaning
idintThe platform-specific id for the achivement.
tokenstringThe platform-specific token for the achivement.

has_last_full_ack_time_expired

read-only
$net.has_last_full_ack_time_expired(virtual_time: int) -> bool

Get whether all clients have fully acknowledged world state more recently than the given timestamp. Should only be called by the server.

ParameterTypeMeaning
virtual_timeintThe time to check if we've been fully acked since.

Returns bool: True if every connection has fully acknowledged us since a given timestamp.

has_last_full_ack_time_expired_by_connection

read-only
$net.has_last_full_ack_time_expired_by_connection(virtual_time: int, connection: int) -> bool

Get whether the given client has fully acknowledged world state more recently than the given timestamp. Should only be called by the server.

ParameterTypeMeaning
virtual_timeintThe time to check if the given connection has been fully acked since.
connectionintThe connection index for the user to check.

Returns bool: True if the given connection has fully acknowledged us since a given timestamp.

has_server_acknowledged_this_entity

$net.has_server_acknowledged_this_entity() -> bool

Called by a client to determine if the predicted spawn of an entity has been acknowledged by the server. Should only be called by a client.

Returns bool: If the predicted spawn of an entity has been acknowledged by the server.

in_lp2p_session

read-only
$net.in_lp2p_session() -> bool

Returns if you are currently in an lp2p session

Returns bool: True if we are in an lp2p session.

is_achievement_unlocked

$net.is_achievement_unlocked(id: int, token: string) -> bool

Given an id and token, returns true if that achievement has been unlocked.

ParameterTypeMeaning
idintThe platform-specific id for the achivement.
tokenstringThe platform-specific token for the achivement.

Returns bool: True if the achievement is unlocked.

is_auth_pending

read-only
$net.is_auth_pending() -> bool

Return true if we are attempting to authenticate a local user.

Returns bool: True if we are waiting for user authentication to complete.

is_authenticated

read-only
$net.is_authenticated() -> bool

Check whether we have successfully authenticated with the Viper online backend.

Returns bool: True if we are connected and authenticated.

is_authority

$net.is_authority(entity: Entity) -> bool

True if the entity is local or if we're the server.

ParameterTypeMeaning
entityEntityThe entity to query.

Returns bool: True if we're authoritative over this entity.

is_backend_disconnect_pending

$net.is_backend_disconnect_pending() -> bool

True if we are still disconnecting from the Viper online backend.

Returns bool: True if a disconnect is pending

is_chat_allowed

read-only
$net.is_chat_allowed(target_user: User) -> bool

Are chat features permitted for the local user with the specified target user? Returns false while pending. If no target user is specified, checks if chat features are allowed with any user.

ParameterTypeMeaning
target_userUserThe target user.

Returns bool: Whether chat features are allowed.

is_connected_to_server

read-only
$net.is_connected_to_server() -> bool

Check if we are connected to a game server.

Returns bool: If we are connected to a game server.

is_data_updated

read-only
$net.is_data_updated() -> bool

Check if updated data has been downloaded.

Returns bool: If updated data has been downloaded.

is_downloading_content_updates

read-only
$net.is_downloading_content_updates() -> bool

Check if we are in the process of downloading content updates. Not necessarily valid until net.is_data_updated() is true.

Returns bool: If content updates are in the process of being updated.

is_epic_available

read-only
$net.is_epic_available() -> bool

Returns true if Epic Online Services are available

Returns bool: True if it is possible to authenticate using Epic Online Services.

is_european_region

$net.is_european_region() -> bool

Returns true if this server is on the European region

Returns bool: Weather or not this server is on the European server

is_game_server_authenticated

$net.is_game_server_authenticated() -> bool

Are we authenticated and ready to be configured?

Returns bool: If we are connected to the backend.

is_game_server_configured

$net.is_game_server_configured() -> bool

Are we configured and ready to load a playlist?

Returns bool: If we are ready to load into a playlist/hideout.

is_headless_server

read-only
$net.is_headless_server() -> bool

Determine if the machine where this script is executing is a headless game server.

Returns bool: True if headless server.

is_join_in_progress

$net.is_join_in_progress(user: User) -> bool

Get whether a user joined the game once it started. Can be called for anyone on a server, and for the local-primary user on a client.

ParameterTypeMeaning
userUserThe user.

Returns bool: True if the user joined in progress.

is_matchmaking

read-only
$net.is_matchmaking() -> bool

Determine if a user is matchmaking.

Returns bool: True if the user is matchmaking.

is_package_acknowledged

read-only
$net.is_package_acknowledged(package: Reference) -> bool

Get whether all replicated entities in a package have been acknowledged by all connected users.

ParameterTypeMeaning
packageReferenceReference to package file.

Returns bool: True if all connected users have acknowledged all replicated entities in the package.

is_package_acknowledged_by_connection

read-only
$net.is_package_acknowledged_by_connection(package: Reference, connection: int, debug_print: bool) -> bool

Get whether all replicated entities in a package have been acknowledged by a specific user. Should only be called by the server.

ParameterTypeMeaning
packageReferenceReference to package file.
connectionintThe connection index for the user to check.
debug_printboolWhether to print debug message.

Returns bool: True if the given user has acknowledged all replicated entities in the package.

is_patch_available

read-only
$net.is_patch_available() -> bool

Is a patch for the game available?

Returns bool: True if the platform detected that patch is available, False otherwise.

is_restart_needed

read-only
$net.is_restart_needed() -> bool

Check if restarting is required in order to apply content updates.

Returns bool: If the game needs to restart.

is_server

read-only
$net.is_server() -> bool

Determine if the machine where this script is executing is a game server.

Returns bool: True if server.

is_server_input_starved

read-only
$net.is_server_input_starved() -> bool

Get whether the server is missing input for this client on this frame.

Returns bool: True if the server lacks input.

is_steam_subscriber

read-only
$net.is_steam_subscriber() -> bool

Return true if the local user is a Steam subscriber.

Returns bool: True if the local user is a Steam subscriber.

is_vpn_connected

read-only
$net.is_vpn_connected() -> bool

Check if a VPN connection is active.

Returns bool: True if an active VPN connection was detected, False otherwise.

join_wifi_network

$net.join_wifi_network(ssid: string, password: string, receiver: Component)

Attempt to join the specified WiFi network

ParameterTypeMeaning
ssidstringThe SSID of the WiFi network.
passwordstringThe password for the WiFi network.
receiverComponentComponent to receive the result event, NULL for the current entity.

lp2p_clear_advertise_data

$net.lp2p_clear_advertise_data()

Clears the scan advertise data and stops other users from seeing this user via lp2p_scan_for_peers.

lp2p_decode_duration

$net.lp2p_decode_duration(duration: vec4) -> float

Decodes an encoded duration, should only be called from within the scope of events triggered via lp2p communication.

ParameterTypeMeaning
durationvec4The encoded duration.

Returns float: The duration decoded and syncronized, having latency taken into effect.

lp2p_encode_duration

$net.lp2p_encode_duration(duration: float) -> vec4

Encodes the specified duration in a way that allows remote clients to decode a duration relative to the current time taking latency into account.

ParameterTypeMeaning
durationfloatThe duration (in seconds) to encode.

Returns vec4: The encoded duration to pass to over the network.

lp2p_get_host_time_ms

$net.lp2p_get_host_time_ms() -> int

Gets the host time in ms.

Returns int: The syncronized host time in ms.

lp2p_scan_for_peers

$net.lp2p_scan_for_peers(callback_event: string, complete_event: string, channel: int) -> bool

Scans for other users in the local area and return their advertise data args via the specified callback (with user, channel and link_quality automatically added to the start of the args). Callbacks are called in order of connection quality. Only one scan can happen at a time.

ParameterTypeMeaning
callback_eventstringCallback to use to recieve data per peer. Automatic args are user, channel and link_quality
complete_eventstringOptional event to call when the scan is complete and all callback_events have been run
channelintSpecific channel to scan on. A value of 0 means all channels, a value of 1, 6 or 11 improves speed of scan but won't pick up users on other channels.

Returns bool: True if the scan was successfully started.

lp2p_set_advertise_data

$net.lp2p_set_advertise_data(data_args: list) -> bool

Sets the data that will be picked up when another user finds this user via a scan.

ParameterTypeMeaning
data_argslistThe data that will be passed as args to the lp2p_scan_for_peers callback.

Returns bool: True if the data was successfully set, can return false if the data was too large.

lp2p_set_broadcast_channel

$net.lp2p_set_broadcast_channel(channel: int)

Sets the channel the lp2p system will broadcast on. 0 is the default and best channel, using a value that is not the default will reduce connection quality. -1 cycles channels every send.

ParameterTypeMeaning
channelintThe channel to use or 0 to reset to default.

matchmake

$net.matchmake(game_mode: int, match_def: Reference, map_override: int, ball_override: int, bot_override: bool, owner: User)

Join an online game through the matchmaking service. Should only be used by internet games.

ParameterTypeMeaning
game_modeintThe type of game to matchmake into (custom, quickplay, hideout).
match_defReferenceA match definition file. Not needed if the game is hideout.
map_overrideintThe map type requested by custom private match options.
ball_overrideintThe ball type requested by custom private match options.
bot_overrideboolThe bot usage setting requested by custom private match options.
ownerUserThe user who started the custom match; only this player can change settings during rematches.

notify_in_gameplay

$net.notify_in_gameplay()

Notify that we are currently in a multiplay game

open_browser

read-only
$net.open_browser(url: string, permitted_domains: list)

Opens a web browser to a URL, on Windows.

ParameterTypeMeaning
urlstringThe URL to open.
permitted_domainslistOptional list specifying which domains are permitted to be access by the browser. PlayStation only.

queue_event_on_component

read-only
$net.queue_event_on_component(name: string, connections: list, component: Component, args: list, unreliable: bool, any_session: bool, all_channels: bool, complete_callback: string, callback_component: Component, id_arg: var, leading_edge_only: bool, critical: bool) -> bool

Send a network event to a component. Note if a client sends this message, it may be sent twice.

ParameterTypeMeaning
namestringName of the event.
connectionslistList of destination network connections (may include self).
componentComponentThe component that will receive the event.
argslistEvent arguments.
unreliableboolIf true, the event may not be received. If false, event will be received in order as long as the connection is up.
any_sessionboolIf false, the event will only be recevied by peers in the current lp2p session.
all_channelsboolIf true, the event will be sent to all channels.
complete_callbackstringName of the event to call when an lp2p reliable event succeeds/fails.
callback_componentComponentThe component that will receive the callback event. Will be caller if unspecified.
id_argvarUser data type arg that is either passed to the complete_callback for reliable events or used to uniquely identify events for deduplication in non-reliabled events.
leading_edge_onlyboolOnly send event on leading edge frame. Useful on clients to prevent multiple events to be sent to server because of rollback.
criticalboolIf true, the event will have critical priority. Otherwise normal priority.

Returns bool: True if the event was successfully queued, false otherwise.

queue_event_on_world

read-only
$net.queue_event_on_world(name: string, connections: list, args: list, unreliable: bool, any_session: bool, all_channels: bool, complete_callback: string, callback_component: Component, id_arg: var, leading_edge_only: bool, critical: bool) -> bool

Broadcast a network event to targeted connections. Note if a client sends this message, it may be sent twice.

ParameterTypeMeaning
namestringName of the event.
connectionslistList of destination network connections (may include self).
argslistEvent arguments.
unreliableboolIf true, the event may not be received. If false, event will be received in order as long as the connection is up.
any_sessionboolIf false, the event will only be received by peers in the current lp2p session.
all_channelsboolIf true, the event will be sent to all channels.
complete_callbackstringName of the event to call when an lp2p reliable event succeeds/fails.
callback_componentComponentThe component that will receive the callback event. Will be caller if unspecified.
id_argvarUser data type arg that is either passed to the complete_callback for reliable events or used to uniquely identify events for deduplication in non-reliabled events.
leading_edge_onlyboolOnly send event on leading edge frame. Useful on clients to prevent multiple events to be sent to server because of rollback.
criticalboolIf true, the event will have critical priority. Otherwise normal priority.

Returns bool: -True if the event was successfully queued, false otherwise.

replace_dropped_players

$net.replace_dropped_players(leave_time_ms: int)

Request new players be matchmade into this game to replace a given user who dropped or disconnected. Should only be called by game servers.

ParameterTypeMeaning
leave_time_msintThe time the user left in ms.

replace_dropped_players_by_team

$net.replace_dropped_players_by_team(team_id: int)

Request new players be matchmade into this game to replace a given a team id to fill. Should only be called by game servers.

ParameterTypeMeaning
team_idintThe team id to add a player to.

report_crew_name

$net.report_crew_name(crew_guid: string, subject: string, report_category: int, report_content_type: int, location: string)

Report an offensive crew name.

ParameterTypeMeaning
crew_guidstringThe GUID of the crew being reported.
subjectstringThe subject of the report.
report_categoryintThe category of the report. See vonline_tos_report_category_t
report_content_typeintThe content type of the report. See vonline_tos_report_content_type_t
locationstringThe location in-game where the report is being generated from.

report_server

$net.report_server()

Called when the user presses 'report server.'

report_user_abuse

$net.report_user_abuse(user: User, subject: string, username_type: int, report_category: int, report_content_type: int, location: string)

Report a user for abuse.

ParameterTypeMeaning
userUserThe user that is being reported.
subjectstringThe subject of the report.
username_typeintThe type of username, if applicable. See vusername_type_t
report_categoryintThe category of the report. See vonline_tos_report_category_t
report_content_typeintThe content type of the report. See vonline_tos_report_content_type_t
locationstringThe location in-game where the report is being generated from.

request_playlist_update

$net.request_playlist_update()

Request a list of all active playlists, and skill data for the client. A net_playlists_changed event will be sent when the backend responds.

reset_seasonal_ranked_skill

$net.reset_seasonal_ranked_skill(user: User, playlists: list, season: int)

Soft-reset the ranked skill for a given user and playlists. Should be called when a user sees a season change - the backend will ensure it doesn't reset repeatedly.

ParameterTypeMeaning
userUserThe user.
playlistslistThe playlists to reset ranked skill for.
seasonintThe current season.

reset_skill_decay_counters

$net.reset_skill_decay_counters()

Set the skill rating decayed counters to 0 for each ranked playlist. This has no affect on skill rating, the counters are for informing the player about how far their skill rating has decayed.

restart

$net.restart()

Restart the game.

server_network_next_event

read-only
$net.server_network_next_event(client_index: int, event_index: int)

Send an event to network next for a player.

ParameterTypeMeaning
client_indexintClient index of player for whom the event is being sent.
event_indexintIndex of the event, must be in range [0,63].

server_network_next_set_event_state

read-only
$net.server_network_next_set_event_state(state: bool)

Enable/disable network next events.

ParameterTypeMeaning
stateboolWhether or not Network Next events should be sent.

set_breadcrumb_step

$net.set_breadcrumb_step(user: User, breadcrumb_step: int, breadcrumb_step_description: string)

Set the persistent value for the user's current breadcrumb step

ParameterTypeMeaning
userUserThe local user.
breadcrumb_stepintUpdated breadcrumb step
breadcrumb_step_descriptionstringbreadcrumb step description

set_field_replicated

$net.set_field_replicated(field: string, is_replicated: bool, only_to_owner: bool, is_quaternion: bool, is_normal: bool, is_time_ms: bool, is_enum: string, is_dependency: bool, quantize_min: var, quantize_max: var, quantize_step: var, fire_event: bool)

Configure the way in which a named mutable is replicated.

ParameterTypeMeaning
fieldstringName of the field.
is_replicatedboolTrue if the field should replicate, false otherwise.
only_to_ownerboolTrue if the field should only replicate to the owning user's client, false otherwise.
is_quaternionboolTrue if the vec4 field replicate as a quaternion, false otherwise.
is_normalboolTrue if the vec2 or vec3 field should replicate as a normal vector, false otherwise.
is_time_msboolTrue if the int field should replicate as a millisecond timestamp, false otherwise.
is_enumstringIf the field is an integer storing an enum value, the name of the enum.
is_dependencyboolTrue if the entity_ref or component_ref field induce a replication dependency, false otherwise.
quantize_minvarThe minimum int or float value the replicated field may take on.
quantize_maxvarThe maximum int or float value the replicated field may take on.
quantize_stepvarThe minimum difference between int or float values.
fire_eventboolTrue if a field_replicated event should trigger when replication updates the field, false otherwise.

set_ftue_step

$net.set_ftue_step(user: User, ftue_step: int, ftue_step_description: string)

Set the persistent value for the user's current FTUE step

ParameterTypeMeaning
userUserThe local user.
ftue_stepintUpdated FTUE step
ftue_step_descriptionstringFTUE step description

set_ftue_training_item_progress

$net.set_ftue_training_item_progress(user: User, ftue_training_item_index: int, ftue_training_item_progress: int)

Set the persistent value for a FTUE training checkbox

ParameterTypeMeaning
userUserThe local user.
ftue_training_item_indexintThe FTUE training item index
ftue_training_item_progressintUpdated FTUE training item progress

set_ftue_training_number

$net.set_ftue_training_number(user: User, ftue_training_number: int)

Set the persistent value for the user's current FTUE training number

ParameterTypeMeaning
userUserThe local user.
ftue_training_numberintUpdated FTUE training number

set_game_title

$net.set_game_title(title: string)

Set title of this game (Used on PS4/PS5 as of this writing).

ParameterTypeMeaning
titlestringThe game title.

set_lp2p_channel

$net.set_lp2p_channel(channel: int)

Tells the lp2p system what wireless channel is desired (0 means pick best, <0 means pick best and force recreate).

ParameterTypeMeaning
channelintChannel to create group on (1,6,11) or 0 means find best channel and <0 means find best channel and force recreate.

set_lp2p_game_key

$net.set_lp2p_game_key(game_key: string)

Sets the lp2p game key from a base64 encoded string

ParameterTypeMeaning
game_keystringThe game key encoded as a base64 string.

set_lp2p_is_hosting

$net.set_lp2p_is_hosting(is_hosting: bool)

Tells the lp2p system if it should be hosting a group

ParameterTypeMeaning
is_hostingboolDetermines if a group should be hosted.

set_lp2p_is_pairing

$net.set_lp2p_is_pairing(is_pairing: bool)

Tells the lp2p system if it should be trying to pair.

ParameterTypeMeaning
is_pairingboolDetermines if a group should be setup for pairing.

set_lp2p_max_connections

$net.set_lp2p_max_connections(max_connections: int)

Tells the lp2p system how many connections a group should support.

ParameterTypeMeaning
max_connectionsintMaximum number of karts that can connect to this group.

set_lp2p_session_user

$net.set_lp2p_session_user(index: int, user: User) -> bool

Join a lp2p session with a provided id.

ParameterTypeMeaning
indexintThe index of the user.
userUserThe user.

Returns bool: True if the operation was successful.

set_override_local_address

$net.set_override_local_address(address: int)

Set the local network interface address to bind for replicated network traffic.

ParameterTypeMeaning
addressintInterface address returned by net.get_nic_address(), or zero to remove the override.

set_package_synchronize_mode

$net.set_package_synchronize_mode(skip_unload: bool)

Adjust how the loaded package list is replicated from server to client.

ParameterTypeMeaning
skip_unloadboolIf true, client will retain any loaded packages not in the server's list. Otherwise, it will unload them.

set_presence_strings

$net.set_presence_strings(strings: list)

Set the presence strings for the platform (Used on PS5 only as of this writing).

ParameterTypeMeaning
stringslistA list of references to the localized strings in vonline_rich_presence_state_t order.

set_recent_player_text

$net.set_recent_player_text(text: string)

Set text used to describe a recent player experience (Used on PS4 only as of this writing).

ParameterTypeMeaning
textstringThe text to set.

set_region_override_index

$net.set_region_override_index(region_index: int) -> bool

Set a preferred region by region_index.

ParameterTypeMeaning
region_indexintThe index of the region.

Returns bool: True on success.

set_replicated

$net.set_replicated(value: bool, fields_not_replicated_by_default: bool)

Allow network replication for this type of component.

ParameterTypeMeaning
valueboolTrue if the component type should replicate, false otherwise.
fields_not_replicated_by_defaultboolTrue mutables default to not replicated (and replication should be opt-in). Normally field replication is opt-out.

set_user_connected

$net.set_user_connected(user: User)

Mark the user as having connected to the server. Used to replace players who never connected.

ParameterTypeMeaning
userUserThe user who joined.

set_user_join_time

$net.set_user_join_time(user: User, join_time: int)

Set the time a player joined the game server. Server only.

ParameterTypeMeaning
userUserThe user who joined.
join_timeintThe time the user joined in ms.

setup_lp2p_local_friend_key

$net.setup_lp2p_local_friend_key(user: User)

Sets up the local friend key so it can be sent later

ParameterTypeMeaning
userUserThe user.

should_connect_to_server

read-only
$net.should_connect_to_server() -> bool

Check if there is an online server we should connect to. This should be deterministic until net.connect_to_server() is called. It it is not required to call this before net.connect_to_server().

Returns bool: True if a game server is ready for us to connect to.

unset_region_override_index

$net.unset_region_override_index(region_index: int) -> bool

Unset a preferred region by region_index.

ParameterTypeMeaning
region_indexintThe index of the region.

Returns bool: True on success.

user_left_game

$net.user_left_game(user: User, leave_time_ms: int, penalize_quitter: bool)

Called when a user disconnects from a match. Should only be called by game servers.

ParameterTypeMeaning
userUserThe user who left.
leave_time_msintThe time the user left in ms.
penalize_quitterboolTrue if we should apply a skill penalty to the user who quit the game.

will_connect_as_spectator

read-only
$net.will_connect_as_spectator() -> bool

Check whether this client will connect to a server as a spectator.

Returns bool: True if this client will connect as a spectator on calling net.connect_to_server. Only valid if net.should_connect_to_server returns true.