Evil Fool
"==" != "="
Join date: 30 Jul 2004
Posts: 110
|
09-01-2004 03:29
Well, i did a little searching, and I'm not sure about something with timers (and i dont really have the 'time' to test this right now)
does anyone know if timers still count time during server down-time?
and also, if they do/don't, how often do the servers go down, and for how long?
will it affect a timer counting a preset number of hours?
I'm currently thinking that it does, and I will have to provide a quick major update to my products(somehow utilizing the in-game clock)
|
Archanox Underthorn
Registered User
Join date: 20 May 2003
Posts: 168
|
09-01-2004 05:23
Yes downtime will stop your timers. You would probably want to build something around llGetWallclock. Now that we can set the description and read it via script you could probably use that to store the target time in case the script gets reset.
|
Evil Fool
"==" != "="
Join date: 30 Jul 2004
Posts: 110
|
09-01-2004 12:23
eeep.
not good.
infact, very very bad right now
anyone got some sample code? or am i going to have to spend some time figuring this out too....
edit: looks like i'm going to be using the timestamp function
This really makes me wonder how it was done before 1.5 though :-\
|
Jack Lambert
Registered User
Join date: 4 Jun 2004
Posts: 265
|
09-01-2004 12:39
I had a similar problem to this ...
I fixed it by doing a short llSetTimerEvent(1.0) and doing a timestamp check in the timer()...
// Begin code
string start_time;
list parsetime(string time_to_parse) { return llParseString2List(time_to_parse, ["-", "T", ":", "Z"], []);
// list returned is something like [2004, 09, 25, 04, 25, 17.1771771]
}
default { state_entry() { start_time = llGetTimestamp(); llSetTimerEvent(1.0); }
timer() { string current_time = llGetTImestamp(); if (llList2Integer(parsetime(start_time), 3) > llList2Integer(parsetime(current_time), 3)) // obviously check what you want, this checks the hour is greater than the start_time { .... DO something ... }
|
Evil Fool
"==" != "="
Join date: 30 Jul 2004
Posts: 110
|
09-01-2004 13:52
But I really need some sort of a timestamp... that i can just add X number of seconds to... might just be easier to update the timestamp via the email system every 24 hours...
but really... even in the lsl wiki it mentions the need of a timestamp
Any other suggestions?
And also, it would really help if someone could give me an idea of how long the servers are down each night/if they are down each night/ averages.
If I had that info, I might not even have to fix my code
---
and Jack, how would that code there help me to count time over a period of a certain number of days(actually i'm looking more at weeks here)... All I think that would do would execute the code CONTINOUSLY up until X hour PST, every day, then wait till the next day to start again.
|
Jake Cellardoor
CHM builder
Join date: 27 Mar 2003
Posts: 528
|
09-01-2004 16:19
From: someone Originally posted by Evil Fool And also, it would really help if someone could give me an idea of how long the servers are down each night/if they are down each night/ averages. I'd say an average of once a week, for a few hours. (More frequently just after a major release, less frequently just before.)
|
Evil Fool
"==" != "="
Join date: 30 Jul 2004
Posts: 110
|
09-01-2004 17:40
ok, wow, coulda used this info before this probably means that i'll just set the day timer to 23 hrs 
|
Jack Lambert
Registered User
Join date: 4 Jun 2004
Posts: 265
|
09-02-2004 08:07
From: someone timer() { string current_time = llGetTImestamp(); if (llList2Integer(parsetime(start_time), 3) > llList2Integer(parsetime(current_time), 3)) // obviously check what you want, this checks the hour is greater than the start_time { .... DO something ... }
[/B] In this line you could do a check to make sure the day is greater than the timestamped day. Of course, if you try to say "if the current day is greater than the start day", you could run into a problem at the end of the month when the new day is 1 instead of 32, so make sure you do a few checks to make sure the month and year haven't increased first. I suppose another approach would be to have a function that calculates the number of seconds in a timestamp... --Jack Lambert
|
Evil Fool
"==" != "="
Join date: 30 Jul 2004
Posts: 110
|
09-02-2004 09:07
Well, that last post
I had thought up a few possible solutions, and the consequences
Email system ( provides the UNIX timestamp, would be perfect for what I need )
Disadvantage: HALTS the script for 20 seconds. This means it is not effective.
Using JLambert's script disadvantage: would have to do a bit of annoying checking
Creating a timestamp from llGetTImestamp()
Disadvantage: would take a while to get it working properly --- Solution: Just have an hour or two removed automatically each week.
|