[dirGames-L] SMUS server time

Gene Endrody gene at mmorpg.ca
Thu Aug 3 13:00:42 EDT 2006


Try a couple tankballs side by side, and I think you'll see that they are 
well synchronized. There will always be a minor latency issues of a few 
milliseconds....but the same issue would exit no matter what you do. The 
game time is right on the HUD in the form of a five minute countdown. Try it 
in the same room and I'm pretty confident that it will hold up.

Serverside Lingo supports the abbreviated date, the time and all the usual 
time/date functions that lingo supports. You can send those imbeded in a 
message, but I think you'll still find it easier to manage the timed starts 
through handlers on the client side using timing information recieved from 
the server at a prior point. I've never tried broadcasting a "the game 
starts now" message from the server....I'm not sure that there's timer 
handlers on the SMUS that can handle this (but I haven't looked)

Gene

----- Original Message ----- 
From: "Blixem Media | Marco Christis" <marco at blixem.com>
To: "'Director - Shockwave - and Flash Game Production'" 
<dirgames-l at nuttybar.drama.uga.edu>
Sent: Thursday, August 03, 2006 11:15 AM
Subject: RE: [dirGames-L] SMUS server time


>
> Hi Gene,
>
> Thanks for your answer. I think that your solution is a nice way to
> synchronise clients. But in my case I need to end a game round at a
> specific time e.g. 16h30. Then the milliseconds don't help much. The
> clients need to know the sever time so they can show a count down clock.
> In my situation the screens of the game clients are located right next
> to each other in the same room. It looks bad when you can see when the
> clients are not well synchronised ;-)
>
> I think it is a nice solution when the server pushes the end time and
> the current server time at the start of the game round and further the
> clients can manage their own count down time. 'the long time' will do
> exactly what I need.
>
> thanks,
> Marco.
>
>
>> I had a similar issue to this for syncronized starts with
>> Tankball games.
>> Most SMUS messages include a server timestamp by default.
>>
>> For example, a group join response looks like:
>>
>> -- [#errorCode: 0, #recipients: ["809564"], #senderID:
>> "system.group.join",
>> #subject: "anySubject", #content: "@T19", #timeStamp: 723834961]
>>
>> On the client side, I created an offset value based on the
>> client side
>> milliseconds and the server timestamp.....
>>
>> Global MilliOffset
>> on defaultMessageHandler me, message
>>   MilliOffset=message.timestamp-the milliseconds
>> end
>>
>> When I need the server time after that, I would use
>> TimeStamp=Millioffset+the milliseconds
>>
>> if I wanted a consistent server time that would count up to
>> 300 every five
>> minutes, I would use something like....
>>
>> ServerTime=integer((TimeStamp mod 315000) *.001 )
>>
>> When ServerTime resets to 0, I know it's time for a new game.
>>
>> Does that make sense?
>>
>> Gene Endrody
>> MaidMarian.com
>>
>>
>>
>> ----- Original Message ----- 
>> From: "Blixem Media | Marco Christis" <marco at blixem.com>
>> To: "'Director - Shockwave - and Flash Game Production'"
>> <dirgames-l at nuttybar.drama.uga.edu>
>> Sent: Thursday, August 03, 2006 8:38 AM
>> Subject: RE: [dirGames-L] SMUS server time
>>
>>
>> >
>> >
>> > Hi,
>> >
>> > I thinkl that I need to know what the time is before I can send it.
>> > That's the part I am having problems with. I am looking for
>> a server
>> > side function called getTime() or something like that. But
>> it doesn't
>> > seem to be documented or it doesn't exist.
>> >
>> >
>> >>
>> >> Just create a function called SendServerTime and one called
>> >> ExecGotServerTime.
>> >>
>> >> All machines have these.
>> >>
>> >> The server is the only one that sends send servertime and it is
>> >> routed to ExecGotServerTime.
>> >>
>> >> There is one variable that is the servertime value or string.
>> >>
>> >> This way all machines can receive the message and update it.
>> >>
>> >> On Aug 2, 2006, at 5:31 PM, Blixem Media | Marco Christis wrote:
>> >>
>> >> >
>> >> > Hi,
>> >> >
>> >> > I have pulled SMUS from the shelf (a bit busty) for a small
>> >> multiuser
>> >> > game running on a local network. I want to synchronise a
>> countdown
>> >> > clock on all the clients and in attempt to achive this I have
>> >> > created a thread
>> >> > on the server. I'd like this tread to push messages to all the
>> >> > connected
>> >> > clients but I am not sure if there is a server function
>> to get the
>> >> > date
>> >> > and time of the server. (I only need second precision for
>> >> this game.)
>> >> >
>> >> > I have found that a client can request the time from the
>> server by
>> >> > sending a message with system.server.getTime as
>> recipient. So I can
>> >> > make all the clients poll for the server time but I think it is
>> >> nicer when
>> >> > the server can push a message with the time to all the
>> >> users at the
>> >> > same
>> >> > tame. I've tried to call pServer.getTime() in a server
>> script but
>> >> > without luck. Does anybody of you remember how to retreive
>> >> the server
>> >> > time from a server script or wheter this is even possible?
>> >> >
>> >> > Thanks,
>> >> > Marco.
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > dirGames-L mailing list  -  dirGames-L at nuttybar.drama.uga.edu
>> >> > http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames-l
>> >>
>> >>
>> >>
>> >
>> > _______________________________________________
>> > dirGames-L mailing list  -  dirGames-L at nuttybar.drama.uga.edu
>> > http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames-l
>> >
>>
>>
>>
>>
>
> _______________________________________________
> dirGames-L mailing list  -  dirGames-L at nuttybar.drama.uga.edu
> http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames-l
> 




More information about the dirGames-L mailing list