Skip to content

Querying a server for information

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).

Comments

  • JimbobslimbobJimbobslimbob Member Posts: 206
    Nice, thanks. I will take a peek.
  • JimbobslimbobJimbobslimbob Member Posts: 206
    @niv On closer inspection I am no closer to getting this working than I was before.

    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?
  • nivniv Member, Moderator, Developer Posts: 410
    edited December 2017
    Of course.

    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.
  • JimbobslimbobJimbobslimbob Member Posts: 206
    Appreciated all the info there, @niv. I managed to get it up and running in the end!
Sign In or Register to comment.