Post by kaldair on Oct 3, 2006 17:28:24 GMT
Hey Funky,
Here's an auto-reboot script I came up with to consider:
If ($hours_server_up_time > 12 hours) Then
.....While ($reboot_yes = 0) 'Loop that will terminate upon reboot criteria being met
..........If ($number_logged_in_players < 6) And ($boss_spawn_number_1 = "No") And ($boss_spawn_number_2 = .........."No") And ($boss_spawn_number_3 = "No") And ($boss_spawn_number_4 = "No") And ..........($boss_spawn_number_5 = "No") Then 'Check for few players and no player at a major boss because it's less .........................................................................................of a player hassle
...............$server_announce=5 'Set variable to track number of server announcements
...............$server_reboot_message="Reboot in "&$server_announce&" minute(s). Please change servers now."
...............While ($server_announce <> 0) 'Loop to broadcast the reboot warning
....................Call {Server_Broadcast,$server_reboot_message} 'Warn folks about the reboot
....................Let $server_announce = $server_announce - 1 'Decrement variable
....................Wait {1 minute} 'Allow 1 minute between announcements
...............End While 'This loop announces the message 5 times at 1 minute intervals
...............$reboot_yes=1 'Set the reboot variable to a true state - used to prevent an infinite loop if the reboot call fails
...............Call {Reboot_Server_Now} 'Do the deed
..........Else 'The branch if more than 5 players are logged in or a boss has been spawned
...............Wait (10 minutes) 'Allow for a recheck time that is small enough to matter, but large enough not to tie up .....................................................resources
..........End If 'Terminate the reboot criteria tests
.....End While 'Loop back to the reboot criteria tests
End If 'Terminate the check for server up time greater than 12 hours
Based on my observations this should cause a reboot once every 24 hours, probably between 12:00 AM and 6:00 A.M. Mountain Time Zone. Since it checks for both low usage and boss spawns, it should have a minimal impact on the player base. I leave it up to you which bosses to include in the tests. I thought maybe any of those that needed an item(s) to reach? It will also free up DM time, and avoid the possibility of forgetting to reboot. It also does not preclude a DM's ability to reboot at will. I like the announcement feature as it gives folks plenty of time to resume their fun on another server. It also gives folks a "heads up" in that if they log on and check the server up time and the number of players on they can decide whether to start that big run …
Here's an auto-reboot script I came up with to consider:
If ($hours_server_up_time > 12 hours) Then
.....While ($reboot_yes = 0) 'Loop that will terminate upon reboot criteria being met
..........If ($number_logged_in_players < 6) And ($boss_spawn_number_1 = "No") And ($boss_spawn_number_2 = .........."No") And ($boss_spawn_number_3 = "No") And ($boss_spawn_number_4 = "No") And ..........($boss_spawn_number_5 = "No") Then 'Check for few players and no player at a major boss because it's less .........................................................................................of a player hassle
...............$server_announce=5 'Set variable to track number of server announcements
...............$server_reboot_message="Reboot in "&$server_announce&" minute(s). Please change servers now."
...............While ($server_announce <> 0) 'Loop to broadcast the reboot warning
....................Call {Server_Broadcast,$server_reboot_message} 'Warn folks about the reboot
....................Let $server_announce = $server_announce - 1 'Decrement variable
....................Wait {1 minute} 'Allow 1 minute between announcements
...............End While 'This loop announces the message 5 times at 1 minute intervals
...............$reboot_yes=1 'Set the reboot variable to a true state - used to prevent an infinite loop if the reboot call fails
...............Call {Reboot_Server_Now} 'Do the deed
..........Else 'The branch if more than 5 players are logged in or a boss has been spawned
...............Wait (10 minutes) 'Allow for a recheck time that is small enough to matter, but large enough not to tie up .....................................................resources
..........End If 'Terminate the reboot criteria tests
.....End While 'Loop back to the reboot criteria tests
End If 'Terminate the check for server up time greater than 12 hours
Based on my observations this should cause a reboot once every 24 hours, probably between 12:00 AM and 6:00 A.M. Mountain Time Zone. Since it checks for both low usage and boss spawns, it should have a minimal impact on the player base. I leave it up to you which bosses to include in the tests. I thought maybe any of those that needed an item(s) to reach? It will also free up DM time, and avoid the possibility of forgetting to reboot. It also does not preclude a DM's ability to reboot at will. I like the announcement feature as it gives folks plenty of time to resume their fun on another server. It also gives folks a "heads up" in that if they log on and check the server up time and the number of players on they can decide whether to start that big run …