Jump to content
  • 0
Shawn

Kick all players prior to restart

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.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
  • 0
11 minutes ago, Shawn said:

There is a dupe that works on every single server. I'm not going to mention how it works, but it is fixed if players do not get session lost, and are kicked prior to restart.

Or if you decrease intervals that Redis saves ;) 

Share this post


Link to post
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?

Share this post


Link to post
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>

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
Answer this question...

×   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...