Querying a server for information
Jimbobslimbob
Member Posts: 206
Does anyone have any information on how to do this with NWN?
Was looking into adding the functionality into GSM, but couldn't find out anything on the way it was done. Someone out there must have written something like this before (I am working in C# and/or VB .NET).
Was looking into adding the functionality into GSM, but couldn't find out anything on the way it was done. Someone out there must have written something like this before (I am working in C# and/or VB .NET).
0
Comments
https://github.com/niv/neverwinter_utils.nim/releases
Firstly, the compiled program "nwn_net" complains of a missing dll "pcre32.dll", so I cannot even verify that that works.
Secondly, I am not really understanding from the source exactly what I am supposed to do. DO bear in mind I am writing in .Net here.
I create a UDPClient, connect to the IP and port, then that's pretty much it. Nothing I send to it gets any response... so forgive me if I am being dumb here, but could you give me any pointers?
There's three types of inquiry you can send: BNES, BNDS, BNXI.
They are responded to with, respectively: BNER, BNDR, BNXR.
For the binary packet definitions, see: https://github.com/niv/neverwinter_utils.nim/blob/master/src/packets.nim#L30
Note that port usually refers to the local port, but is ignored in almost all instances.
I hope the struct definitions are readable. For example, a size-prefixed string of uint8 is a byte describing the string length, followed by the string (\x05hello).
Just encode the fields in network byte-order.