You are not logged in.

#1 05 Apr 2007 7:42 pm

Mort
Member
From: Sydney
Registered: Apr 2007
Posts: 5
Website

Checking Buddy online status

Greetings,

I must say the wikis and various dev work have been brilliant and it's been fantastic to get our clan stats feed up and running, but one thing I've not noticed anyone talk about is checking the active "online" status of buddies.

In-game your buddy list will show you who's online/offline and where they are at, so there must be some sort of client query happening to get that info, does anyone know how that works? It would be great to create a small gadget or something to query what your buddies are up to without needing to go into the game itself.

We only do our stats feed once a day, but the buddy online checker would be a more "real-time" type check so I guess would be a lot smaller impact than a full stats dump?

Any thoughts / ideas?

Scott.

Offline

#2 05 Apr 2007 11:43 pm

From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: Checking Buddy online status

I haven't looked at the built in buddy protocol yet, but I'd be surprised if that didn't require authentication w/ the ea servers.

a fairly low tech way of getting that info would be to pull the list of ranked servers (maybe even filter them down by the IP Addresses your local region), then query each of the ranked servers and get the list of players currently playing and watch for certain lists of people.  you could create a "buddy" table for your users, where they can add who to watch for, or you can just watch for everybody in your clan, and when they show up on one of the monitored servers, add their online status and server info of where they're playing.  it may sound like a lot of work, and it would be more stress on your server than the game stats, but the game servers aren't effected much by this (I know of at least 3 sites that do this).  The protocol to do this has been around for a while, its gamespy's v4 (or 3, cant remember off the top of my head which it is), and folks have already written code you can use for that (ex: gslist (master server list), and lgsl (in game player info / server info)).

Offline

#3 05 Apr 2007 11:58 pm

Mort
Member
From: Sydney
Registered: Apr 2007
Posts: 5
Website

Re: Checking Buddy online status

Try to query *every* ranked server? That's seems rather crude and probably not something I'm inclined to want to try. There must be a much simpler way to do it than that. If authentication is required then I don't have a problem with that as we already have that working when we connect to get our stats.

I don't really even know how that stuff works as another guy in our clan has worked all that out, but I would imagine there must be some simpler way to get your buddy stats in the same way the 2142 client does already... There must be some query you can do against a PID that returns the current server they are on and if they are logged in... The buddy list in 2142 does show people are online even when they aren't in a server, so it's got to exist somewhere as a simple query I would think.

Offline

#4 06 Apr 2007 8:40 am

From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: Checking Buddy online status

Mort :

Try to query *every* ranked server? That's seems rather crude and probably not something I'm inclined to want to try.

Agreed.  It was just a suggestion.  meanwhile I'll look to see what there is around the in game buddy list.  I only hope its as easy as the stats or server query protocol.

Offline

#5 06 Apr 2007 8:47 am

Mort
Member
From: Sydney
Registered: Apr 2007
Posts: 5
Website

Re: Checking Buddy online status

That would be cool. I'm just talking small clan based stuff here, I'm not trying to do any sort of open public service or anything.

Considering the buddy list appears to update in near real time, I was almost wondering if there's some sort of P2P thing going on. I can be watching my buddy list when no-one is on a server, and within 5 seconds of them joining, the list updates to show me which server they are on. I would imagine with that sort of real-time response it may be easier to sniff what's going on.

Offline

#6 06 Apr 2007 10:24 am

From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: Checking Buddy online status

I took a quick peek at it here at work.  it looks like its tied directly to the game log in process.

there are a series of client challenge / server response, where the server gives you a list of your buddies, and you can take that info and query for each buddy on your list.

I don't know / cant tell how tightly coupled that protocol is, whether you pull your own list (meaning players not in your local buddy list) of players or whether you can only query ones in the list the server gives you.  it looks like you may be able to send in queries for any player, and get their stats, but it uses session keys that are given as part of the list (with the players info from your buddy list), so until someone tries it out, we wont know.

here's a dump of the tcp traffic (this is more for me, so I can look at this a bit closer when I get home). lines separate client / server chatter

Code:

\lc\1\challenge\IHYUGWTHZH\id\1\final\

\status\1\sesskey\22038017\statstring\Online\locstring\Battlefield 2142\final\

\getprofile\\sesskey\22038017\profileid\81246737\id\2\final\

\bm\1\sesskey\22038017\t\81246737\msg\asdfasdf\final\

\logout\\sesskey\22038017\final\

\lc\1\challenge\SWRJLYCZHN\id\1\final\

\status\1\sesskey\131701165\statstring\Online\locstring\Battlefield 2142\final\

\getprofile\\sesskey\131701165\profileid\82188143\id\9\final\

\pi\\profileid\82188143\nick\Qw4z0\userid\69640344\sig\ce33dc4b20f4b04e7e24729660580e1e\pid\18\firstname\\lastname\\lon\0.000000\lat\0.000000\loc\\id\9\final\

\logout\\sesskey\131701165\final\

Offline

#7 11 Apr 2007 12:53 pm

sanman
Member
Registered: Mar 2007
Posts: 12

Re: Checking Buddy online status

I took a quick peek at it here at work.  it looks like its tied directly to the game log in process.

there are a series of client challenge / server response, where the server gives you a list of your buddies, and you can take that info and query for each buddy on your list.

I don't know / cant tell how tightly coupled that protocol is, whether you pull your own list (meaning players not in your local buddy list) of players or whether you can only query ones in the list the server gives you.  it looks like you may be able to send in queries for any player, and get their stats, but it uses session keys that are given as part of the list (with the players info from your buddy list), so until someone tries it out, we wont know.

here's a dump of the tcp traffic (this is more for me, so I can look at this a bit closer when I get home). lines separate client / server chatter

Code:

\lc\1\challenge\IHYUGWTHZH\id\1\final\

\status\1\sesskey\22038017\statstring\Online\locstring\Battlefield 2142\final\

\getprofile\\sesskey\22038017\profileid\81246737\id\2\final\

\bm\1\sesskey\22038017\t\81246737\msg\asdfasdf\final\

\logout\\sesskey\22038017\final\

\lc\1\challenge\SWRJLYCZHN\id\1\final\

\status\1\sesskey\131701165\statstring\Online\locstring\Battlefield 2142\final\

\getprofile\\sesskey\131701165\profileid\82188143\id\9\final\

\pi\\profileid\82188143\nick\Qw4z0\userid\69640344\sig\ce33dc4b20f4b04e7e24729660580e1e\pid\18\firstname\\lastname\\lon\0.000000\lat\0.000000\loc\\id\9\final\

\logout\\sesskey\131701165\final\
What tool do you use?

Offline

#8 11 Apr 2007 1:19 pm

From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: Checking Buddy online status

http://www.ethereal.com/

Sorry Mort, haven't had a chance to look at this yet.  Its on my todo list though.

Offline

#9 11 Apr 2007 5:29 pm

Mort
Member
From: Sydney
Registered: Apr 2007
Posts: 5
Website

Re: Checking Buddy online status

I'm actually surprised that no-one else seems to have already thought to work it out though, but I've been without it for this long now, so I'm happy to wait for anything whenever you have the time.

Offline

#10 03 May 2007 7:14 am

Mort
Member
From: Sydney
Registered: Apr 2007
Posts: 5
Website

Offline

#11 03 May 2007 1:33 pm

From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: Checking Buddy online status

I've looked at it a little bit.  if the challenge / request is the same as the server query protocol then it should be pretty easy to emulate.  if not it could take a while to figure out.

Offline