Jump to content
  • 0

Kick all players prior to restart


Shawn

Question

I was wondering if there was a way of kicking all players  2 minutes prior to restart. A method I figured was set max ping to 1 before restart, and revert just after, but I really don't like this.

Are there any other alternatives?

Thanks.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0
4 hours ago, Shawn said:

I was wondering if there was a way of kicking all players  2 minutes prior to restart. A method I figured was set max ping to 1 before restart, and revert just after, but I really don't like this.

Are there any other alternatives?

Thanks.

 

why would you want this?

Link to comment
Share on other sites

  • 0

This is an existing feature of Epoch actually just for this reason and can be enabled here: https://github.com/EpochModTeam/Epoch/blob/release/Server_Install_Pack/%40epochhive/epochconfig.hpp#L1

Change forceRestart line from false -> true.  Provided you have the correct BE IP, Port and password set here: https://github.com/EpochModTeam/Epoch/blob/release/Server_Install_Pack/%40epochhive/EpochServer.ini#L5-L7 it will lock the server, send messages about the restart and finally kick everyone before issuing the #shutdown command. 

You will also need a service manager that will restart your server when it crashes or when the #shutdown command is used. I use http://www.firedaemon.com/ for my dev servers and even have it set to auto update from Epoch Experimental steam workshop every time before they restart. this also allows running the log rotator script: https://github.com/EpochModTeam/Epoch/blob/release/Server_Install_Pack/Tools/log-rotator.cmd

Also @Shawn did you mean to post this in the A2 or A3 section?

Link to comment
Share on other sites

  • 0

You should be able to use your BEC scheduler.xml file to do this. Here's an example using maxping to kick all players, you should warn them beforehand that they will be kicked to prevent confusion. I haven't tested this example, but it should work, be sure to edit the start time and job id.

 

Edit: Just tested and this works, it takes about 10 seconds for the maxping to update and kick players, but it works. Also, don't forget to issue the lock command to prevent players from rejoining before restart.

    <job id="9">
        <start>035800</start>
        <runtime>000000</runtime>
        <day>1,2,3,4,5,6,7</day>
        <loop>0</loop>
        <cmd>maxping 0</cmd>
        <cmdtype>0</cmdtype>
    </job>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...