Page 1 of 1

Sun and Moon

Posted: Mon Apr 10, 2023 2:16 pm
by Lockonnow
Could it be cool if the forum could show the sun or the moon on the forum which is up on each server? i mean what is past night or day light.

Re: Sun and Moon

Posted: Mon Apr 10, 2023 2:47 pm
by Aspect of Sorrow
Dawn at 6, sets at hour 18, if the default 48 minute per day is kept a little math on the uptimes based on the counter update of server uptime is then easily available, so at the time of this response the IG for S1 is just past noon. A simple little browser extension could read the text in the status box and recolor the text yellow or light blue to accommodate if it's not done serverside.

Re: Sun and Moon

Posted: Mon Apr 10, 2023 11:05 pm
by Endelyon
Aspect of Sorrow wrote: Mon Apr 10, 2023 2:47 pm Dawn at 6, sets at hour 18, if the default 48 minute per day is kept a little math on the uptimes based on the counter update of server uptime is then easily available, so at the time of this response the IG for S1 is just past noon. A simple little browser extension could read the text in the status box and recolor the text yellow or light blue to accommodate if it's not done serverside.
When the server boots it gets set to whatever time the real time is. Even if you accounted for that in your math it will get thrown off at some point based on crashes or early/late resets.

Re: Sun and Moon

Posted: Tue Apr 11, 2023 12:40 am
by gedweyignasia
Endelyon wrote: Mon Apr 10, 2023 11:05 pm
Aspect of Sorrow wrote: Mon Apr 10, 2023 2:47 pm Dawn at 6, sets at hour 18, if the default 48 minute per day is kept a little math on the uptimes based on the counter update of server uptime is then easily available, so at the time of this response the IG for S1 is just past noon. A simple little browser extension could read the text in the status box and recolor the text yellow or light blue to accommodate if it's not done serverside.
When the server boots it gets set to whatever time the real time is. Even if you accounted for that in your math it will get thrown off at some point based on crashes or early/late resets.
This is incorrect; there's a 4-1 ratio of server time to real time, and the server always fast-forwards its clock to the appropriate time on a reset. Night and day should be consistent across resets unless a DM has moved the clock since the last reset. Dae refactored some on module load code which accidentally disabled this in June, but I believe Dalo has since fixed it. It should be possible to give both the night/day indicator and the actual ingame time.

Re: Sun and Moon

Posted: Tue Apr 11, 2023 10:00 am
by Aspect of Sorrow
Yes, hence the if, I wasn't sure what the ratio was without looking it up, and forgot completely about the on reset time adjustment.

Re: Sun and Moon

Posted: Tue Apr 11, 2023 10:17 am
by Zanniej
You could probably calculate that based on the uptime in the counter then, right?
I can probably make that, if people find value in it.

I mean, the uptime at time of writing on Baldurs Gate North is 7:26:36. That means it started around 6:47 GMT. If the server set that time at that moment, and the ratio is 1:4, that would mean that at the time of writing (14:14 GMT) it's ~11:30 in server.

If someone can verify for me that that is correct, then I can create a script to add the in game time.

EDIT: Or a sun/moon icon, if that's more fun, of course.

Re: Sun and Moon

Posted: Tue Apr 11, 2023 10:35 am
by DaloLorn
At the time of posting, it is Tarsakh 11, 8 AM game time, with 1 hour and 9 minutes until the reset.

Re: Sun and Moon

Posted: Tue Apr 11, 2023 10:44 am
by Zanniej
Then I'm about 4 in game hours off, which is one RL hour.
Could be a calculation error, or a timezone error.

Thanks Dalo!

If someone can give me the time and date just after reset, I'd appreciate it! :)

Re: Sun and Moon

Posted: Tue Apr 11, 2023 11:31 am
by Aspect of Sorrow
The IG time is changed on launch which won't reflect the uptime, previously it wasn't working which leant to it, so you would have to probably write a cron or scheduled task to read the server logs until you find the last hour announcement and base it on that.