Worldtimeclock for shared spaces

Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Worldtimeclock for shared spaces

Post by Wigand »

Maybe someone would like to use this WorldTimeClock on his SharedSpaceServer

It should show your local time, if you set "longin" to your position on earth.
It is very simple, so no special daylight times or differences in the normal time is
visible, but it is good to see what the time is for different users.

Maybe it could get more improvement...
If the login name of a user containes his position on earth like "Wigand_9" or
an other person "Person_-112", we could show his time directly. It must
be programmed, actually it is not implemented.

More ideas are appreciated :bananamad:
Attachments
worldtime.jpg
Worldtime.zip
(140.77 KiB) Downloaded 33 times
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: Worldtimeclock for shared spaces

Post by froo »

Hi Wigand.
Perhaps you could have an input for time zone for users to set.
For example, I think US Eastern is GMT -4
So if you had a dropdown listbox/selection listbox which a user can select.
Each selection corresponds to a number.

Or, allow the user to enter their timezone directly, like: GMT -4
so the vertical bar is correctly positioned.

Really cool! thanks!

EDIT:
The time is correct, but the bar is positioned incorrectly. How can I set that, now?

Froo
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

froo wrote:Hi Wigand.
Perhaps you could have an input for time zone for users to set.
For example, I think US Eastern is GMT -4
So if you had a dropdown listbox/selection listbox which a user can select.
Each selection corresponds to a number.

Or, allow the user to enter their timezone directly, like: GMT -4
so the vertical bar is correctly positioned.

Really cool! thanks!
Froo
Maybe you (froo) can use your database:
On a "Welcome Port" the user can register and give some of his information, like time zone.
You create a key (a long and crypted key :D ) out of his information and let him enter the next port. There it is controlled
who enters the space.
The worldclock looks in a loop after the keys and then put the name as a text of the user above the area he lives. So every visitor can look on the clock and sees from where the others are.

froo wrote: EDIT:
The time is correct, but the bar is positioned incorrectly. How can I set that, now?

Froo

What happens if you put your angle (between you and great britain) into
the input field 'longin'? (=longitude in)
Maybe -80 degress for east USA? On my computer it jumps left to east USA or west south america. It still shows 6:30 for the time I am writing this.
pugman 1
Captain
Posts: 1555
Joined: 21 May 2009, 19:26
Type the number ten into the box: 0
Location: Germany

Re: Worldtimeclock for shared spaces

Post by pugman 1 »

Hi Wigand, thanks cool idea , for me it is set wright
maybe while we are both in germany
Thanks again Ralph :bananathumb:
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

I added a new picture from wikipedia. It is better to find the zones.
But be aware the worldclock has now more than 500kb for download.
If it is to much, you have to resize the resolution of the picture.
I tested Shanghai, London and Los Angeles and it seems to fit pretty good.
Attachments
Showtime.jpg
Worldtimef334.zip
(379.59 KiB) Downloaded 35 times
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

Now with sun and moon position. Not the exact astronomical position but it
is ok to see where the moon or sun are.
Attachments
Worldtime8e18.zip
(397.54 KiB) Downloaded 37 times
Showtime.jpg
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Worldtimeclock for shared spaces

Post by trueBlue »

Neat project Wigand. I'm getting errors on this version:
Attachments
Capture2.PNG
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

That is strange. I had no problems with this line.
Maybe it is a local problem
Try to write the american version like 11-16-2009
or international 2009-11-16 or 2009.11.16
If not, I can do it for you.

Try to change the line like this

mond=360*((DateDiff("s",cdate("11/16/2009 20:15:00"),now())/86400) )/29.53059

On my computer I can change the time format to american but get no error.
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

After uploading the worldclock to a server, I noticed that it showed the clients time not the servers.
Is it possible by script, to get the servers time? How can I distinguish between server and
client time?
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: Worldtimeclock for shared spaces

Post by froo »

Hi Wigand.

At: frooserve.dyndns.org/1111,
look inside the script nodes. I took code from the Windmill object
in the Activities->My Activities library and modified it.

I use code similar to this (this code is in the SDK doc, for Network commands):

StatusObj = Net.GetNodeStatus(Node.FirstSelected());
var status = StatusObj.Param("NtNodeStat");
switch (status)
{
case 0:
strStatus = "Selected object in not in Shared Space";
break;
case 1:
strStatus = "This script runs on server and found that selected object is in Shared Space";
break;
case 2:
strStatus = "This script runs on client and found that selected object is in Shared Space";
break;
}

this is jscript code, but it can be adapted to VBScript. Basically, you are concerned with: case 1.
If status == 1, then you know the server is running the script. So, you insert your time-calculating
code into that section of the script:

case 1:

{
// Add your time calculating code here, since you know the server is executing the script
strStatus = "This script runs on server and found that selected object is in Shared Space";
break;
}
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

Thank you froo

But as I understand your code right.
You only check if the object is running on server or client.

But my question is: How can I force the script to run on server.
For a worldclock it is necessary to show the servertime.
Later we can add the times of the different users
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: Worldtimeclock for shared spaces

Post by froo »

Hi Wigand.
You can force the script command to run on the server, by connecting it to a timer.
On the timer, ensure you have selected: Leave Control.
That submits control of the timer to the server.
That way, when the script executes as a result of the timer submitting a control pulse,
the script is actually running on the server, not the client.

The windmill object in the Activities - My Activities library is setup this way.
Inside the windmill is a timer, which is controlled by the server.

The scene I have at port 1111 is setup the same way.
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

I tried it on this server (whom is it?)

//98.244.8.157/1109

if I leave control the timer continues to run, but
the displayed time is still the same. I thought it should change
to the servers time. :?
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: Worldtimeclock for shared spaces

Post by froo »

ok.
guess we'll have to look deeper then, into your code if possible.
Basically we need to query the computer's clock, I suppose.
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

I think we have to accept, that script on TServe works like scripts in a browser.
So we are restricted to use the servers hardware.

Maybe it is possible to use a dll on the server.
But first I will implement input boxes for the clients to choose their timezone.
And the server owner has to put his timezone in. I hope that this will work.
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

Does someone has an example of the using of comboboxes?
I found Stan's JsManager, but is it really so complicated to access the data of a combobox?

Is it possible to loop the result of a combobox through to an encapsulated script?

I want a combobox for choosing the timezone.
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: Worldtimeclock for shared spaces

Post by froo »

Hi Wigand.
The Scene Fluid Controller node, contained in this object,
has a node which manages the data in a combo (dropdown list) box.

The nodes are:

Update Fluids List
reset
ResetOnSceneConstruction
Delete Fluid

You don't need every one of these, but they all show how you manage data in the combo box.
Attachments
Scene Fluid Controller.zip
(63.19 KiB) Downloaded 36 times
Wigand
Senior Chief Petty Officer
Posts: 204
Joined: 21 May 2009, 17:38

Re: Worldtimeclock for shared spaces

Post by Wigand »

Thank you, I will look in it.
User avatar
LeonRegis
Captain
Posts: 1946
Joined: 18 Aug 2009, 17:36
Type the number ten into the box: 0
Location: Brazil/Earth/Orion Arm/Milky Way/4th Dimension/This Universe/Multiverse???/Singularity???

Re: Worldtimeclock for shared spaces

Post by LeonRegis »

Oh, thank you! :)
Be the change you want to see in the world. - Mohandas Gandhi

Return to “Our Shared Space Community”