pascalbrax / psnwn

Pascal Simple PHP Neverwinter Nights server scan
3 stars 0 forks source link

Outdated? #1

Closed Norway174 closed 5 years ago

Norway174 commented 5 years ago

Doesn't seem to work anymore.

I've tried checking random servers from http://www.nwnlist.com/, all of them have returned back being offline. Both from the nwn1 and nwn2 category.

I'd use the nwnlist api, but sadly it doesn't return a list of who is online. Just the number of people online.

Is there any hope of making this work, or find any alternatives that does what I need?

trjohnst commented 5 years ago

@Norway174 I believe getting a list of player names requires the server responding to gamespy like requests. This script will only provide the amount online if the gamespy method fails and it falls back to the eriniel method

Norway174 commented 5 years ago

@trjohnst Hmm... Looking over the code. I do believe your right.

I think I just got my hopes up too much from the wording on the readme. opera_2018-10-24_05-54-08

But despite of that, it still reports all the servers I've tested as being offline. Even though, they are online in nwnlist.com.

Or is there maybe something that has to be enabled/installed on the server, that most of those servers don't have enabled/installed by default?

Such as changing their hosts file? http://www.neverwinternights.info/builders_hosts.htm

Though, I would have thought that'd be common practice by now, considering GameSpy is shut down. And all of the servers on nwnlist.com does show up there, and has it's stats updated pretty accurately.

trjohnst commented 5 years ago

@Norway174 it really depends on the server.

From what I understand, most have disabled responding to gamespy-like requests. At least, the server that I was working on this for (Narfell) did. I stopped digging in after I realized that.

I rewrote the eriniel method as a node script as I was going to use it for a web service but never set up the service. If you're interested in a JavaScript rendition of the php in this repo, you can find that at https://gist.github.com/trjohnst/09f2a3622d11fb2226b14a5bfaf76273

Also, I believe http://www.iscandar.ch/ is powered by the same php that's in this repo and has some renditions like plain text or images (if you want to display one in a signature or something like that).

Norway174 commented 5 years ago

So I finally got it working. The example doesn't contain valid PHP, at least for not for my setup.

And it was missing the $timeout = 5; parameter. Once I added that. It was working.

But unfortunately, still doesn't display who is online. Which is what I'm really after.

Norway174 commented 5 years ago

Oh, also... @trjohnst Thanks. But looking over over http://www.iscandar.ch/. It does appear I've made something like that myself already. But it does rely on nwnlist.com.

image (Ignore the IP. Not affiliated with them. And the text is white. This was designed to be displayed on dark backgrounds. :P )

trjohnst commented 5 years ago

That makes sense, the maintainer put this up after I reached out for source code from iscandar. I think it was just a sample.

The script may just be cancelling the request by timing out. I know I had to modify what was sent in the buffer otherwise I just never received a message back from the server.

pascalbrax commented 5 years ago

I'm sorry for misleading.

No, the script was never intended to show who is online, just how many people, I'll fix the readme file.

And yes, this script is what powers iscandar.ch so the fact that it shows servers offline while they should be online, is weird to me, I checked Narfell's server and it shows that the old gamespy method doesn't work, but eriniel's method is giving me back correct results: http://www.iscandar.ch/server.php?ip=66.85.14.202&port=5121&template=black

trjohnst commented 5 years ago

Scratch that I see the image has data, good work!

Norway174 commented 5 years ago

@trjohnst Just a static image. ;) Not really comfortable sharing the url for the tool here. While it is available for public use, I'd rather not advertise it more than I have to.

This is what it looks like on a darker background on Github: image


@pascalbrax No worries. It's all good. I suppose it's the servers that just don't report who is online anymore. Unless they do something special themselves.

Maybe with a module or something that is specifically designed to respond to a certain command or something.

Norway174 commented 5 years ago

@pascalbrax Added a pull request with some proposed changes, and fixes. And I guess we can close this topic now.

Thanks for the help, @trjohnst!

pascalbrax commented 5 years ago

@Norway174 I confirm the script works with "your" server: http://www.iscandar.ch/server.php?ip=46.4.59.55&port=5123&template=black :)

Unfortunately, AFAIK, it was always upon tools like NWNX that have to be injected into the server to get easily a list of characters playing.

Norway174 commented 5 years ago

@pascalbrax Know of any servers with NWNX that does work to get the list of characters currently online from? For testing purposes of course. :P

pascalbrax commented 5 years ago

@pascalbrax Know of any servers with NWNX that does work to get the list of characters currently online from? For testing purposes of course. :P

@Norway174 https://sinfar.net/ has a list of the servers and the characters actually online.

BTW I checked again from iscandar.ch and yes it still works! :) http://www.iscandar.ch/server.php?ip=nwn.sinfar.net&port=5121&template=black&font=classic (of course my script doesn't show who is online)

Norway174 commented 5 years ago

@pascalbrax I'm aware of sinfar. Looking at the web-page. I think they're using some sort of private system they haven't made public. Because I can't find anything online, at all.

And not only can you see who is online. You can see their avatar picture, and read their bio's.