Cuberite Forum
OS - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: OS (/thread-1288.html)



OS - NiLSPACE - 12-28-2013

I think a plugin should be able to know on what OS the server is running. Something like GetOSType() and for windows it return "win" or something. Or maybe a IsOsWindows() function.


RE: OS - xoft - 12-28-2013

Why would you need that? Is there anything that a plugin needs to do OS-specific?


RE: OS - NiLSPACE - 12-28-2013

I think it could maybe be usefull because Linux has different commands then Windows. I don't know any command that I could use for an example though.


RE: OS - xoft - 12-28-2013

I don't think plugins should use any OS commands. Most of the time plugins execute in the context of the tick thread (and if they don't the tick thread still has to wait for the plugin execution to end), so anything a plugin does should not exceed the 1/20 of a second allotted for one game tick. Most OS commands will not fit into this limit.