summaryrefslogtreecommitdiffstats
path: root/core/multiplayer/multiplayer_api.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Net] Modularize multiplayer, expose MultiplayerAPI to extensions.Fabio Alessandrelli2022-07-261-593/+0
| | | | | | | | | - RPC configurations are now dictionaries. - Script.get_rpc_methods renamed to Script.get_rpc_config. - Node.rpc[_id] and Callable.rpc now return an Error. - Refactor MultiplayerAPI to allow extension. - New MultiplayerAPI.rpc method with Array argument (for scripts). - Move the default MultiplayerAPI implementation to a module.
* Add peer visibility to MultiplayerSynchronizer.Fabio Alessandrelli2022-07-201-2/+6
| | | | | | | | | | | | | | | | | | | MultiplayerSynchronizers can now be configured to limit their visibility to a subset of the connected peers, if the synchronized node was spawned by a MultiplayerSpawner (either automatically or via custom spawn) the given node will also be despawned remotely. The replication system doesn't have the logic to handle subspawn directly, but it is possible to handle them appropriately by manually updating the visibility of the parent before changing the one of the nested spawns via the "update_visibility" function. The visibility of each MultiplayerSynchronizer can be controlled by adding or remove filters via "[add|remove]_visibility_filter(callable)". To further optimize the network code, visibility filters can be configured to be automatically updated during idle or physics frame, or set to always require manual update (via the "update_visibility" function).
* Use range iterators for RBSet in most casesAaron Record2022-05-191-2/+2
|
* Replace most uses of Map by HashMapreduz2022-05-161-1/+1
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* [Debugger] Move most profilers to ServersDebugger.Fabio Alessandrelli2022-02-061-1/+0
| | | | | Also splits bandwidth/rpc profiler (RPCProfiler is now in SceneDebugger).
* [Net] Move RPC, Node cache out of MultiplayerAPI.Fabio Alessandrelli2022-02-051-198/+39
| | | | | | | | | Now uses two interfaces so it can be overridden in the future, and core no longer depends on Node. The interfaces are implements in scene/multiplayer. Replaces root_node with root_path. Remove all Node references from MultiplayerAPI.
* [Net] New replication interface, spawner and synchronizer nodes.Fabio Alessandrelli2022-02-041-26/+107
| | | | | | | | | | | | | | | | | | Initial implementation of the MultiplayerReplicationInterface and its default implementation (SceneReplicationInterface). New MultiplayerSpawner node helps dealing with instantiation of scenes on remote peers (e.g. clients). It supports both custom spawns via a `_spawn_custom` virtual function, and optional auto-spawn of known scenes via a TypedArray<PackedScenes> property. New MultiplayerSynchornizer helps synchronizing states between the local and remote peers, supports both sync and spawn properties and is configured via a `SceneReplicationConfig` resource. It can also sync via path (i.e. without being spawned by a MultiplayerSpawner if both peers has it in tree, but will not send the spawn state in that case, only the sync one.
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Multiplayer networking renames/simplificationMax Hilbrunner2021-09-081-70/+70
| | | | Removes _networking_ prefix from some methods and members, now that multiplayer has been largely moved out of Node and SceneTree and is seperated into its own set of classes.
* [Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli2021-09-071-0/+668
Move multiplayer classes to "core/multiplayer" subdir. Move the RPCConfig and enums (TransferMode, RPCMode) to a separate file (multiplayer.h), and bind them to the global namespace. Move the RPC handling code to its own class (RPCManager). Renames "get_rpc_sender_id" to "get_remote_sender_id".