Jump to content
IT07

[scarCODE] S.R.W. (Server Restart Warnings) by IT07

Recommended Posts

S.R.W. (Server Restart Warnings)
by IT07

 

 

FEATURES
- Linux & Windows server compatible
- Runs client-side through missionfile
- Very easy configuration: just change a few numbers

- Support for Scheduled restart patterns

- Configurable restart interval

- You decide when warnings will be shown 

INFO
This light-weight script will automatically warn players when a restart is closing in. It uses BIS_fnc_typeText.

It is fully customizable in terms of when the restart warnings are given and the schedule or interval.
Just make sure that you put in the right configuration to match your server :)
In case your were wondering: yes it does work with players that join after 1 or more warnings for a restart have been given.

 

IMPORTANT

If you own a version before version 02039_PATCH1 then you HAVE to upgrade.

It fixes a big security leak in the script.

 

RECOMMENDED
- Notepadd++ for editing the files http://notepad-plus-plus.org/

VIDEO
https://youtu.be/sBg3Co4LGL8

NOTES
This script DOES NOT restart your server. It only gives warnings depending on how you configured it to do so.

ISSUES

- bugged restarts warning times when using scheduled _restartMode. More details about that:

the command missionStart when ran on the server should return [year,month,day,hour,minute,second] of when the server was started.

But it does not do that. Instead, it returns some weird date back in 1970. This prevents the script from being able to check when the server was started.

Which renders the whole idea of the script useless. This issue has been submitted to the ArmA 3 feedback tracker: http://feedback.arma3.com/view.php?id=23373

please upvote this post and ask anyone that wants to help to do the same. It will allow implementation of  working support for scheduled restarts into this script.

news 30th March 2015: The issue has been confirmed by ArmA 3 Devs!

 

DOWNLOAD & INSTALLATION

https://github.com/IT07/A3_ScarCode_ScriptBundle

Share this post


Link to post
Share on other sites

] execVM "IgiLoad\IgiLoadInit.sqf";
 
[] execVM "wai\remote.sqf";
 
//Supply Drop Alert Event
"SDROP_Alert" addPublicVariableEventHandler {
hint parseText format["%1", _this select 1];
};
 
if (isServer) then 
{
fn_getBuildingstospawnLoot = compile preProcessFileLineNumbers "Custom\LSpawner\fn_LSgetBuildingstospawnLoot.sqf"; 
LSdeleter = compile preProcessFileLineNumbers "Custom\LSpawner\LSdeleter.sqf";
execVM "Custom\LSpawner\Lootspawner.sqf";
};
 
// Status Bar
[] execVM "scripts\fn_statusBar.sqf";
// Welcome Credits
[] execVM "custom\welcome.sqf";
 
if(hasInterface)then
{execVM "semClient.sqf"
// Time until next restart by IT07
private["_SC_restartIntvlHours"];
/////// CONFIG /////// 
// Please edit the 3 lines below to your likings
_SC_restartIntvlHours = 4; // Change the number 1 into the number of hours your server will be up before it restarts
_SC_restartWarnTopMessage = "== WARNING =="; // What the first line of the warning should say
_SC_restartTimeHintSilent = false;  // RECOMMENDED: false; If true, it will mess with debug monitor!
////////////////////// DO NOT CHANGE ANYTHING BELOW THIS LINE
[_SC_restartIntvlHours, _SC_restartWarnTopMessage, _SC_restartTimeHintSilent] ExecVM "ScarCode\SC_restartTime.sqf";
};
 
//cmEARPLUGS CODE START
//////////////////////////////////////////////////////////////////////////
call compile preProcessFileLineNumbers "cmEarplugs\cm_veh_fun.sqf";
//cmEARPLUGS CODE END
//////////////////////////////////////////////////////////////////////////
 

 
 
Is this correct?   my server restart is every 4 hours please check my above init file 

Share this post


Link to post
Share on other sites

Yes that looks just about right. I hope you enjoy the script :)

