diff --git a/core/os/os.cpp b/core/os/os.cpp index d450407c905..901fa8b7351 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -515,7 +515,7 @@ void OS::swap_buffers() { } String OS::get_unique_id() const { - ERR_FAIL_V(""); + return ""; } int OS::get_processor_count() const { diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index a393cdff8e2..d9977ee27ad 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -550,7 +550,7 @@ Returns a string that is unique to the device. [b]Note:[/b] This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by [method get_unique_id] for security purposes. - [b]Note:[/b] Returns an empty string on HTML5, as this method isn't implemented on this platform yet. + [b]Note:[/b] Returns an empty string and prints an error on HTML5, as this method cannot be implemented on this platform. diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index b5b01294f2f..c89640d6923 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -1005,6 +1005,10 @@ int OS_JavaScript::get_processor_count() const { return godot_js_os_hw_concurrency_get(); } +String OS_JavaScript::get_unique_id() const { + ERR_FAIL_V_MSG("", "OS::get_unique_id() is not available on the HTML5 platform."); +} + bool OS_JavaScript::_check_internal_feature_support(const String &p_feature) { if (p_feature == "HTML5" || p_feature == "web") { return true; diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 3d02cb095af..1d20367c90a 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -194,6 +194,7 @@ public: virtual int get_process_id() const; bool is_process_running(const ProcessID &p_pid) const; int get_processor_count() const; + String get_unique_id() const; virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); virtual void set_window_title(const String &p_title);