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 ).
$ net . add_lp2p_friend_history (name: string , key: string , language: string )
Adds a friend key to the play history
Parameter Type Meaning namestringThe name of the friend. keystringThe friend key encoded as a base64 string. languagestringThe language of the friend.
$ net . authenticate (user: User , reconnect: bool , platform_only: bool , user_acknowledged: bool , accept_data_transfer: bool )
Authenticate with the Viper online backend.
Parameter Type Meaning 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.
$ net . authenticate_game_server (reconnect: bool )
Authenticate a game server.
Parameter Type Meaning reconnectboolTrue if the game is reconnecting
$ 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.
Parameter Type Meaning winning_team_idintThe winning teams id. mvp_userUserThe user who was the games mvp.
$ 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.
Parameter Type Meaning team_idintThe team id to update. resultintThe result of the match - see vonline_match_result_state_t
$ 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.
Parameter Type Meaning 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
$ net . cancel_matchmaking ()
Cancel a request to join an online game through the matchmaking service. Should only be used by internet games.
$ net . cancel_replace_dropped_players ()
Cancel a request to replace players who dropped from the game. Should only be called by game servers.
$ 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.
Parameter Type Meaning team_idintThe team id to add a player to.
Try to connect to an online server.
$ net . crossplay_enabled_for_user (user: User ) -> bool
Determine if crossplay is enabled for a user on the server.
Parameter Type Meaning userUserThe user handle.
Returns bool: True if the user has crossplay enabled
$ 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.
Parameter Type Meaning utc_sintSeconds since 00:00:00 01/01/1970.
$ 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.
$ net . disconnect_from_backend (reason: string )
Disconnect from the Viper online backend.
Parameter Type Meaning reasonstringThe reason for disconnecting.
$ net . disconnect_from_server () -> bool
Disconnect from the current server - should only be called by clients.
Returns bool: True if we started a server.
$ net . dump_unacknowledged_views (package: Reference )
Dump all replicated entities in a package that have not been acknowledged by all connected users.
Parameter Type Meaning packageReferenceReference to package file.
$ net . finalize_game_result (season: int )
Finalize the results of a match - should only be called by game servers.
Parameter Type Meaning seasonintThe current season.
$ net . game_server_autodetect_datacenter () -> string
Autodetected cloud datacenter name for the game server.
Returns string: Cloud datacenter name, if available.
$ net . game_server_multiplay_id () -> int
The integer server id assigned by Multiplay.
Returns int: The integer server id assigned by Multiplay, if available.
$ net . game_server_next_datacenter () -> string
Network Next datacenter name for the game server.
Returns string: Datacenter name, if available.
$ net . game_server_uuid () -> string
The UUID for the game server.
Returns string: The UUID for the game server, if available.
$ net . get_active_playlists (match_flow: int ) -> list
Get a list of all active match_defs.
Parameter Type Meaning match_flowintThe match flow to check activity for
Returns list: All active match defs.
$ 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.
$ net . get_all_connections () -> list
Get a list of all connection indices, including self.
Returns list: List of all connections.
$ net . get_assigned_team (user: User ) -> int
Get the team for a user. Returns -1 if the team is not found. Server only.
Parameter Type Meaning userUserThe user handle.
Returns int: The id for the assigned team.
$ net . get_backend_switch (name: string ) -> bool
Get a backend switch value.
Parameter Type Meaning namestringThe switch name.
Returns bool: Switch value.
$ net . get_backend_tunable (name: string ) -> int
Get a backend tunable value.
Parameter Type Meaning namestringThe tunable name.
Returns int: Tunable value.
$ net . get_backend_tunable_exists (name: string ) -> bool
Determine if a backend tunable has been received.
Parameter Type Meaning namestringThe tunable name.
Returns bool: True if the tunable exists, false otherwise.
$ net . get_breadcrumb_step (user: User ) -> int
Get the persistent value for the user's current breacrumb step
Parameter Type Meaning userUserThe local user.
Returns int: Current breadcrumb step.
$ net . get_client_reconnect_attempt_limit () -> int
Get the number of times a client should attempt to reconnect.
Returns int: The reconnect limit.
$ 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.
$ 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.
$ 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
$ net . get_custom_error_message () -> string
Return the custom error message from the server, if applicable.
Returns string: The custom error message.
$ 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?
$ net . get_epic_verification_code () -> string
Returns a code the user needs to enter to complete Epic authentication.
Returns string: The verification code.
$ 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.
$ 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.
$ net . get_epic_verification_url () -> string
Returns the URL the user needs to visit to complete Epic authentication.
Returns string: The URL.
$ 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.
$ 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.
$ 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.
$ 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.
$ net . get_error_level () -> int
Return the current error level.
Returns int: The highest priority error level.
$ 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.
$ net . get_error_system_code () -> int
Return the error code provided by the system library.
Returns int: Error code provided by system library.
$ 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.
$ 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.
$ net . get_ftue_step (user: User ) -> int
Get the persistent value for the user's current FTUE step
Parameter Type Meaning userUserThe local user.
Returns int: Current FTUE step.
$ net . get_game_server_playlist (match_defs: list ) -> list
Get the match flow and playlist the game server has been configured for.
Parameter Type Meaning match_defslistAll available match defs.
Returns list: The match flow and, if valid, the match def, or NULL.
$ net . get_inactivity_timeouts () -> list
Gets the inactivity timeouts from the backend.
Returns list: A list of timeouts.
Get millisecond jitter value.
Returns int: The latest jitter value in ms.
$ 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.
$ net . get_local_connection () -> int
Get the index of the local network connection.
Returns int: The local client index.
$ net . get_local_network_permissions () -> int
Has permission to access the local network been granted?
Returns int: vsocket_local_network_permission_value_t value
$ net . get_lp2p_channel () -> int
Get the channel being used by this device in LP2P mode
Returns int: Channel, or 0
$ net . get_lp2p_comms_age (user: User ) -> int
Find the delta packet counter for a session user.
Parameter Type Meaning userUserThe user.
Returns int: How outdated is the roundtrip of our packet counter with a peer.
$ net . get_lp2p_game_key () -> string
Gets the lp2p game key encoded as base64
Returns string: The game key encoded as base64
$ 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.
$ net . get_lp2p_is_hosting () -> bool
Gets if the lp2p group is setup and hosting
Returns bool: True if hosting
$ net . get_lp2p_is_pairing () -> bool
Gets if the lp2p group is setup for pairing
Returns bool: True if setup for pairing
$ 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.
$ 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
$ net . get_lp2p_local_friend_language () -> string
Get the local friend language to be sent over the network
Returns string: local friend language
$ 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
$ net . get_lp2p_ssid () -> string
Get the SSID being broadcast by this device in LP2P mode
Returns string: SSID, or empty string
$ 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?
$ net . get_match_flow () -> int
Get the match flow.
Returns int: The match flow.
$ 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.
Parameter Type Meaning userUserThe user handle.
Returns int: The group size.
$ 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
$ net . get_matchmaking_join_notes () -> string
Get the join notes for current matchmaking session.
Returns string: Matchmaking join notes, if available
$ net . get_matchmaking_playlist (match_defs: list ) -> list
Get the match flow and playlist the user is matchmaking into.
Parameter Type Meaning match_defslistAll available match defs.
Returns list: The match flow and, if valid, the match def, or NULL.
$ net . get_matchmaking_status () -> int
Returns the state of matchmaking
Returns int: Enum value of type vonline_matchmaking_status_t
$ net . get_midnight_madness_playlist () -> Reference
Get the midnight madness match def.
Returns Reference: Midnight madness match def.
$ net . get_new_news_messages_bg_image_index (tab_type: int ) -> int
Get the background image index of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns int: The background image index of new news messages.
$ net . get_new_news_messages_cta_1 (tab_type: int ) -> string
Get the first cta text of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns string: The first cta text of new news messages.
$ net . get_new_news_messages_cta_2 (tab_type: int ) -> string
Get the second cta text of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns string: The second cta text of new news messages.
$ net . get_new_news_messages_cta_base_color (tab_type: int ) -> vec4
Get the CTA hologram base color of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns vec4: The CTA hologram base color of new news messages.
$ net . get_new_news_messages_cta_energy_color (tab_type: int ) -> vec4
Get the CTA hologram energy color of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns vec4: The CTA hologram energy color of new news messages.
$ net . get_new_news_messages_fg_image_index (tab_type: int ) -> int
Get the foreground image index of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns int: The foreground image index of new news messages.
$ net . get_new_news_messages_length () -> int
Get the length of new news messages.
Returns int: The length of new news messages.
$ net . get_new_news_messages_message (tab_type: int ) -> string
Get the description message of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns string: The description message of new news messages.
$ net . get_new_news_messages_tab_title (tab_type: int ) -> string
Get the tab title of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns string: The tab title of new news messages.
$ 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.
$ net . get_new_news_messages_target_bundle_index (tab_type: int ) -> int
Get the target bundle index of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns int: The target bundle index of new news messages.
$ net . get_new_news_messages_title (tab_type: int ) -> string
Get the title of new news messages.
Parameter Type Meaning tab_typeintThe tab type of the new news message to look up.
Returns string: The title of new news messages.
$ net . get_nic_address (name: string ) -> int
Get the local address of a named network interface.
Parameter Type Meaning 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.
$ net . get_nic_list () -> list
Gather list of all operational network interfaces.
Returns list: List of adapter names.
$ net . get_packet_loss () -> int
Get packet loss value.
Returns int: The latest packet loss value.
$ 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.
Parameter Type Meaning 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 millisecond ping value.
Returns int: The latest ping value in ms.
$ 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.
$ net . get_reconnect_interval_ms () -> int
Get the interval which we should attempt to reconnect to the backend.
Returns int: The interval in ms.
$ net . get_region_count () -> int
Get number of available regions.
Returns int: The region count.
$ net . get_region_name (region_index: int ) -> string
Get the name of the region at region_index.
Parameter Type Meaning region_indexintThe index of the region.
Returns string: The name of the region.
$ net . get_region_override_indices () -> list
Get the preferred regions by region_index.
Returns list: The list of preferred region indices.
$ net . get_region_ping (region_index: int ) -> int
Get the ping of the region at region_index.
Parameter Type Meaning region_indexintThe index of the region.
Returns int: The ping of the region.
$ net . get_region_ping_string (region_index: int ) -> string
Get the ping display string of the region at region_index.
Parameter Type Meaning region_indexintThe index of the region.
Returns string: The display ping of the region.
$ net . get_remote_connections () -> list
Get a list of indices of all remote connections.
Returns list: List of remote connections.
$ net . get_report_error_code () -> int
Get the error code for an unsuccessful report.
Returns int: The error code for the last report.
$ net . get_report_uuid () -> string
Get the UUID for a successful report.
Returns string: The UUID for the last report.
$ 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.
$ 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.
$ net . get_server_connection () -> int
Get the index of server connection.
Returns int: The server index.
$ 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.
$ 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
$ 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?
$ net . get_server_reconnect_attempt_limit () -> int
Get the number of times a server should attempt to reconnect.
Returns int: The reconnect limit.
$ 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.
$ 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.
$ net . get_training_item_progress (user: User , ftue_training_item_index: int ) -> int
Get the persistent value for the a FTUE training item
Parameter Type Meaning userUserThe local user. ftue_training_item_indexintThe FTUE training item index
Returns int: Current FTUE training item progress.
$ net . get_training_number (user: User ) -> int
Get the persistent value for the user's current FTUE training set
Parameter Type Meaning userUserThe local user.
Returns int: Current FTUE training number.
$ net . get_unified_messaging_item_image_index (index: int ) -> int
Get the image index for a Unified Messaging item.
Parameter Type Meaning indexintThe index of the item on vonline
Returns int: The image index for the Unified Messaging item
$ net . get_unified_messaging_item_text (index: int ) -> string
Get the text for a Unified Messaging item.
Parameter Type Meaning indexintThe index of the item on vonline
Returns string: The text for a Unified Messaging item
$ net . get_unified_messaging_item_title (index: int ) -> string
Get the title for a Unified Messaging item.
Parameter Type Meaning indexintThe index of the item on vonline
Returns string: The title for a Unified Messaging item
$ net . get_unified_messaging_state () -> int
Get the state of Unified Messaging.
Returns int: Enum value of type vonline_get_unified_messages_state_t
$ net . get_user_to_spectate (user: User ) -> User
Get the user the passed-in user wants to spectate.
Parameter Type Meaning userUserThe user.
Returns User: The user to spectate, the returned user may be invalid.
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
$ 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.
$ 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.
Parameter Type Meaning 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.
$ net . grant_achievement (id: int , token: string )
Given an id and token, grant an achievement for the first party user.
Parameter Type Meaning idintThe platform-specific id for the achivement. tokenstringThe platform-specific token for the achivement.
$ 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.
Parameter Type Meaning 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.
$ 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.
Parameter Type Meaning 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.
$ 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.
$ net . in_lp2p_session () -> bool
Returns if you are currently in an lp2p session
Returns bool: True if we are in an lp2p session.
$ net . is_achievement_unlocked (id: int , token: string ) -> bool
Given an id and token, returns true if that achievement has been unlocked.
Parameter Type Meaning idintThe platform-specific id for the achivement. tokenstringThe platform-specific token for the achivement.
Returns bool: True if the achievement is unlocked.
$ 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.
$ net . is_authenticated () -> bool
Check whether we have successfully authenticated with the Viper online backend.
Returns bool: True if we are connected and authenticated.
$ net . is_authority (entity: Entity ) -> bool
True if the entity is local or if we're the server.
Parameter Type Meaning entityEntityThe entity to query.
Returns bool: True if we're authoritative over this entity.
$ 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
$ 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.
Parameter Type Meaning target_userUserThe target user.
Returns bool: Whether chat features are allowed.
$ 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.
$ net . is_data_updated () -> bool
Check if updated data has been downloaded.
Returns bool: If updated data has been downloaded.
$ 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.
$ 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.
$ 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
$ net . is_game_server_authenticated () -> bool
Are we authenticated and ready to be configured?
Returns bool: If we are connected to the backend.
$ 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.
$ 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.
$ 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.
Parameter Type Meaning userUserThe user.
Returns bool: True if the user joined in progress.
$ net . is_matchmaking () -> bool
Determine if a user is matchmaking.
Returns bool: True if the user is matchmaking.
$ net . is_package_acknowledged (package: Reference ) -> bool
Get whether all replicated entities in a package have been acknowledged by all connected users.
Parameter Type Meaning packageReferenceReference to package file.
Returns bool: True if all connected users have acknowledged all replicated entities in the package.
$ 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.
Parameter Type Meaning 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.
$ 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.
$ net . is_platform_link_down () -> bool
Is the platform network connection down?
Returns bool: True if the network link is down, False otherwise. If there is no online platform, returns True.
$ net . is_restart_needed () -> bool
Check if restarting is required in order to apply content updates.
Returns bool: If the game needs to restart.
Determine if the machine where this script is executing is a game server.
Returns bool: True if server.
$ 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.
$ 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.
$ net . is_vpn_connected () -> bool
Check if a VPN connection is active.
Returns bool: True if an active VPN connection was detected, False otherwise.
$ net . join_wifi_network (ssid: string , password: string , receiver: Component )
Attempt to join the specified WiFi network
Parameter Type Meaning ssidstringThe SSID of the WiFi network. passwordstringThe password for the WiFi network. receiverComponentComponent to receive the result event, NULL for the current entity.
$ net . leave_lp2p_session ()
Leave the current lp2p session.
$ net . lp2p_clear_advertise_data ()
Clears the scan advertise data and stops other users from seeing this user via lp2p_scan_for_peers.
$ 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.
Parameter Type Meaning durationvec4The encoded duration.
Returns float: The duration decoded and syncronized, having latency taken into effect.
$ 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.
Parameter Type Meaning durationfloatThe duration (in seconds) to encode.
Returns vec4: The encoded duration to pass to over the network.
$ net . lp2p_get_host_time_ms () -> int
Gets the host time in ms.
Returns int: The syncronized host time in ms.
$ net . lp2p_request_show_group_create_error ()
Tells the lp2p system to display the group create error.
$ 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.
Parameter Type Meaning 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.
$ 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.
Parameter Type Meaning 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.
$ 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.
Parameter Type Meaning channelintThe channel to use or 0 to reset to default.
$ 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.
Parameter Type Meaning 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.
$ net . notify_game_server_ready_for_clients ()
Tell the Viper online backend that we are ready to accept client connections.
$ net . notify_in_gameplay ()
Notify that we are currently in a multiplay game
$ net . open_browser (url: string , permitted_domains: list )
Opens a web browser to a URL, on Windows.
Parameter Type Meaning urlstringThe URL to open. permitted_domainslistOptional list specifying which domains are permitted to be access by the browser. PlayStation 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.
Parameter Type Meaning 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.
$ 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.
Parameter Type Meaning 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.
$ 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.
Parameter Type Meaning leave_time_msintThe time the user left in ms.
$ 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.
Parameter Type Meaning team_idintThe team id to add a player to.
$ net . report_crew_name (crew_guid: string , subject: string , report_category: int , report_content_type: int , location: string )
Report an offensive crew name.
Parameter Type Meaning 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.
Called when the user presses 'report server.'
$ 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.
Parameter Type Meaning 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.
$ 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.
$ net . reset_region_override_indices ()
Reset all preferred regions.
$ 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.
Parameter Type Meaning userUserThe user. playlistslistThe playlists to reset ranked skill for. seasonintThe current season.
$ 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 the game.
$ net . server_network_next_event (client_index: int , event_index: int )
Send an event to network next for a player.
Parameter Type Meaning client_indexintClient index of player for whom the event is being sent. event_indexintIndex of the event, must be in range [0,63].
$ net . server_network_next_set_event_state (state: bool )
Enable/disable network next events.
Parameter Type Meaning stateboolWhether or not Network Next events should be sent.
$ net . set_breadcrumb_step (user: User , breadcrumb_step: int , breadcrumb_step_description: string )
Set the persistent value for the user's current breadcrumb step
Parameter Type Meaning userUserThe local user. breadcrumb_stepintUpdated breadcrumb step breadcrumb_step_descriptionstringbreadcrumb step description
$ 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.
Parameter Type Meaning 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.
$ net . set_ftue_step (user: User , ftue_step: int , ftue_step_description: string )
Set the persistent value for the user's current FTUE step
Parameter Type Meaning userUserThe local user. ftue_stepintUpdated FTUE step ftue_step_descriptionstringFTUE step description
$ 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
Parameter Type Meaning userUserThe local user. ftue_training_item_indexintThe FTUE training item index ftue_training_item_progressintUpdated FTUE training item progress
$ net . set_ftue_training_number (user: User , ftue_training_number: int )
Set the persistent value for the user's current FTUE training number
Parameter Type Meaning userUserThe local user. ftue_training_numberintUpdated FTUE training number
$ net . set_game_title (title: string )
Set title of this game (Used on PS4/PS5 as of this writing).
Parameter Type Meaning titlestringThe game title.
$ 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).
Parameter Type Meaning channelintChannel to create group on (1,6,11) or 0 means find best channel and <0 means find best channel and force recreate.
$ net . set_lp2p_game_key (game_key: string )
Sets the lp2p game key from a base64 encoded string
Parameter Type Meaning game_keystringThe game key encoded as a base64 string.
$ net . set_lp2p_is_hosting (is_hosting: bool )
Tells the lp2p system if it should be hosting a group
Parameter Type Meaning is_hostingboolDetermines if a group should be hosted.
$ net . set_lp2p_is_pairing (is_pairing: bool )
Tells the lp2p system if it should be trying to pair.
Parameter Type Meaning is_pairingboolDetermines if a group should be setup for pairing.
$ net . set_lp2p_max_connections (max_connections: int )
Tells the lp2p system how many connections a group should support.
Parameter Type Meaning max_connectionsintMaximum number of karts that can connect to this group.
$ net . set_lp2p_session_user (index: int , user: User ) -> bool
Join a lp2p session with a provided id.
Parameter Type Meaning indexintThe index of the user. userUserThe user.
Returns bool: True if the operation was successful.
$ net . set_override_local_address (address: int )
Set the local network interface address to bind for replicated network traffic.
Parameter Type Meaning addressintInterface address returned by net.get_nic_address(), or zero to remove the override.
$ net . set_package_synchronize_mode (skip_unload: bool )
Adjust how the loaded package list is replicated from server to client.
Parameter Type Meaning skip_unloadboolIf true, client will retain any loaded packages not in the server's list. Otherwise, it will unload them.
$ net . set_presence_strings (strings: list )
Set the presence strings for the platform (Used on PS5 only as of this writing).
Parameter Type Meaning stringslistA list of references to the localized strings in vonline_rich_presence_state_t order.
$ net . set_recent_player_text (text: string )
Set text used to describe a recent player experience (Used on PS4 only as of this writing).
Parameter Type Meaning textstringThe text to set.
$ net . set_region_override_index (region_index: int ) -> bool
Set a preferred region by region_index.
Parameter Type Meaning region_indexintThe index of the region.
Returns bool: True on success.
$ net . set_replicated (value: bool , fields_not_replicated_by_default: bool )
Allow network replication for this type of component.
Parameter Type Meaning 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.
$ net . set_user_connected (user: User )
Mark the user as having connected to the server. Used to replace players who never connected.
Parameter Type Meaning userUserThe user who joined.
$ net . set_user_join_time (user: User , join_time: int )
Set the time a player joined the game server. Server only.
Parameter Type Meaning userUserThe user who joined. join_timeintThe time the user joined in ms.
$ net . setup_lp2p_local_friend_key (user: User )
Sets up the local friend key so it can be sent later
Parameter Type Meaning userUserThe user.
$ 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.
$ net . unset_region_override_index (region_index: int ) -> bool
Unset a preferred region by region_index.
Parameter Type Meaning region_indexintThe index of the region.
Returns bool: True on success.
$ 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.
Parameter Type Meaning 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.
$ 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.