MultiplayerPeerExtension requires more overrides than docs specify
Godot version
4.0-stable
System information
Linux
Issue description
https://docs.godotengine.org/en/stable/classes/class_multiplayerpeerextension.html#class-multiplayerpeerextension says:
All the methods below must be implemented to have a working custom multiplayer implementation
I've implemented all methods listed in the docs, but I get:
ERROR: Required virtual method MultiplayerPeerExtension::_get_packet_channel must be overridden before calling.
at: _gdvirtual__get_packet_channel_call (scene/main/multiplayer_peer.h:142)
ERROR: Required virtual method MultiplayerPeerExtension::_get_packet_mode must be overridden before calling.
These aren't mentioned in the docs. I'm not sure if this is just a doc issue or an implementation issue.
Steps to reproduce
- Extend
MultiplayerPeerExtensionin GDScript - Implement all methods listed in the docs
- Try to use it as a multiplayer peer.
Minimal reproduction project
Just adding this here since I'm not sure it merits it's own issue:
The docs for NetworkedMultiplayerCustom::initialize in Godot3.5 used to say:
Initialize the peer with the given peer_id (must be between 1 and 2147483647).
I don't see that mentioned in the 4.0 docs for MultiplayerPeer or MultiplayerPeerExtension. Is that still a limitation? The source for generate_unique_id suggests it might be:
https://github.com/godotengine/godot/blob/92bee43adba8d2401ef40e2480e53087bcb1eaf1/scene/main/multiplayer_peer.cpp#L51
Thanks for the report!
I think what happened is that MultiplayerPeerExtension was added, and then later _get_packet_channel() and _get_packet_mode() were added, but they didn't get fully integrated into MultiplayerPeerExtension.
I think PR #75116 should fix it!
Thanks! While you're editing those docs, would you happen to know if the unique ID still needs to fit into a uint31? https://github.com/godotengine/godot/issues/74628#issuecomment-1463717863
Ah, yes, I think that's still true. I added a note about it to the docs for MultiplayerPeerExtension._get_unique_id() in my latest push on PR #75116