IT07 419 Report post Posted June 19, 2016 ArmA3_exile_restartWarningsby IT07Description: automated (client-side) server restart warnings both for dynamic and scheduled restarts.Download: https://github.com/IT07/ArmA3_exile_restartWarningsScreenshot: http://imgur.com/nkEz8QcWARNING! This script has not been tested on a public server with many players. Please report issues if found. 11 Share this post Link to post Share on other sites
ZZK-Gaming 61 Report post Posted June 19, 2016 nice, i try this later Share this post Link to post Share on other sites
SaintZ 119 Report post Posted June 20, 2016 Question, so if I'm using a scheduled task on my server to restart it currently should I disable that if using this? Share this post Link to post Share on other sites
ZZK-Gaming 61 Report post Posted June 20, 2016 Is a restart warning Script, not the shutdown @SaintZ ^^ 1 Share this post Link to post Share on other sites
BetterDeadThanZed 1006 Report post Posted June 20, 2016 (edited) Very nice. A much needed feature. *Edit* If this is run client side, how does it know how much time is left until restart? Does it read the amount of time the server has been up and then calculates the time left based on that? Obviously since my status bar shows the time until restart and that is client side, I assume that's how it works? *Edit 2* I have a scroll menu option to "Do restart warning" and it says "99 minutes until restart". How do I get rid of that? Was that a debug used during testing? At the time I selected that option the server had 3 hours and 45 minutes until restart BTW. Edited June 20, 2016 by BetterDeadThanZed Share this post Link to post Share on other sites
Zombie Pacifier 11 Report post Posted June 20, 2016 33 minutes ago, BetterDeadThanZed said: Very nice. A much needed feature. *Edit* If this is run client side, how does it know how much time is left until restart? Does it read the amount of time the server has been up and then calculates the time left based on that? Obviously since my status bar shows the time until restart and that is client side, I assume that's how it works? you set it to whatever you want within the config.cpp, the status bar script has a similar setting within its files so I'm assuming you just got lucky and have your restarts set to the default time put in the statusbar script. so for the settings below in the config.cpp you would set which mode you want, dynamic or schedule. dynamic interval would equal the amount of hours the server would be up before it restarts. ( if you restart every 3 hours, interval would be 3) if you use the scheduled restarts that would restart the server at those specific hours (in the example he has it restarting every hour, obviously you would want to delete the hours you didn't want it to restart) Spoiler class dynamic { interval = 1; // after how many hours of uptime the server will restart | ignore if using scheduled restarts }; class scheduled { schedule[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24}; // hours at which the server will restart | ignore if using non-scheduled restarts }; forceLeave = 1; // (in minutes) | kicks players to lobby if still in-game at this amount of minutes before restart | use 0 to disable giveWarningsAt[] = {60,50,40,30,20,10,5,2,1}; // higher numbers before lower mode = 2; // 1 = non-scheduled | 2 = scheduled Share this post Link to post Share on other sites
BetterDeadThanZed 1006 Report post Posted June 20, 2016 6 minutes ago, Zombie Pacifier said: you set it to whatever you want within the config.cpp, the status bar script has a similar setting within its files so I'm assuming you just got lucky and have your restarts set to the default time put in the statusbar script. so for the settings below in the config.cpp you would set which mode you want, dynamic or schedule. dynamic interval would equal the amount of hours the server would be up before it restarts. ( if you restart every 3 hours, interval would be 3) if you use the scheduled restarts that would restart the server at those specific hours (in the example he has it restarting every hour, obviously you would want to delete the hours you didn't want it to restart) I'm sure I set the restart time in the status bar to 4 hours. I didn't "get lucky". I understand the settings. They are well documented. My question, which maybe IT07 can answer, is how does this calculate the amount of time left until restart? Share this post Link to post Share on other sites
IT07 419 Report post Posted June 20, 2016 UPDATE! (June 20th, 2016)Check the CHANGELOG.md for details @BetterDeadThanZed The calculation for the dynamic restarts is very easy: convert the interval (3 for example) to seconds and then take away the serverTime (https://community.bistudio.com/wiki/serverTime) from it. And then I run a loop that waits for the result to become lower or equal to one of the warning times given in the config. Then there is the calculation for the scheduled restarts which is a little bit more complicated: 1. let the server broadcast its own missionStart value and use that on the client 2. find the hour that will be the first upcoming one in schedule 3. convert that hour into seconds and take away the server's start hour, minute and seconds from it. 4. then you have the amount of seconds the server will be up before the next restart hour. 5. take away the serverTime from it and tadaaaa you have the right number to show to the player. 2 Share this post Link to post Share on other sites
IT07 419 Report post Posted June 20, 2016 @Metalman10 Well that is interesting. I released this yesterday. 3 Share this post Link to post Share on other sites
IT07 419 Report post Posted June 20, 2016 @Metalman10 Correct. But that was a completely different script. It does the same though. This one just does it all much better and more elegant. 1 Share this post Link to post Share on other sites