|
GodotMattohaLobbySystem 0.2.4
|
Public Member Functions | |
| delegate void | ServerRpcReceivedEventHandler (string methodName, Dictionary< string, Variant > payload, long sender) |
| Emmited on server when a server rpc received. | |
| delegate void | ClientRpcReceivedEventHandler (string methodName, Dictionary< string, Variant > payload, long sender) |
| Emmited on client when a client rpc received. | |
| override void | _Ready () |
| Node | GetLobbyNodeFor (Node node) |
| Get lobby node from a given node. | |
| void | StartServer () |
| Start Server that clients wil connect to. | |
| void | StartClient () |
| Establish a connection to server. | |
| Node | CreateInstance (string sceneFile) |
| Used to create an instance from scene, use this method to initialize instance if the instance will be spawned for all players or has MattohaSpawner node. | |
| Node | CreateInstance (PackedScene scene) |
| Used to create an instance from scene, use this method to initialize instance if the instance will be spawned for all players or has MattohaSpawner node. | |
| void | SpawnNodeFromPayload (Dictionary< string, Variant > payload) |
| spawn a node by a payload generated by "GenerateNodePayloadData()", this method is used under the hood to spawn nodes. | |
| void | DespawnNodeFromPayload (Dictionary< string, Variant > payload) |
| despawn a node by a payload generated by "GenerateNodePayloadData()", this method is used under the hood to despawn nodes. | |
| Dictionary< string, Variant > | GenerateNodePayloadData (Node node, Array< string > additionalProps=null) |
| Generate a spawning payload form a given node, this method is used under the hood to generate payloads for spawning nodes across players. | |
| void | SendReliableServerRpc (string methodName, Dictionary< string, Variant > payload) |
| Send reliable server RPC to server, this will emmit "ServerRpcReceived". | |
| void | SendReliableClientRpc (long peer, string methodName, Dictionary< string, Variant > payload) |
| Send reliable client RPC to peer, this will emmit "ClientRpcReceived". | |
| bool | IsNodeOwner (Node node) |
| Check if (current player) is the owner of the spawned node or a given node. | |
| bool | IsLobbyOwner () |
| Check if (Current client) is the owner of the lobby. | |
Static Public Member Functions | |
| static int | ExtractLobbyId (string nodePath) |
| Extract Lobby ID from node path, all lobby games has "LobbyNN" when NN is the lobby ID. | |
Properties | |
| string | Address = "127.0.0.1" [get, set] |
| int | Port = 7001 [get, set] |
| int | MaxChannels = 5 [get, set] |
| int | MaxPlayers = 4000 [get, set] |
| int | MaxLobbiesCount = 100 [get, set] |
| int | MaxPlayersPerLobby = 10 [get, set] |
| bool | AutoLoadAvailableLobbies = true [get, set] |
| When lobby data changed or game started, auto load available lobbies for all online players. | |
| MattohaServer | Server [get] |
| MattohaClient | Client [get] |
| long | LobbySize = 5000 [get, set] |
| Server split lobbies along x axis, specify lobby size will prevent overlapping available lobbies. | |
| static MattohaSystem | Instance [get, set] |
| delegate void Mattoha.Nodes.MattohaSystem.ClientRpcReceivedEventHandler | ( | string | methodName, |
| Dictionary< string, Variant > | payload, | ||
| long | sender ) |
Emmited on client when a client rpc received.
| methodName | method name to call. |
| payload | payload as godot dictionaty. |
| sender | peer id who send the rpc. |
| Node Mattoha.Nodes.MattohaSystem.CreateInstance | ( | PackedScene | scene | ) |
Used to create an instance from scene, use this method to initialize instance if the instance will be spawned for all players or has MattohaSpawner node.
| scene | PackedScene to initialize from. |
| Node Mattoha.Nodes.MattohaSystem.CreateInstance | ( | string | sceneFile | ) |
Used to create an instance from scene, use this method to initialize instance if the instance will be spawned for all players or has MattohaSpawner node.
| sceneFile | Scene file to initialize from. |
| void Mattoha.Nodes.MattohaSystem.DespawnNodeFromPayload | ( | Dictionary< string, Variant > | payload | ) |
despawn a node by a payload generated by "GenerateNodePayloadData()", this method is used under the hood to despawn nodes.
| payload | spawn node payload |
|
static |
Extract Lobby ID from node path, all lobby games has "LobbyNN" when NN is the lobby ID.
| nodePath | node path to extract lobby id from. |
| Dictionary< string, Variant > Mattoha.Nodes.MattohaSystem.GenerateNodePayloadData | ( | Node | node, |
| Array< string > | additionalProps = null ) |
Generate a spawning payload form a given node, this method is used under the hood to generate payloads for spawning nodes across players.
| node | Node object (should be in game tree) |
| additionalProps | Additional properties to get from node, these will be synced to other players. |
| bool Mattoha.Nodes.MattohaSystem.IsLobbyOwner | ( | ) |
Check if (Current client) is the owner of the lobby.
| bool Mattoha.Nodes.MattohaSystem.IsNodeOwner | ( | Node | node | ) |
Check if (current player) is the owner of the spawned node or a given node.
| node |
| void Mattoha.Nodes.MattohaSystem.SendReliableClientRpc | ( | long | peer, |
| string | methodName, | ||
| Dictionary< string, Variant > | payload ) |
Send reliable client RPC to peer, this will emmit "ClientRpcReceived".
| peer | peer id that will recive the event, 0 for all |
| methodName | method name you want to handle. |
| payload |
| void Mattoha.Nodes.MattohaSystem.SendReliableServerRpc | ( | string | methodName, |
| Dictionary< string, Variant > | payload ) |
Send reliable server RPC to server, this will emmit "ServerRpcReceived".
| methodName | method name you want to handle. |
| payload |
| delegate void Mattoha.Nodes.MattohaSystem.ServerRpcReceivedEventHandler | ( | string | methodName, |
| Dictionary< string, Variant > | payload, | ||
| long | sender ) |
Emmited on server when a server rpc received.
| methodName | method name to call. |
| payload | payload as godot dictionaty. |
| sender | peer id who send the rpc. |
| void Mattoha.Nodes.MattohaSystem.SpawnNodeFromPayload | ( | Dictionary< string, Variant > | payload | ) |
spawn a node by a payload generated by "GenerateNodePayloadData()", this method is used under the hood to spawn nodes.
| payload | spawn node payload |