summaryrefslogtreecommitdiffstats
path: root/modules/multiplayer/scene_replication_interface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove word duplicates in comments and strings, and fix casing and punctuationRobert Yevdokimov2024-02-231-1/+1
|
* Replace error checks against `size` with `is_empty`A Thousand Ships2024-02-091-1/+1
|
* Merge pull request #87186 from Faless/mp/fix_remote_sync_cleanupRémi Verschelde2024-02-031-0/+1
|\ | | | | | | [MP] Fix remote net ID cleanup
| * [MP] Fix remote net ID cleanupFabio Alessandrelli2024-01-141-0/+1
| | | | | | | | | | | | | | | | | | Synchronizers for spawned nodes were not correctly keeping track of the net ID assigned by the remote, preventing the replication from performing the proper cleanup. This resulted in errors being thrown when sync messages were received after despawn (which is possible due to their unreliable nature).
* | [MP] Fix spawned nodes not working after resetFabio Alessandrelli2024-01-141-4/+5
|/ | | | | | Ensures that spawnable nodes (i.e. spawned nodes over which the local instance has authority) always have a network ID, since they may lose it after the multiplayer is reset (e.g. when changing the multiplayer peer).
* Add const lvalue ref to container parametersMuller-Castro2024-01-051-2/+2
|
* [MP] Optimize internal SceneReplicationConfig accessFabio Alessandrelli2023-10-101-8/+8
| | | | Use direct pointer addressing to avoid unnecessary refs/unrefs
* [MP] Avoid unnecessary internal ref/unrefsFabio Alessandrelli2023-10-101-5/+5
| | | | | Access the various internal components (cache/replicator) via pointer, to avoid unnecessary overhead.
* [MP] Optimize internal authority checksFabio Alessandrelli2023-10-101-8/+14
| | | | | We already know which MultiplayerAPI a certain Node uses, so we don't need to retrieve it via SceneTree every time.
* [Modules] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicableA Thousand Ships2023-09-261-14/+14
|
* [MP] Fix crash when sending multiple delta variants.Fabio Alessandrelli2023-06-111-0/+1
|
* [MP] Implement "watched" properties.Fabio Alessandrelli2023-05-241-27/+155
| | | | | Checked at "delta_interval" (default = every frame), synchronized (reliably) if changes are detected.
* Minor typo and docs URL fixesRémi Verschelde2023-02-281-1/+1
|
* [MP] Add a "synchronized" signal to MultiplayerSynchronized.Fabio Alessandrelli2023-02-201-0/+1
| | | | | Emitted upon receiving a valid sync packet after setting the variables state.
* Fix multiplayer replication crash in on_sync_receive.baptr2023-02-141-2/+4
| | | | | | | | | | | | | | | | | A number of early continue cases applied the packet-provided `size` without validation, allowing large uint32_t values to be treated as negative offsets and leading to segfaults. Now, we validate `size` against the buffer length immediately to avoid a crash. This could be triggered by receiving sync data for a synchronizer who's root node had just been removed, since the code path that checked for unusable sync state failed to advance the offset. Thus the next read could interpret part of the payload as such an invalid `size`. Now, we properly advance the read offset in that case (and raise a better error).
* Convert en_GB spelling to en_US with codespellRémi Verschelde2023-01-231-1/+1
|
* [MP] Fix nested spawning during "ready".Fabio Alessandrelli2023-01-171-6/+42
| | | | | | We want our spawns to be notified after ready, but we need to notify them in the order they entered tree, so that nested spawners can be used during "ready" (instead of having to await a frame).
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* [MP] RPC visibility.Fabio Alessandrelli2022-11-201-2/+41
| | | | | | | | | | | | | | Implemented using MultiplayerSynchronizers. If you didn't use the synchronizer visibility features, nothing changes. If you were using visibility, RPCs to broadcast should now behave as expected in most configurations (i.e. by sending the RPC to _visible_ peers). If you want to limit the visibility of RPCs for a node, add a synchronizer for it, and configure the visibility via "set_visibility_for" or by adding a visibility filter.
* [MP] Initial replication profiler.Fabio Alessandrelli2022-11-191-0/+19
| | | | | | Part of the current network profiler stack. Tracks synchronizers, incoming/outgoing state sizes, and their bandwidth usage.
* [MP] Improve network profiler.Fabio Alessandrelli2022-11-171-5/+0
| | | | | | | Fix RPC profiler and add average RPC size. Improve bandwidth debugger to account for all multiplayer traffic (excluding the lower level peer transformations).
* Style: Misc docs and comment style and language fixesRémi Verschelde2022-11-021-1/+1
| | | | | | | | | | - Removed empty paragraphs in XML. - Consistently use bold style for "Example:", on a new line. - Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`). - Fix invalid usage of backticks for inline code in BBCode. - Fix some American/British English spelling inconsistencies. - Other minor fixes spotted along the way, including typo fixes with codespell. - Don't specify `@GlobalScope` for `enum` and `constant`.
* Merge pull request #67445 from Zylann/rename_queue_deleteRémi Verschelde2022-10-311-2/+2
|\ | | | | | | Rename queue_delete => queue_free
| * Rename queue_delete => queue_freeMarc Gilleron2022-10-241-2/+2
| | | | | | | | | | # Conflicts: # editor/plugins/tiles/tiles_editor_plugin.cpp
* | [MP] Let MultiplayerAPI handle packet relaying and peer signaling.Fabio Alessandrelli2022-10-271-2/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | MultiplayerPeer changes: - Adds is_server_relay_supported virtual method Informs the upper MultiplayerAPI layer if it can signal peers connected to the server to other clients, and perform packet relaying among them. - Adds get_packet_channel and get_packet_mode virtual methods Allows the MultiplayerAPI to retrieve the channel and transfer modes to use when relaying the last received packet. SceneMultiplayerPeer changes: - Implement peer signaling and packet relaying when the MultiplayerPeer advertise they are supported. ENet, WebRTC, WebSocket changes: - Removed custom code for relaying from WebSocket and ENet, and let it be handled by the upper layer. - Update WebRTC to split create_client, create_server, and create_mesh, with the latter behaving like the old initialize with "server_compatibility = false", and the first two supporting the upper layer relaying protocol.
* Fix MultiplayerSynchronizer peer visibilityWei Guo2022-10-161-3/+3
|
* [MP] Allow multiple synchronizers per node.Fabio Alessandrelli2022-10-031-142/+296
| | | | | | | | | | | | | | | | The same node can now be controlled by multiple synchronizers at once. Spawn visibility is composed in OR across multiple synchronizers (i.e. if any synchronizer is visible to the peer, the object will be spawned). Synchronizers controlling spawned nodes can now have a different authority then the one spawning the node, in that case, the spawn variables for that specific synchronizer are simply ignored (other synchronizers with the same authority of the spawner will correctly synchronize variables on spawn). The SceneReplicationState class has been completly removed, since it was bloating the implementation, the state is now simply stored in the SceneReplicationInterface.
* Add Error for synchronizer authority mismatchGuilherme Sousa2022-09-301-1/+4
|
* document multiplayer replication classes, small changes to multiplayer spawnerNathan Franke2022-07-301-0/+9
|
* Remove Signal connect bindsJuan Linietsky2022-07-291-1/+1
| | | | | Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind(). Changed all uses of it to Callable.bind()
* [Net] Modularize multiplayer, expose MultiplayerAPI to extensions.Fabio Alessandrelli2022-07-261-0/+527
- 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.