glest / glest-masterserver

Master server code for Glest
https://glest.dreamhosters.com/
GNU General Public License v3.0
8 stars 8 forks source link

database shouldn't store game stats forever #11

Closed andy5995 closed 6 years ago

andy5995 commented 6 years ago

I don't know of any reason why the database should store stats like these forever

https://zetaglest.dreamhosters.com/showPlayers.php

There's a var in config that determines how many games are shown, and that same var could be used to determine how long to keep data on games played and by what users.

craigpotter commented 6 years ago

Kinda looks like you have this - cleanupGameStats()

Looks like it is never called however?

andy5995 commented 6 years ago

@craigpotter very likely. We didn't write the original code, as this is a fork of MegaGlest. Though we've updated a lot of code, there's still a lot that hasn't been reviewed yet. Can you tell if that function works, and just needs to be called somehow?

andy5995 commented 6 years ago

@sexybiggetje Would it be a good idea to just put the function in a separate file, then run it as a cron/scheduled job?

martijndeb commented 6 years ago

Sure that's fine, just wget / corl it and write the output to /dev/null :)

craigpotter commented 6 years ago

Hold off... I don't think this function will do it ... but it is close....

This function only purges games that are marked as "finished" and are less than 5 minutes duration.

Looking at https://zetaglest.dreamhosters.com/showPlayers.php, you can filter by day,week,month and all time.

I suggest I create you separate file which you can wget/curl or run via cronjob that wipes data over 3 months ?

Thoughts?

andy5995 commented 6 years ago

yeah, that sounds good. But purging at 1 month. I can set up the cron job on the host this code runs on.

craigpotter commented 6 years ago

No worries... Working on it now.