dodgeitorelse3 Posted July 27, 2012 Share Posted July 27, 2012 Hi all, we have a game tracker that tracks lots of data from several game servers. I want to be able to track the last five maps for these servers but I am not sure how to go about it. If any one has a suggestion or a tutorial for me to look at I would be greatly appreciative. I am not looking for someone to write code for me, I just want to be pointed in the right direction is all. At the moment I have no code for this part. Quote Link to comment https://forums.phpfreaks.com/topic/266366-track-last-five-maps-played-on-a-server/ Share on other sites More sharing options...
xyph Posted July 28, 2012 Share Posted July 28, 2012 Need more information Quote Link to comment https://forums.phpfreaks.com/topic/266366-track-last-five-maps-played-on-a-server/#findComment-1364990 Share on other sites More sharing options...
dodgeitorelse3 Posted July 28, 2012 Author Share Posted July 28, 2012 we track america's army coop servers. In the tracker it shows the current map ( see trackers at http://chevys-place.game-server.cc/servertracker.php. All the data in the tracker is cached in our database. I want to place a link on each tracker that will show the last 5 maps that have been on each server. I want to do this via an include file but I am not sure how to go about storing a list of maps in database. I wil be using a separate db for this data as it will make it easier for me to keep an eye on all the stuff we have. What I need a point in the right direction is this. Say I created a new database for this and managed to store the first map in there. then the next map that is on tracker wiould look at database and say hey, there is only one so we will add a second, and so on till there are 5. then how to remove the first and add another at the 5th spot so that I have a valid list of 5 maps in order of being seen on server. Hope this makes sense. Would this need to be a cron job? As I said I have no code for this yet. I am just looking for input from skilled folks like you to point me in the right direction. I should also say that since the data is cached in database the only time cache is updated is when a user looks at tracker page. So really to keep an accurate count of the last 5 maps would it need to be a cron job? Quote Link to comment https://forums.phpfreaks.com/topic/266366-track-last-five-maps-played-on-a-server/#findComment-1364993 Share on other sites More sharing options...
Solution scootstah Posted July 28, 2012 Solution Share Posted July 28, 2012 Yeah, you'd probably need a cron job for accurate results. Ping the script once a minute or so, or whatever feels right. As for the database, if you only want to ever have 5 rows then you'd simply need to delete the oldest when inserting a 5th. You can determine the oldest with either a timestamp or by using the lowest auto-incremented ID. Quote Link to comment https://forums.phpfreaks.com/topic/266366-track-last-five-maps-played-on-a-server/#findComment-1365001 Share on other sites More sharing options...
dodgeitorelse3 Posted December 16, 2013 Author Share Posted December 16, 2013 ty scootstah Quote Link to comment https://forums.phpfreaks.com/topic/266366-track-last-five-maps-played-on-a-server/#findComment-1462415 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.