Look What I Made! (Server Tracking)

This is a general open discussion for all ALFA, Neverwinter Nights, and Dungeons & Dragons topics.

Moderator: ALFA Administrators

User avatar
NickD
Beholder
Posts: 1969
Joined: Sat Jul 31, 2004 9:38 am
Location: Auckland, New Zealand

Re: Look What I Made! (Server Tracking)

Post by NickD »

:oops:

Web development isn't really my forte and I've never used php before...

A purely text output php file would be good. I PMed Roek the format I wanted it in a few days ago. Basically: Player Name|Character Name|Is DM? (0=No, 1=Yes)

So it'd be something like:

Code: Select all

NickD|Gruuhilda|0
danielmn|Garlus Ironbeard|0
Curmudgen|DM_Curmudgen|1
That would be the "Player List" option. I am planning on allowing three options for displaying the player list (4 if you include "None").

Player List: Grabs an online file in a specific format and uses it to build the player list grid. This is the preferred option, and is the only one the favoured players system will work with.
Custom List: Grabs an online file in a non-specific format and uses it to build a grid with the first line being the column headers. This is a less preferred option as I would be unable to determine the player name, and I couldn't format the grid properly.
Web View: This is the easiest option. It'll just display a webpage instead of a player list, so the page opened could be a web page with the player list on, it could be the server's forums, it could even be facebook or youporn if the user decided to set it up that way. Not the nicest option though as each row change will mean reloading a webpage.

Anyway, if I finish all my changes before the player list is ready, I'll do a release then with just the webview option enabled, so there's no desperate need to rush, there'll still be plenty to do for the next release.
Current PCs:
NWN1: Soppi Widenbottle, High Priestess of Yondalla.
NWN2: Gruuhilda, Tree Hugging Half-Orc
User avatar
zicada
Infrastructure Prawn
Posts: 7924
Joined: Thu Apr 04, 2002 10:00 pm
Location: Earth

Re: Look What I Made! (Server Tracking)

Post by zicada »

Im not sure i understand completely. Why would you want an app that just displays the contents of a webpage ? I use firefox for this purpose :D

Seems fairly bikeshed to do module-development to implement a feature we already have working to me. Nobody has asked me about doing changes/additions to the site for this either.
"The God of the Old Testament is arguably the most unpleasant character in all fiction: jealous and proud of it; a petty, unjust, unforgiving control-freak; a vindictive, bloodthirsty ethnic cleanser; a misogynistic, homophobic, racist, infanticidal, genocidal, filicidal, pestilential, megalomaniacal, sadomasochistic, capriciously malevolent bully." -- Richard Dawkins
User avatar
NickD
Beholder
Posts: 1969
Joined: Sat Jul 31, 2004 9:38 am
Location: Auckland, New Zealand

Re: Look What I Made! (Server Tracking)

Post by NickD »

zicada wrote:Nobody has asked me about doing changes/additions to the site for this either.
I included you in on the PM I sent Roek.
Current PCs:
NWN1: Soppi Widenbottle, High Priestess of Yondalla.
NWN2: Gruuhilda, Tree Hugging Half-Orc
Hialmar
Fionn In Disguise
Posts: 3784
Joined: Sat Jan 03, 2004 11:54 am
Location: Toulouse, France
Contact:

Re: Look What I Made! (Server Tracking)

Post by Hialmar »

zicada wrote:Im not sure i understand completely. Why would you want an app that just displays the contents of a webpage ? I use firefox for this purpose :D

Seems fairly bikeshed to do module-development to implement a feature we already have working to me. Nobody has asked me about doing changes/additions to the site for this either.
If the page outputs to a simple file formatted as NickD puts it, his app could parse it and allow to implement friends list with a popup when a friend logs in and things like that.

I have looked at Roek's code quickly and I think that he could just write the data he gets during the cron to a text file that Nickd's tool could just then read.

I can do this change but Roek's code looks like he is continuing development on this to offer other (secret?) features.

I'll PM him as well.

Edit: just a note that this wouldn't be a big development. Just 5 or 6 lines of codes added to a function in the servers module.
User avatar
zicada
Infrastructure Prawn
Posts: 7924
Joined: Thu Apr 04, 2002 10:00 pm
Location: Earth

Re: Look What I Made! (Server Tracking)

Post by zicada »

I guess i was more confused as to the purpose, as I thought Nick posted this on the vault as a general tool for the public. Why would people who aren´t alfamembers want to get a list of our players logging on / off all the time, unless they implement the exact same system in other PWs as well, which would require quite a bit of documentation and work on their end.

I think it would be a good idea to decide wether this is an ALFA thing or a general NWN community thing. If it´s an ALFA thing, how does it improve on using the website for getting playernumbers + playerlist ? If it´s a NWN community thing, isn´t packetsniffing and parsing data directly from GS as was the original idea a much better approach ?

