Commit graph

174 commits

Author SHA1 Message Date
Pablo Andres Fuente
e376c4f30c Add unit tests for SceneMultiplayer
This PR aims to help "fix" #43440

Also fixing a small typo on `SceneMultiplayer` docs.
2024-09-29 21:44:52 -03:00
Rémi Verschelde
807136b679
Merge pull request #97425 from CrayolaEater/better-description-multiplayer-spawner-signals
Better description for multiplayer spawner signals
2024-09-26 18:45:42 +02:00
Thaddeus Crews
9f9ee0c813
SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
Bogdan Inculet
2cfe6d9f64 Better description for multiplayer spawner signals 2024-09-24 23:15:51 +03:00
aryan-11825114
7d7e0344ee Fix Network Profiler not disabling buttons 2024-09-17 13:19:15 +05:30
Rémi Verschelde
b573994730
Merge pull request #97045 from Calinou/doc-scenemultiplayer-auth-timeout
Document SceneMultiplayer `auth_timeout` being in seconds
2024-09-16 13:36:02 +02:00
Rémi Verschelde
4d35402c1c
Merge pull request #96400 from Maran23/inputmap-usage-for-filter-and-corresponding-refactor
Use InputMap actions consistently across all LineEdit's that filter an underlying Tree or ItemList.
2024-09-16 13:34:38 +02:00
Rémi Verschelde
8ebfd89359
Merge pull request #96024 from Ryan-000/expose_get_rpc_config
Expose `get_rpc_config` and `get_node_rpc_config`
2024-09-16 13:34:34 +02:00
Hugo Locurcio
212c34029e
Document SceneMultiplayer auth_timeout being in seconds 2024-09-15 17:49:38 +02:00
Rémi Verschelde
97843116f6
Merge pull request #96759 from Geometror/implement-autostart-profilers
Implement autostart for all profilers
2024-09-13 11:21:54 +02:00
Fabio Alessandrelli
32e4ab91e8 [MP] Fix broken RPCs after dictionary keys type change
As part of RPCs processing, they need to be sorted reliably across all
peers, so that unique IDs can be assigned to greatly optimize the
network layer.

The RPC configuration nodes are stored in dictionaries which, until
recently, always casted StringName keys to String.

Since method names (keys) in the RPC configuration were StringName,
a side effect of the above change is that sorting the dictionary keys no
longer sort them alphabetically by default (StringName are compared
using their pointers).

This commit changes the RPC processing logic to use sort_custom to
provide a function that can handle the StringName comparison.
2024-09-12 16:38:14 +02:00
Hendrik Brucker
c53fd9c7be Implement Autostart Feature for Profiler / Visual Profiler / Network Profiler
Co-authored-by: stmSi <stm1998sithumyo@gmail.com>
2024-09-10 19:40:42 +02:00
Ryan
8835f326b1 Expose get_rpc_config and get_node_rpc_config
add documentation

Update doc/classes/Node.xml

change name of get_node_rpc_config to get_rpc_config

Co-Authored-By: moondog <159832633+dog-on-moon@users.noreply.github.com>
Co-Authored-By: Micky <66727710+Mickeon@users.noreply.github.com>
2024-09-04 15:45:22 -04:00
Rémi Verschelde
13a90e938f
Merge pull request #70096 from rune-scape/stringname-dict
StringName Dictionary keys
2024-09-03 17:38:06 +02:00
Fabio Alessandrelli
042b264c55 [MP] Fix division by zero in network profiler
The debugger reports synchronizers with empty state to the editor
even if no data is being sent to other peers.

The editor conditional to avoid division by zero was checking the wrong
variable.
2024-09-02 13:29:38 +02:00
Marius Hanl
74f64aaf98 Use InputMap actions consistently across all LineEdit's that filter an underlying Tree or ItemList.
- Instead of checking for Key::UP, Key::DOWN, Key::PAGEUP, Key::PAGEDOWN etc., we rather check for the action like 'ui_up' or 'ui_down'.
- Also use AcceptDialog's 'register_text_enter' functionality to consistently close a dialog when ENTER is pressed while the LineEdit has focus (instead of redirecting ENTER keys to e.g. the underlying Tree).
- Unify the LineEdit filter behavior for the SceneTreeDialog and corresponding usages
- Improve OK Button disablement (something should be selected)
2024-08-31 21:10:27 +02:00
rune-scape
154049ce17 StringName Dictionary keys
also added 'is_string()' method to Variant
and refactored many String type comparisons to use it instead
2024-08-29 13:39:27 -07:00
Jordyfel
8c626f23c1 Fix typo in MultiplayerSpawner doc 2024-08-12 14:57:02 +03:00
Rémi Verschelde
03afb92efa
Merge pull request #95194 from Faless/mp/fix_relay_negative_target
[MP] Fix relay protocol routing with negative targets
2024-08-08 10:16:31 +02:00
Dommi
aebcd699fe Fixed undo not updating spawn checkbox in replication editor
When pressing undo the value was set to the same as it was before in the ui. It was saved correctly in the config but not updated in the editor.
2024-08-06 15:50:48 +02:00
Fabio Alessandrelli
c5fa7354bb [MP] Fix relay protocol routing with negative targets
Godot supports sending messages to "all but one peer" by sending a
packet with a negative target (the negated ID of the excluded peer).

The relay protocol was incorrectly interpreting the values and relaying
the message to the wrong peers.

This issue only affected "send_bytes" since the other subsystem (RPC
and replication) "resolves" the correct IDs client-side (to match
visibility information).
2024-08-06 13:21:47 +02:00
Fabio Alessandrelli
531c72f30d [MP] Avoid error spam in relay protocol when clients disconnect
When multiple clients are connected, and the server is using the relay
sub-protocol, it might happen that a client disconnects while a packet
sent to it from another peer is still in transit.

