pub struct GodotGGRSP2PSpectatorSession { /* private fields */ }
Expand description

A Godot implementation of P2PSpectatorSession

Implementations

Creates a P2PSpectatorSession, call this when you want to start setting up a P2PSpectatorSession. Takes the local port and total number of players and the host address as parameters.

👎 Deprecated since 0.5.0:

please use create_new_session() instead

Deprecated method to create a P2PSpectatorSession. Use Self::create_new_session() instead.

Returns true if connection has been established with remote players and is ready to start advancing frames via Self::advance_frame()

Returns the current sate of the session as a String. See SessionState for all possible states.

Starts the P2PSpectatorSession

Errors

Sets the callback node that will be called when using Self::advance_frame()

This function will advance the frame using the inputs received from the host_session. Before using this function you have to set the callback node and make sure it has the following callback functions implemented

Errors

Returns P2PSpectatorSession::frames_behind_host()

Errors

Sets P2PSpectatorSession::set_catchup_speed()

Errors

Sets P2PSpectatorSession::set_max_frames_behind()

Errors

Calls P2PSpectatorSession::poll_remote_clients()

Errors

Sets P2PSpectatorSession::set_fps()

Errors

Prints out network stats of host address

Errors

Will return network stats of host address as a tuple, which will be converted to an Array inside godot.

Errors

Returns an Array of events which contain usefull information, while you don’t have to implement everything, the one thing you should implement is the WaitRecommendation. For details regarding the events please take a loot at GGRSEvent.

Example
var events = ggrs.get_events()
for item in events:
    match item[0]:
        "WaitRecommendation":
            frames_to_skip += item[1]
        "NetworkInterrupted":
            var handle = item[1][0]
            var disconnect_timeout = item[1][1]
        "NetworkResumed":
            var handle = item[1]
        "Disconnected":
            var handle = item[1]
        "Synchronized":
            var handle = item[1]
        "Synchronizing":
            var handle = item[1][0]
            var total = item[1][1]
            var count = item[1][2]
Errors

Trait Implementations

Base type of the class. Read more

User-data wrapper type of the class. Read more

The name of the class. Read more

Function that creates a value of Self, used for the script-instance. The default implementation simply panics. Read more

Register any exported properties to Godot.

Convenience method to create an Instance<Self, Unique>. This is a new Self::Base with the script attached. Read more

Convenience method to emplace self into an Instance<Self, Unique>. This is a new Self::Base with the script attached. Read more

Function that registers all exposed methods to Godot.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.