Jump to content
  • 0

Auto Wipe at the same time every day


Question

Posted

Hello everyone! I'm on to make a system that wipes the server clean each night at 12 am ---> idle for 12 hours and then starts again. This cycle to go on forever 😛 I have basic knowledge of java, and I'm using aCis sources. Any help or guidance would be appreciated! I was thinking of checking the systems of olympiad or sieges to understand time events, is it right thinking? thanks in advance!

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

If by auto wipe you mean dropping all players data and such, the easiest is to disconnect all Players, avoid login entrance and then to call used tables on the full reset db installer.

 

Once everything is done, you can allow anew login and force server restart for proper reset.

 

For the task itself, check gameserver.taskmanager. You can also implement it using ScheduledQuest if you want it triggered/managed by scripts.xml.

Edited by Tryskell
  • 0
Posted

Hey thank you!!! I'm getting there xD when I finish I will share! For checking time should I use calendar and threadpool so it checks every 5 secs if the time is 12? sorry if question is noob, trying to learn 😛

  • 0
Posted
47 minutes ago, Adon_Ace said:

Hey thank you!!! I'm getting there xD when I finish I will share! For checking time should I use calendar and threadpool so it checks every 5 secs if the time is 12? sorry if question is noob, trying to learn 😛

 

No need to check every 5 sec, Use ThreadPool.schedule for 12 o'clock, then ThreadPool.schedule with 1000 * 60 * 60 * 12 (12 hours in milliseconds). 

 

However you should look into ScheduledQuest, it's much easier to use and it handles any time format you want.

  • 0
Posted
3 hours ago, Adon_Ace said:

Hey thank you!!! I'm getting there xD when I finish I will share! For checking time should I use calendar and threadpool so it checks every 5 secs if the time is 12? sorry if question is noob, trying to learn 😛

 

ScheduledQuest is actually perfect for timed events, if you don't want to use it you will have to implement/clone ScheduledQuest logic.

 

That's basically a Calendar set in a given time - actual Calendar and the difference of those 2 is the time to fire the task.

 

You don't need to check every 5 sec. Once the event is called, you simply recalculate it and launch another task. You calculate/launch it at server startup and then it fires automatically based on the calculations.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.



×
×
  • Create New...