Stat Feed for dogtags

For discussion of the BB stats code.
bigbacon

Stat Feed for dogtags

Postby bigbacon » Wed Sep 03, 2008 8:22 am

Trying to figure out how I get an entire dogtag list.
I can get as far as something like this.
http://stella.prod.gamespy.com/getleade ... spx?auth=T[ANwEGqs24Xkdty8w[7xQ__&pid=82490978&type=weapon&id=12&dogtagfilter=1
but after that, I don't know what to do. It gives me upto 17 or 18 hits but I can seem to figure out how to get an entire list.

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4232
Joined: Thu Dec 01, 2005 10:40 pm

Re: Stat Feed for dogtags

Postby Mort » Fri Sep 05, 2008 11:45 am

I don't know the values as well as Piers, but you aren't filtering against your buddy list or something? One thing I hve noticed is players that haven't been on for a while seem to drop of the dogtag list and only re-appear after they play again. If you are talking about the "all tags collected" though then I'm guessing you have a few more than a couple of dozen you are expecting to see ;)

I'll have a look at the queries we are using already over the weekend. Otherwise you'll need to wait for Piers to find some spare time to respond with his thoughts.
Image

User avatar
Piers
Comfortable with my sexuality
Comfortable with my sexuality
Posts: 1408
Joined: Fri Dec 02, 2005 7:57 am
Location: Horse country

Re: Stat Feed for dogtags

Postby Piers » Fri Sep 05, 2008 9:52 pm

You should set type=overallscore then the results will be ranked by the knifed opponents' scores.
If you use type=weapon&id=12 you may accidentally drop any knifed opponents who haven't used weapon 12 (it's them using 12, not you!)

the results come back like

Code: Select all

H    rank    pos    pid        nick    globalscore    playerrank    countrycode    Vet    dt
D    31470    1    81624909    Spiv          1084             9            CA        0    1


so you'll have one header row and lots of data rows, it's up to you to munge that data into a sensible multi-dimensional array - use a hash or DO depending on the language you're writing in.

One other thing, give it a while to run! - the EA stats servers are not fast - I generally write my retrieval loop code to give me a confirmation of completion at the end so I know when all the data has finally come through.

If you still don't get all the data, send additional requests but add pos=x as an additonal param, where x is the highest value reached in the thrist column of the previously requested data.

Alternatively, set after=n where n is the number of unique tags you have.
Image

bigbacon

Re: Stat Feed for dogtags

Postby bigbacon » Fri Sep 05, 2008 10:44 pm

So I was pretty close, I was getting about 26 data rows back and thats it which isn't anywhere close to the amount of tags I have and I suspect not even close the amount of players that are still active. (could be wrong)

I'll play around with it and try your suggestions and see how it goes. I'll get back to you. I finally got my stat site working and then a friend asked me about this so I figured I'd give it go.

Problem I am having is you need to get a POS and AFTER commander or I just get an error back. The AFTER command for me can not be over 17 or I get an error code back.

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4232
Joined: Thu Dec 01, 2005 10:40 pm

Re: Stat Feed for dogtags

Postby Mort » Fri Sep 05, 2008 11:07 pm

bigbacon wrote:I finally got my stat site working and then a friend asked me about this so I figured I'd give it go.
Care to share?
Image

bigbacon

Re: Stat Feed for dogtags

Postby bigbacon » Fri Sep 05, 2008 11:24 pm

Ok I see what I need, I never noticed that the return tells me how many pages Of data there is.

For example, it's giving me 141 total whatevers of data so POS can go up to 141 before no new data is returned. After can only go to 17 or it errors no matter what. I got the data up to 283 names but thats still about 70 off but as stated, some of the are problably those who don't play anymore. Only issue I have with this is that I am thne making 141 calls to the server to get this databack which can't be good.

bigbacon

Re: Stat Feed for dogtags

Postby bigbacon » Sat Sep 06, 2008 12:16 am

you'll have to forgive the mess right now.

