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 
 
This might help someone in the debries of NWN/NWN2

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



Joined: 24 Sep 2006
Posts: 8

PostPosted: Sun Feb 11, 2007 2:16    Post subject: This might help someone in the debries of NWN/NWN2 Reply with quote

Here I include some info about NWN and NWN2.

First, about NWN.
Approximately three years ago I wrote some code for NWN server to be
able to run user-written scripts in C#. A part of the language was actually implemented. Example of what C# code looks like
Code:

         NWN.AreaObject area = NWN.ObjectManager.GetObjectByID(1) as NWN.AreaObject;
         if(area != null && area.IsValid)
         {
            PlaceableObject plc = area.CreateObject((uint)NWN.Constants.OBJECT_TYPE_PLACEABLE,"chest003",new Vector3D(10,10,0)) as PlaceableObject;      
            if(plc != null && plc.IsValid)
            {
               plc.Events.OnOpen += new NWN.EventHandler.Event(Container_OnOpen);
               plc.Events.OnClose += new NWN.EventHandler.Event(Container_OnClose);         
            }
         }


So, the implementation of all that is included with source code and stuff.
As a child of that project I made a GUI addon for NWN client. Basically, it is possible to send the client a script(written in AngelScript, very close to C code) that would open any kind of custom window(using CEGUI library to draw stuff) for user to type press buttons. The response is sent back to the server. I also include it.
That very shortly explains what is in the archive about NWN.
I made an attempt to make it more or less portable to next versions of
NWN. I think the "really working" version is 1.62. file ServerAddress.h contains a lot of function poiters with signatures. I included the program ServerAddressParser that given an executable will fill in the right addresses according to the signatures for later versions of NWN.
I hope it will work for majority of those functions. Note thou that not everything is included in ServerAddress.h, and some stuff is still hard-coded in the code.

So, if anyone is interrested in looking how i implemented things, take a look at it. It worked for me back them. By that I mean it compiled, I could run 1.62 version of NWN, run C# scripts of Bank.cs, ChatWindow.cs,
could create windows on the client side using those scripts, could chat with others nwn clients. Basically it was fully-working back then. I hope it still does.

I stopped further development simply because I did not have time to continue.

---------------------------------------------------------------------------------

Second, about NWN2.
Here I almost did not write any code at all. Instead I tried to document
how network layer of NWN2 works. These are several text files explaining the structure.

Also, I did some research and implementation on how NWN2 handles different files namely TRN, MDB...

Also I include IDA 5.0 diassembly and annotations to functions in NWN2 server. That is everything for 1.01 version of NWN2. But as it was proven, network layer does not change a lot from version to version.

So, if anyone is interesed in the network layer of the NWN2 game, take a look at it.

I did not write what each certain given packet does, more of a overall picture. At this point it is not very hard to find out what data is sent in each packet, since mostly all methods to the network stream are decoded in IDA, and packet creation in NWN2 is simply calling those functions.

Downloads
NWN2: http://rinat.acm.jhu.edu/everything_nwn2.tar.gz
NWN: http://rinat.acm.jhu.edu/dotNETserver_and_networkGUI.tar.gz

Ask questions in this thread if anyone has any. Will try to answer them if I can.

Anyone having any question about any of that previously written stuff, also can mail me at
xshock.nwn@gmail.com

Finally, if I am breaking any law, mail me about it.
Back to top
View user's profile Send private message
XShocK



Joined: 24 Sep 2006
Posts: 8

PostPosted: Sun Feb 11, 2007 2:25    Post subject: Reply with quote

Addition:

File .\data\proxy\proxy_with_packet_splitter.rb
is a proxy, as eveyone guessed, between NWN2 client and server.
It sorts out packets in the protocol.
It splits a packet into many messages, inflates those that were compressed and stuff. For example when the BIC file(character file) is loaded from client to server, it is compressed and split into several packets. The proxy stitches it together and inflates.
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Mon Feb 12, 2007 4:34    Post subject: Reply with quote

The NWN2 info is good stuff, you might want to post that on nwvault as well -- I suspect there are several who can make use of it.
_________________
Khalidine, a NWN2 persistent world

Looking for volunteers.
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