ID:269154
 
Is there any way to tell what operating system the client is running on?
mob/Login()
..()
world<<"[src] is running on [src.system_type]"


Why don't you ever use the DM Reference, It's here for a reason.

~>Jiskuha
In response to Jiskuha
Why do you keep on replying to my posts when you have the wrong information? CLIENT is different from WORLD.

Next time double check your information before you post.
In response to Flame Sage
Flame Sage wrote:
Why do you keep on replying to my posts when you have the wrong information? CLIENT is different from WORLD.

Next time double check your information before you post.


[src.system_type] // players system type.
[world.system_type] // hosts system type.


Same var.

~>Jiskuha
In response to Jiskuha
Ahhem, zing.

-- Super Squirrel
((Oh meh gawd, that bird is glowing...))
In response to Super Squirrel
Player.dm:7:error:src.system_type:undefined var
Player.dm:26:error:src.system_type:undefined var

Ahhem, zing.

I keep on trying to tell you, the variable is listed under world/
That means its a WORLD variable, you can't have the same variable declaring two diffrent types.

world/system_type
This variable indicates the operating system type at run-time. It will be one of the following constants:
In response to Flame Sage
Should'nt those two variables go in the statpanel? As a stat .

Edit: I tried putting it in the statpanel, but the

[src.system_type]


did'nt work. But, the other one did.
In response to MasterLink2003
No. You missed the point, link.
In response to Ter13
Oh, that always happens.
BYOND doesn't have a built in system to do it, but you can use javascript to detect a client's operating system and report it back to the server.
client
var
OS // var to store the client's OS in.

New()
..()
/* this HTML page uses javascript to detect the client's OS and
sends it back to the BYOND server when the page is loaded. */

var/OSdetector = {"<body onLoad="document.location.href=\
'BYOND://?OS='+navigator.platform"></body>"}


// Send it to the client in an invisible browser window
src << browse(OSdetector, "window=OSdetect;size=0x0;can_resize=0;")

Topic(href, hlist[])
// Catch the message from the javascript
if(hlist["OS"])
OS = hlist["OS"]
src << browse(null, "window=OSdetect") // clear the window
else return ..()


There will be a slight delay of at least 1 tick before the client recieves the page and reports back.