I tried li,e this way but my SEM mission wont start... :( 

 

any reason why?

 

if i create a different 

 

if(hasInterface)then..... 

 

just for your script sem wont stsrt.. 

Please advise.

Share this post


Link to post
Share on other sites

I tried li,e this way but my SEM mission wont start... :(

 

any reason why?

 

if i create a different 

 

if(hasInterface)then..... 

 

just for your script sem wont stsrt.. 

Please advise.

 

Sorry I only looked at how you put in my script. If you want me to check your code for errors then you're gonna have to PM me instead ;)

 

I haven't tried it yet as my server hasn't restarted, but this is fantastic IT07... Many thanks for this ;)

 

You are very welcome! I hope you and your players are going to appreciate it forever :)

Share this post


Link to post
Share on other sites

link is dead? can´t download it..

I seriously don't get it why people think it's dead... because it's not. It works fine.

Maybe I'll move the code to gitHub at some point.

Share this post


Link to post
Share on other sites

I really like this and will play with it, i just have a question though, is there any way to link this to system time? Say for instance the server crashes at 4PM and the next restart is at 6PM, the restart warning would be out of whack completely correct? 

 

If we could link that to pre-defined times that would be the most legend server restart warning around!!

Share this post


Link to post
Share on other sites

I really like this and will play with it, i just have a question though, is there any way to link this to system time? Say for instance the server crashes at 4PM and the next restart is at 6PM, the restart warning would be out of whack completely correct? 

 

If we could link that to pre-defined times that would be the most legend server restart warning around!!

No matter what happens, the restart warnings will always work correctly.

It works like this: when the server starts, it will start counting in milliseconds how long the mission has been running.

My script will then execute on the player's computer and will check what the elapsed time is in miliseconds.

Depending on what the time is, it will do certain things to make sure that the player will get the correct warnings.

In short: do not worry about server crashes, this script will still properly work.

Share this post


Link to post
Share on other sites

So those of us that have restart schedules set by time, it will still work even if the server was manually restarted halfway through a cycle?

So say my restart is at 6pm, next one would be at 12 but the server crashed/manually restarted at 3, surely this system wouldn't know there is a restart until 6 hours later, not 3?

Share this post


Link to post
Share on other sites

So those of us that have restart schedules set by time, it will still work even if the server was manually restarted halfway through a cycle?

So say my restart is at 6pm, next one would be at 12 but the server crashed/manually restarted at 3, surely this system wouldn't know there is a restart until 6 hours later, not 3?

 

This is what I also want to make sure of. 

 

I understand that the script counts time in game and gives the warning to players at the same time, but I want to know if I restart the server half an hour before the actual scheduled restart, will the server warn the players 10 minutes later that the server will restart in 20 minutes because that is the scheduled restart time?

 

Is there a way we can let them know the restart times as well with this method, just spamming messages like BEC that the server restarts at certain time intervals

Share this post


Link to post
Share on other sites

better and more creative, perhaps with a different sound. maybe i can found some nice layouts, let me try ;)

I will take your positive critisism into account for future releases. Thank you

Share this post


Link to post
Share on other sites

Awesome thanks for looking into our suggestion, if you get that waxed to keep time with the server so that I can keep my 6 hour restart schedule as well as irregular restarts without worrying about the warning going all haywire, then your work will certainly be legendary and I can live without BEC. 

 

You sir are a legend and a scholar! Your work is definitely commendable!

Share this post


Link to post
Share on other sites

Awesome thanks for looking into our suggestion, if you get that waxed to keep time with the server so that I can keep my 6 hour restart schedule as well as irregular restarts without worrying about the warning going all haywire, then your work will certainly be legendary and I can live without BEC. 

 

You sir are a legend and a scholar! Your work is definitely commendable!

 

I'm glad you like it. Thank you for your appreciation.

Share this post


Link to post
Share on other sites

Ok hold on I get it. I will look into this for sure. If I succeed, I will reupload that version and include an option to enable it.

EDIT: Found something useful: https://community.bistudio.com/wiki/serverTime

I will check it out when I get back from work.

 

Another reason you're awesome.

 

Pretty damn awesome script just as it is.

Share this post


Link to post
Share on other sites

Another reason you're awesome.

 

Pretty damn awesome script just as it is.

 

After I clicked the "Like this" button on your reply, it said: "You have reached the mamixum positive ratings for today".... 1st world problems haha

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...