Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Auto Update your statics daily

Status
Not open for further replies.
Skilled Illusionist
Joined
Oct 28, 2008
Messages
379
Reaction score
47
Hi,
I've seen people asking, why dont my statics update???
That's because you need to do it manualy. Why manualy?
Because if you have a lot of players it will take alot of ram.
Now if you want to update daily you could use a cronjob on your host. But for the people who don't know a thing about that here is my little script.

1. Download the attachement and put it in the ./includes/functions/ folder

2. Open 'todofleetcontrol.php' in the ./includes/ folder

3. At the bottom add this line
PHP:
include(ROOT_PATH . 'includes/functions/UpdateStatics.'.PHPEXT);
If you use Xnova 0.X add this line
PHP:
include($xnova_root_path . 'includes/functions/UpdateStatics.'.$phpEx);

4. Open Common.php in the root direction

5. Before
PHP:
SetSelectedPlanet($user);
Add
PHP:
//lines for auto update statics
$time = time();
$tomorrow = time() + 86400; //Change this number if you want to be at other time. The time is in seconds so 86400 is 1 day
$laststup = doquery("SELECT * FROM {{table}} WHERE `stat_date` > '$tomorrow'",'statpoints');
if(mysql_num_rows($laststup) != 0){
  updateStatics();
}
unset($laststup);
unset($time);
unset($tomorrow);

You're done. Every time the script updates you'll get a message that the daily update went succesfull.

Greetz Aropop
 

Attachments

You must be registered for see attachments list
Last edited by a moderator:
Status
Not open for further replies.
Back
Top