There´s no real problem really in implementing this, I just think we have quite a bit of stuff to do,- so i´m unsure what we´re gaining other than this being fun hacking for the purpose of fun hacking.
"The God of the Old Testament is arguably the most unpleasant character in all fiction: jealous and proud of it; a petty, unjust, unforgiving control-freak; a vindictive, bloodthirsty ethnic cleanser; a misogynistic, homophobic, racist, infanticidal, genocidal, filicidal, pestilential, megalomaniacal, sadomasochistic, capriciously malevolent bully." -- Richard Dawkins
User avatar
zicada
Infrastructure Prawn
Posts: 7924
Joined: Thu Apr 04, 2002 10:00 pm
Location: Earth

Re: Look What I Made! (Server Tracking)

Post by zicada »

Anyway,

Here´s the parsed db output in txt format.

http://www.alandfaraway.org/serverpop.txt

Thanks to Hialmar for implementing.
"The God of the Old Testament is arguably the most unpleasant character in all fiction: jealous and proud of it; a petty, unjust, unforgiving control-freak; a vindictive, bloodthirsty ethnic cleanser; a misogynistic, homophobic, racist, infanticidal, genocidal, filicidal, pestilential, megalomaniacal, sadomasochistic, capriciously malevolent bully." -- Richard Dawkins
Hialmar
Fionn In Disguise
Posts: 3784
Joined: Sat Jan 03, 2004 11:54 am
Location: Toulouse, France
Contact:

Re: Look What I Made! (Server Tracking)

Post by Hialmar »

I can modify it to include gsids and DM/not DM info.

It's quite easy with very little modifications but I'll first wait on Roekemoes ideas so that we don't cross each other with concurrent modifications to the code.

So maybe you can just pull this in your tool for now and we'll see with Roek for the rest.

Edit:
If you want you can put this example php code to your documentation so that if other servers want to do something similar can use it:

Code: Select all

	$file = fopen($path_to_website_root."/serverpop.txt", "w");
	if($file) {
		fputs($file, $playersTsm);
		fputs($file, $playersBg);
		fclose($file);
	}
User avatar
NickD
Beholder
Posts: 1969
Joined: Sat Jul 31, 2004 9:38 am
Location: Auckland, New Zealand

Re: Look What I Made! (Server Tracking)

Post by NickD »

http://nwvault.ign.com/View.php?view=NW ... tail&id=78

A new version is up! (Finally... would have been done a couple of weeks ago, but life seems to hate me right now...)

I put together a new sample serverlist.txt file in the zip file. There are 50 of them there, so it can take a fair while to load up and for each refresh. If you decide to use this new serverlist, I'd recommend deleting the servers you are not interested in, in order to speed up the refresh. I don't recommend having more than a dozen servers in your personal list.

Changes
=======
* PLAYER LISTS! Implemented the player list panel with Player List, Customer List and Website options. This information can't be retrieved from the server itself, so each server must set up their player lists individually (probably via NWN database stuff). To see samples, look at the two live ALFA servers in the list for a player list setup and the Abyssya server for a sample of a website based player list.

* EDIT SCREENS! Added edit screens for the Server List and Settings, so no more fiddling with the files themselves.

* LAUNCH BUTTON! Added a launch button to the Server Details panel. This will perform a direct connect to the server. This will, however, only work for NWN1 servers that are online and only on machines that have NWN1 installed.

* Added additional information to the Server Details panel, including when the server went online/offline and how long it has been online or offline and a hyperlink to the website, as set up in Edit Server List screen.

* Added launch menu options from both NWN1 and NWN2 (the application only from here, not the currently selected server).

* Added a link to the NASTI NWN Vault page on the About box.

* Changed the Close button to a Hide button, so it now minimises the application rather than closing it.
Current PCs:
NWN1: Soppi Widenbottle, High Priestess of Yondalla.
NWN2: Gruuhilda, Tree Hugging Half-Orc
Veilan
Lead Admin
Posts: 6152
Joined: Mon Jan 05, 2004 3:33 pm
Location: UTC+1
Contact:

Re: Look What I Made! (Server Tracking)

Post by Veilan »

So this is why you didn't come play today... :o
The power of concealment lies in revelation.
User avatar
NickD
Beholder
Posts: 1969
Joined: Sat Jul 31, 2004 9:38 am
Location: Auckland, New Zealand

Re: Look What I Made! (Server Tracking)

Post by NickD »

If anyone is using this still, please note that TSM's IP address has changed, so you will need to change it in the Edit Server List screen or it will show as being Offline. The new IP Address is 71.206.168.254 I don't know if this is a permanent change.
Current PCs:
NWN1: Soppi Widenbottle, High Priestess of Yondalla.
NWN2: Gruuhilda, Tree Hugging Half-Orc
Post Reply