does script execute on server or client?

froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

does script execute on server or client?

Post by froo »

Question.
I cannot remember if a script executes on the trueServe computer, or the client's computer.
Is it possible to control that?

Reason I am asking is this. If we can force a script to execute on the server, then that script can have a For loop
in it, which does nothing: for (x = 0; x < 10000; x++ ) { ;; }
which could serve as a replacement for a timer or paused activity loop.
Every client (visitor) sees the script execute at the same rate then.
User avatar
3dvisuals dude
Chief Warrant Officer
Posts: 643
Joined: 03 Jun 2009, 02:53
Type the number ten into the box: 0

Re: does script execute on server or client?

Post by 3dvisuals dude »

froo wrote:Question.
I cannot remember if a script executes on the trueServe computer, or the client's computer.
Is it possible to control that?

Reason I am asking is this. If we can force a script to execute on the server, then that script can have a For loop
in it, which does nothing: for (x = 0; x < 10000; x++ ) { ;; }
which could serve as a replacement for a timer or paused activity loop.
Every client (visitor) sees the script execute at the same rate then.
We tested this concept of server-side versus client-side scripting a lot together you and I and Norm back when you were working so hard on the MySql Database Integration with trueServe in 2007-8

Scripts can and in many cases should be run Server-side in order for all present to reap the benefits versus one computer reaping them while another computer present may not. Also of course some scripts involve security issues requiring that they be run Server-side.

Remember we would think them through together and discuss them, you would write a modification accordingly and submit it to Norm who had Server Admin priveleges to add the modifications to the Server, which we were unable to do.
Image "Advantage is had from whatever is there, but usefulness arises from whatever is not." - Lao Tzu (Tao Te Ching - 500 BC) Image
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: does script execute on server or client?

Post by froo »

Ah ok. thanks 3dv! It's been a loooong time since I was working with scripts. I was working on plugins
for quite some time there.
User avatar
3dvisuals dude
Chief Warrant Officer
Posts: 643
Joined: 03 Jun 2009, 02:53
Type the number ten into the box: 0

Re: does script execute on server or client?

Post by 3dvisuals dude »

froo wrote:Ah ok. thanks 3dv! It's been a loooong time since I was working with scripts. I was working on plugins
for quite some time there.
yeah i know how it gets... we all get our grey-matter so engrossed in a complicated field of endeavor over an extended period of time, and before you know it we forget our own names, lol. :D

I think Norm placed the server side stuff so high in the scenegraph that no one else could access them. ;)
Image "Advantage is had from whatever is there, but usefulness arises from whatever is not." - Lao Tzu (Tao Te Ching - 500 BC) Image
noko
Senior Chief Petty Officer
Posts: 170
Joined: 24 May 2009, 04:16

Re: does script execute on server or client?

Post by noko »

Having a consistent timing event (timer) that is part of all scenes when one is connected I would think would allow animated shaders, mechanical type devices (like wind mills, machines, orbits etc.) to be consistent. Now couldn't the server just update the client timer periodically to ensure everyone is in sysnc plus to minimize net traffic? For example server sends out timing point every 5 seconds while the client timer does all the in betweens.
Cayenne
Chief Petty Officer
Posts: 119
Joined: 03 Jun 2009, 20:05
Type the number ten into the box: 0
Location: U.K.

Re: does script execute on server or client?

Post by Cayenne »

in the Activities My Activities , theres an object Vladimir wrote called Windmill .

I dont know exactly how to use it but as far as i know it is able to detect whether a script is execution on the server or client or local , it might help to look at the object and get some understanding , it might be useful to use to debug scripts running locations , Im also not sure if it has a SS specific timer inside it either.
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: does script execute on server or client?

Post by froo »

Ok thanks Cayenne. :bananacheers:
User avatar
3dvisuals dude
Chief Warrant Officer
Posts: 643
Joined: 03 Jun 2009, 02:53
Type the number ten into the box: 0

Re: does script execute on server or client?

Post by 3dvisuals dude »

Somewhere on my other computer I still have many of those old scriptorium (pre-Beta) scenes saved still, including a few where you and Norm were experimenting with serverside database scripts. Maybe i can dredge up some useful tidbits from those. ;)
Image "Advantage is had from whatever is there, but usefulness arises from whatever is not." - Lao Tzu (Tao Te Ching - 500 BC) Image

Return to “Our Shared Space Community”