View previous topic :: View next topic |
Author |
Message |
elven
Joined: 28 Jul 2006 Posts: 259 Location: Germany
|
Posted: Tue Jul 12, 2011 13:40 Post subject: masterserver replacement daemon |
|
|
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.
Last edited by elven on Wed Jun 27, 2012 19:59; edited 1 time in total |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Fri Jul 29, 2011 16:27 Post subject: |
|
|
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 |
|
|
elven
Joined: 28 Jul 2006 Posts: 259 Location: Germany
|
Posted: Fri Jul 29, 2011 16:34 Post subject: |
|
|
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 |
|
|
PlasmaJohn
Joined: 04 Mar 2005 Posts: 70 Location: The Garage
|
Posted: Tue Aug 02, 2011 15:38 Post subject: Re: masterserver replacement daemon |
|
|
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 |
|
|
elven
Joined: 28 Jul 2006 Posts: 259 Location: Germany
|
Posted: Tue Aug 02, 2011 15:39 Post subject: |
|
|
True enough. :) |
|
Back to top |
|
|
|