Home » Stars! 2.6/7 » Questions about Stars! AutoHost » Can we still play when autohost freezes?
Can we still play when autohost freezes? |
Thu, 26 July 2007 08:54 |
|
Mr K | | Petty Officer 2nd Class | Messages: 59
Registered: February 2007 Location: Christchurch, New Zealand | |
|
When autohost freezes (as it has done at the moment), the message that comes up states "You may still upload and use Host Utility, but the game pages will not be visually updated while AutoHost is frozen".
So if I know that everyone has uploaded their turn (but the web-page just isn't showing it and autohost just isn't generating because it doesn't realise it), can I use the host utility to force turn generation within 3 minutes so that we can all keep on playing?
will autohost definately process all the uploaded turns which haven't shown up on the site?
It would be great if we could do this because then I could keep our game rolling (even if somewhat manually).
Report message to a moderator
|
|
| | |
Re: Can we still play when autohost freezes? |
Thu, 26 July 2007 20:04 |
|
|
Mr K wrote on Thu, 26 July 2007 23:19 | haha, oops how embarrassing.
I guess i just had an idea and scribbled it down here without looking at that info, but the answer *is* in black and white.
ok, with the possibility of generation aside... I may have not read deeply enough, but why do people seem to get upset about missing turns when the host is frozen?
does it generate a couple all at once when it comes back online if it's been frozen for a period greater than 2 generation deadlines?
Thanks for your help!
|
It's a mystery to me. When AH is frozen (as opposed to being completely offline) you can still upload fine. You just don't get an indicator that your upload went in. So I just upload twice to be sure
If autohost goes *completely* offline, then usually I'd keep the game on hold while I gave the players a chance to get their turns uploaded (no more than 24 hours - their turn should already be made as usual, they just need a chance to upload...)
Coming off from hold on flexible schedules should only result in one gen (if the game is configured for a 'max x hours' style gen schedule.) With fixed schedules, then IIRC it's advisable to remove the schedule before coming off hold, then implement the schedule again after the game is rolling (i.e., more than 3 minutes later.)
If you are hosting a game, and it accidentally gens two turns instead of one, you can always rollback a turn (not great, as players have still seen a slice of the possible 'future', but still...)
[Updated on: Thu, 26 July 2007 20:04] Report message to a moderator
|
|
| | | | | | |
Re: Can we still play when autohost freezes? |
Fri, 27 July 2007 22:06 |
|
Ron | | Commander Forum Administrator | Messages: 1239
Registered: October 2002 Location: Collegedale, TN | |
|
I'm sorry folks. That was my fault... The PRISM game crashed stars.exe under WINE again. I usually put all games on hold after SAH has been frozen for more than about 4 hours.
In this case, I forgot to run the script that actually puts all games on hold. Then I edited the text file containing the message that game hosts receive, which contains the standard phrase "all games have been put on hold...", and sent out the emails.
I suppose I could automate whether all games get put on hold or not, by having the startup script check how long SAH has been frozen when I run it.
pseudo code
if ((currenttimestamp - timestamp(autohost.log)) > 4 hours) {
run_script(allgamesonhold.pl);
edit(host_email.txt){
search/replace('HOLD','all games on hold');
}
}
else {
if (restarting SAH after freeze){
edit(host_email.txt){
search/replace('HOLD','all games have NOT been put on hold');
}
}
}
Anyway, while currently an inconvenience for game hosts, they can restore a previous turn if needed.
As for scheduling... its a mess. Considering the different factors involved, I think it doesn't work too bad. If anyone can provide pseudo code that handles scheduling (and all the different cases that can come up) better, please post it.
Ron Miller
Stars! AutoHostReport message to a moderator
|
|
|
Re: Can we still play when autohost freezes? |
Sat, 28 July 2007 13:31 |
|
PaulCr | | Chief Warrant Officer 3 Stars! V.I.P
| Messages: 187
Registered: February 2007 Location: An Island that kinda look... | |
|
Ron wrote on Sat, 28 July 2007 03:06 |
As for scheduling... its a mess. Considering the different factors involved, I think it doesn't work too bad. If anyone can provide pseudo code that handles scheduling (and all the different cases that can come up) better, please post it.
|
I threw something together for fledging admirals 2 which kept causing SAH to crash, it only does scheduled generations though, it basically has a function that calculates the next scheduled time when given the hour the game normally generates, the days of the week it does so and the date/time to get the next generation after. When everyone turns in it calls it with the current date/time to find when the next generation would have taken place and then calls it again using that time to find the next + 1, doing it that way rather than calling it once with the existing next generation time stops it from accummulating if everyone turns in early multiple times. A scheduled generation just calls it with the current time, as does a forced generation since the host carries that out they can change the schedule temporarily if they needed to.
The routine is pretty short and clean so I've included it at the end since you may find it useful. The code for adding a set number of hours would be a simple addition to the current date/time. I'm not sure if you have any other possibilities I'm not aware of though.
function GetNextGenerationTime(GenDays,GenHour,TimeToUse)
dim a,NextGeneration
if GenDays>0 then
if genhour<=hour(TimeToUse) then
for a=0 to 7
if (gendays and (2^(weekday(dateadd("d",a+1,TimeToUse),1)-1)))< >0 then
NextGeneration=cdate(format(dateadd("d",a+1,TimeTo Use),"dd MMM yyyy " & genhour & ":00:00"))
exit for
end if
next
else
for a=0 to 7
if (gendays and (2^(weekday(dateadd("d",a,TimeToUse),1)-1)))<&g t;0 then
NextGeneration=cdate(format(dateadd("d",a,TimeToUs e),"dd MMM yyyy " & genhour & ":00:00"))
exit for
end if
next
end if
else
NextGeneration="null"
end if
return NextGeneration
end function
GenDays is a bitmask of the days of the week, Sundays being 1, Mondays 2, Tuesdays 4 etc so Mondays, Wednesdays and Fridays would be 2+8+32=42
Report message to a moderator
|
|
| |
Goto Forum:
Current Time: Mon Sep 16 08:39:57 EDT 2024
|