Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a more detailed system version info to OS class #304

Open
lupoDharkael opened this issue Dec 14, 2019 · 2 comments
Open

Add a more detailed system version info to OS class #304

lupoDharkael opened this issue Dec 14, 2019 · 2 comments

Comments

@lupoDharkael
Copy link

lupoDharkael commented Dec 14, 2019

Describe the project you are working on:
irrelevant.

Describe the problem or limitation you are having in your project:
I'd like to implement automatic reporting so I can know better about the userbase of my game. he actual state of the OS class allows to know if the system is "Linux" or "Windows" but I'd like to have specific information of the system version/distro.

It would be useful for godotengine/godot#24780 if it gets implemented.

Describe how this feature / enhancement will help you overcome this problem or limitation:
I'd implement 3 new methods in the OS singleton:
get_system_name(), get_build_number() and get_system_version().

Note: the following examples of every method show the output of a Fedora 31 and W10 education system.

  • get_system_name:
    returns the specific name of the system (or distro).
    i.e. Fedora, Microsoft Windows 10 Education, etc.

  • get_build_number:
    returns the build number of the system.
    i.e. 5.3.15-300.fc31.x86_64, 17134, etc.

  • get_system_version:
    returns the system version of the system.
    i.e. 31 (KDE Plasma), 10.0.17134, etc.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
irrelevant.

Describe implementation detail for your proposal (in code), if possible:
Linux:

  • get_system_name: field NAME in /etc/os-release
  • get_build_number: uname -r
  • get_system_version: field VERSION in /etc/os-release

Windows:

  • get_system_name, get_build_number and get_system_version:
    You can use wmic to obtain that information:
    image
    This command requires admin in windows XP but this isn't a problem as Godot targets Windows 7+

If this enhancement will not be used often, can it be worked around with a few lines of script?:
I don't think this can be implemented in a few lines for every supported platform.

Is there a reason why this should be core and not an add-on in the asset library?:
It could be an asset but I think this should be a well maintained feature in the engine and most important multiplatform engines have methods to obtain system version info.

@lupoDharkael
Copy link
Author

If maintaining those 3 for every platform is considered too much work we could consider something like the API in Unity3D: https://docs.unity3d.com/ScriptReference/SystemInfo-operatingSystem.html
A single method returning al the info in one string.

@Calinou
Copy link
Member

Calinou commented Mar 19, 2020

What's the use case for get_build_number() once you have get_system_name() and get_system_version()? It does bring some extra information, but I'm not sure how useful it is to have.

My concern is that the concept of "build number" might be difficult to translate to Linux/macOS and other platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants