godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.57k stars 2.96k forks source link

Custom Godot Server page uses Godot 3.x API #9525

Open DrRevert opened 5 days ago

DrRevert commented 5 days ago

Your Godot version: 4.2 Issue description: Example code in the HilbertHotel::init() function on the "Custom Godot Server" page uses static methods Thread::create and Mutex::create which don't exist in 4.x version of the engine. In HilbertHotel::finish() Thread::wait_to_finish() is used as static function, even though it is not static in 4.x

The register_types.cpp example code is using 3.x function names register_hilbert_hotel_types instead of initialize_hilbert_hotel_module

URL to the documentation page: https://docs.godotengine.org/en/stable/contributing/development/core_and_modules/custom_godot_servers.html

DrRevert commented 5 days ago

Is the dummy class (in this example _HilbertHotel with an underscore) still required for binding? As I understand this class used to prevent Godot to create another instance of the singleton when retrieving default values of the properties. But currently all the builtin singletons are added during the MODULE_INITALIZATION_LEVEL_SERVERS so the engine is aware to not create another temporary instance of those classes.