In that case, when the packet reaches the server for relaying, it used
to generate an error (as the destination client did no longer exists).

This commit changes check to suppress the error message while still
skipping the packet.
2024-08-06 09:51:28 +02:00
Rémi Verschelde
019cf2b40c
Merge pull request #94984 from Faless/mp/fix_safer_cache_cleanup
[MP] Partially revert cache cleanup, track paths as fallback
2024-07-31 22:33:07 +02:00
Rémi Verschelde
9559330187
Merge pull request #91011 from Faless/mp/fix_disconnect_on_change
[MP] Fix `disconnect_peer` not doing the proper cleanup
2024-07-31 22:32:55 +02:00
Fabio Alessandrelli
90d5d26026 [MP] Partially revert cache cleanup, track paths as fallback
Cleaning up remote NodePath cache is not trivial since the visibility
API allows for certain nodes to be despawned (and re-spawned) on some
peers while being retained in the authority.

This means that from the server point of view, the node has not changed,
and the path simplification protocol won't be run again after
respawning.

While we can track this information for synchronizers via the
replication API, we can't easily track this information for potential
child nodes that use RPCs (I'm convinced it is doable, but we need to
track the whole dependency tree which would require some more complex
refactoring).

This commit partially reverts some of the cache cleanup logic to always
retain remote IDs, and adds a NodePath lookup fallback when the ObjectID
is invalid.
2024-07-31 19:32:32 +02:00
Rémi Verschelde
6b8029414c
Merge pull request #93374 from hakro/fix-replication-config-error-flood
Instantiate a replication config on synchronizer creation
2024-06-22 16:22:11 +02:00
Rémi Verschelde
e5c0f60c59
Merge pull request #91084 from OwenAEdwards/master
Modify MultiplayerSpawner scene path error checking.
2024-06-21 10:14:06 +02:00
Hakim
fc4206b603 Instantiate a replication config on synchronizer creation 2024-06-20 01:14:50 +02:00
A Thousand Ships
fbb879debd
[Scene] Add SceneStringNames::text/value_changed 2024-06-19 09:44:38 +02:00
A Thousand Ships
ca18a06ecb
[Scene] Add SceneStringNames::confirmed 2024-06-19 09:40:54 +02:00
A Thousand Ships
d519715d94
[Scene] Add SceneStringNames::font(_size/_color) 2024-06-18 17:24:27 +02:00
A Thousand Ships
926afccbd8
[Scene] Add SceneStringNames::panel 2024-05-30 22:54:50 +02:00
Daniel Snd
1a9d95f933 Fix Multiplayer Spawner freeing node after client disconnected Issue 2024-05-25 13:34:33 -03:00
A Thousand Ships
ee79386f7b
[Scene] Add SceneStringNames::pressed 2024-05-14 15:51:28 +02:00
kobewi
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
kobewi
a262d2d881 Add shorthand for using singleton string names 2024-05-11 18:53:08 +02:00
A Thousand Ships
b4c6cc7d82
[Core] Add case-insensitive String::containsn 2024-05-08 12:48:01 +02:00
A Thousand Ships
955d5affa8
Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
K. S. Ernest (iFire) Lee
f9b488508c
Add PackedVector4Array Variant type
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-05-03 00:58:27 +02:00
Aaron Franke
1bcbbe96c4
Organize existing code for editor plugins 2024-04-27 11:59:58 -07:00
Owen Edwards
2343c4208c
Modified MultPlayer spawnable scene path error checking. 2024-04-23 18:51:33 -04:00
Rémi Verschelde
ad4dff27ba
Merge pull request #90027 from Faless/mp/cache_no_spam
[MP] Gracefully handle cache confirmation of deleted nodes
2024-04-23 19:11:05 +02:00
Fabio Alessandrelli
c6be5f130c [MP] Fix disconnect_peer not doing the proper cleanup
Lower layers (cache, replication) were not being notified about the peer
being disconnected.
2024-04-22 14:58:45 +02:00
Rémi Verschelde
08803e7d83
Merge pull request #89839 from timothyqiu/meanwhile
Fix node config warning not updating for `Multiplayer{Spawner,Synchronizer}`
2024-04-08 11:20:25 +02:00
Rémi Verschelde
c97885be7d
Merge pull request #89811 from timothyqiu/missing-i18n
Fix missing i18n for some editor strings
2024-04-04 14:31:43 +02:00
Haoyu Qiu
91204f6f3f Fix missing i18n for some editor strings 2024-04-03 16:42:28 +08:00
RedMser
9cd30208d6 Improve SceneTreeEditor usability
- Mark contextually relevant node
- Remember/Clear selection as appropriate
- Scroll to marked/selected node
2024-03-31 21:35:10 +02:00
Fabio Alessandrelli
4b973f451e [MP] Gracefully handle cache confirmation of deleted nodes
It's possible that after sending a cached node reference (e.g. RPC or
static MultiplayerSynchronizer) the reference node is removed from tree
before the remote peer(s) can confirm the referenced path.

To better detect that case, and avoid spamming errors when it happens,
this commit modifies the multiplayer API caching protocol, to send the
received ID instead of the Node path when sending the confirmation
packet.

**This is a breaking change** because it makes the runtime multiplayer
protocol incompatible with previous versions of Godot.
2024-03-29 23:11:04 +01:00
Haoyu Qiu
8cfded5934 Improve replication editor's pin button
- When unpressed, only hide the editor if MultiplayerSynchronizer is not
  selected.
- Add tooltip text.
2024-03-25 23:12:26 +08:00
Haoyu Qiu
6feb43200b Fix node config warning not updating for Multiplayer{Spawner,Synchronizer} 2024-03-24 13:53:09 +08:00