http://chadcarey.com/2142/2142-readtest ... d=82490978

I have a seperate page that does the data reading at the moment because I havn't completed making a service that will update it on some specific interval. All data is accounted for in my database but not all of it is displayed yet.

Only thing I have not figured out yet is how to handle award requirements so they can display with the awards. Not sure if it's best to find a way in SQL to manage that or just create functions for each award and do it as it's loaded on the page.

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4232
Joined: Thu Dec 01, 2005 10:40 pm

Re: Stat Feed for dogtags

Postby Mort » Sat Sep 06, 2008 1:27 am

bigbacon wrote:Only thing I have not figured out yet is how to handle award requirements so they can display with the awards. Not sure if it's best to find a way in SQL to manage that or just create functions for each award and do it as it's loaded on the page.

Have you based this on our code at all? If so, just look at the code Piers has done with all the award reqs defined that he then matches and displays as a hover over.
Image

bigbacon

Re: Stat Feed for dogtags

Postby bigbacon » Sat Sep 06, 2008 3:38 am

No, none of thaat is based off your code.

The hover over is not my concern, that I can do a million different ways. My concern was trying to figure out the best way to either store the requirements and/or gather the requirements based on the player's stats.

My attempt to use SQL only worked 50% because things like use a transport for X hours or X kills couldn't be defined in my table. I'll download your code and take a peek.

Actually, the only thing I borrowed from you guys was all the images.

Edit:.......
I see what you did now, I was trying to do this but with SQL which wasnt working out, this is pretty much what my other option was, I was really just trying to find a reusable function to get what I needed and not a huge case/if/function for each award.

Pretty neat to look at this, we did a lot of the same kind of things like seperating each thing into seperate functions that return tables. My database is 100% different though. I have the saved player data seperated into different tables and I have lookup tables for all the stuff which includes the descriptions and what not, I should dump it so you can see it.

EDIT #2:
Here is my SQL script if curious
http://chadcarey.com/kalrenia.sql
You can also see my attempt above in the LU_AwardReq table.

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4232
Joined: Thu Dec 01, 2005 10:40 pm

Re: Stat Feed for dogtags

Postby Mort » Sat Sep 06, 2008 12:36 pm

That link to the sql doens't seem to work... 404

In some way it might make sense to split the DB into multiple tables... I assume you have a different table for maps, weapons, etc. If the database was huge, like 2142-stats or something I guess it would make sense, but I never really considered it to be an issue. We've been capturing stats for quite a while now, and the DB isn't really that big, and if anything the queries are smaller and quicker with a single table than if they were split across tables. There's a few things I'd probably do differently if I was writing it from scratch again, but I don't think Piers or myself are that keen to start over. That's why I' was hoping other people might decide to take up the cause.
Image

bigbacon

Re: Stat Feed for dogtags

Postby bigbacon » Wed Sep 10, 2008 12:39 am

aparently my host doesn't like .sql ext. http://chadcarey.com/kalrenia.txt

This is how it made sense to me, I don't expext larges amounts of data either.

User avatar
Mort
Alpha-Forum Whore
Alpha-Forum Whore
Posts: 4232
Joined: Thu Dec 01, 2005 10:40 pm

Re: Stat Feed for dogtags

Postby Mort » Wed Sep 10, 2008 10:13 am

That seems rather more complex than I would think it needs to be. At most I would have thought of 2 or 3 seperate tables, but with that many then I would imagine almost every query you do would have to go into massive index linking to return the results. Lots of small tables like that wouldn't really lead to very good efficiency I would expect.

I also noticed you've used different field names to what EA returns in the stats, which helps to some degree for humans reading the data, but it also means you now have to keep a mapping system in your code to match the EA fields to the ones you have used.

All said though, if that works for what you are doing then that's cool, but if you start doing large block queries for multiple people (e.g. like our clan comparison table of all stats) then I would imagine the server being rather busy working on it.
Image


Return to “The Buddabudda Stats system”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests