logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
masterserver replacement daemon

 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Tue Jul 12, 2011 13:40    Post subject: masterserver replacement daemon Reply with quote

Hi,

I've started implementing a replacement for the bioware masterserver living at nwmaster.bioware.com, since that seems to be more down than up, especially in recent times.

It's all a bit crude for now, but it can be used to:
* authenticate serverside player accounts
* authenticate serverside cd keys
* prevent player timeouts
* write custom auth handlers

* authenticate clients that are pointed to it
* publish/manage friends list (sort of)

It doesn't (yet!) handle:
* account registration
* gamespy traffic
* everything else

The code lives at: https://github.com/niv/nwn-masterserver

It is running in "production" with my PW, serving as a local CD key checker against a database of known keys.

There is some example code in handlers/; but the whole thing will require adaption to your local environ in any case.

Feel free to patch, adapt & abuse for your own nefarious purposes. Twisted Evil


Last edited by elven on Wed Jun 27, 2012 19:59; edited 1 time in total
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Fri Jul 29, 2011 16:27    Post subject: Reply with quote

This is really awesome. I noticed some queries in the source code, so I'm going to just list some thoughts I had on the protocol, in case any of them turned out to be right. Here's how I'm guessing the conversation goes.

Client: BMMA - request MotD
Server: BMMB - here's MotD
Client: BMRA - probably "what is the latest build"?
Server (when auth is up, guessing a bit here): BMRB - latest build is ...
Client: BMPA - my username and hashed password is...
Server (when auth is up): BMPR - yes/no
BMBI -- research below
Client: BMBE - what are my buddies doing?
Server: BMBF - [list of buddies, servers, etc]

BMBI/BMBJ are a bit strange, but I think it has to do with setting your visibility. With an apparently empty buddy list, the data sent through BMBI (for me) is always 0x02140700. The server's response is BMBJ: the first time is 0x4000c462, all subsequent requests return 0x40000214. As well as when you first log in, BMBI is sent when you toggle a visibility state (never/always/buddies only).
Back to top
View user's profile Send private message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Fri Jul 29, 2011 16:34    Post subject: Reply with quote

Here is a somewhat human-readable listing of all packets. It should be fairly self-explainatory.

The communication actually doesn't have a required sequence except on the highest level (first authenticate to masterserver, then to server, etc). So it doesn't matter if your client actually responds to friend list stuff or not.

BMB* is buddy list stuff, and most of it is already disected and described in the link above.


Last edited by elven on Wed Jun 27, 2012 19:59; edited 2 times in total
Back to top
View user's profile Send private message
PlasmaJohn



Joined: 04 Mar 2005
Posts: 70
Location: The Garage

PostPosted: Tue Aug 02, 2011 15:38    Post subject: Re: masterserver replacement daemon Reply with quote

elven wrote:
Hi,

It doesn't (yet!) handle:
* account registration
* gamespy traffic
...

GameSpy has nothing to do with NWN authentication or buddy lists. That has always been the Master Server.

BTW, thanks for your notes, they included something I didn't quite get right in my own analysis.
Back to top
View user's profile Send private message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Tue Aug 02, 2011 15:39    Post subject: Reply with quote

True enough. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group