Generate a live server status webpage with a list of all players in a sortable grid. Easy to add additional fields. This is a version of vladiator's NWN Server Online Player PHP Web Status modified and adapted to NWN 2. You can find vladiat0r's version here:
Link
NWNX4 - Link Grid control by ActiveWidgets
Cookies by Jason Davies
A special thanks to vladiat0r for giving us the ok to submit this modification.
This script is released under the GPL license (see gpl.txt).
Prerequisites:
At least an ftp/http server on the gameserver, a web server with PHP to display the status page (preferably on the same machine), MySQL, NWNX4, and NWN2
**Note: This has only been tested to work using MySql**
Module Instructions:
1. Create a script in the NWN2 Toolset called player_status, and copy the text from the text file of the same name to the new script.
2.Add ExecuteScript("player_status", OBJECT_SELF); to your module heartbeat script.
3. In module properties , click on Variables and add BACKSLASH (string) = \
4. Compile all scripts and save your module
Web server Instructions:
1. Upload ActiveWidgets to your web folder
2. Upload cookies.js script to your web folder
3. Edit the settings on the status.php, including the paths to the ActiveWidgets and cookies script
4. If you're adding custom fields to status.php, edit $column_names, column widths, GetAllPlayerStatus function, and the player_status nwnscript
5. Upload status.php to your web folder
Database Instructions:
1. create a table on your database called player_status. Heres the create statement: CREATE TABLE player_status ( data TEXT )
2. Create a user with SELECT-only access, don't forget SET PASSWORD FOR status@localhost = OLD_PASSWORD('status');
Start your server using NWNX4 and visit the web address that points to status.php in a web browser
To add additional fields you need to edit the player_status script and status.php in marked locations.
Posted by Arvirago at 2009-01-20 11:53:47 Voted 5.00 on 01/20/09
It still is a little bit poor to write all data in a text field, and then separating each value in the PHP code, when you could use some simple columns.
It doesn't add to the simplicity of the system to use activewidgets and javascript when you just need to read some data from a SQL table. _________________________ Reino de Aldor
Posted by GrinningFool at 2007-12-28 19:17:09 Voted 7.50 on 12/28/07
Nicely done, though perhaps consideration could be given for places where the mysql database used by the game is not available for the web server? _________________________ The Grinning Fool The World of Khalidine, a unique RP PW.
Please remember that I vote according to the published scale.
Posted by Arvirago at 2007-11-08 11:13:45 Voted 5.00 on 01/20/09
Well done, even if I ain't keen at putting code in heartbeat and giving out all that off-role info.
Remember to edit the php code in case you have custom classes. _________________________ Reino de Aldor
10 - A Masterpiece, Genuinely Groundbreaking 9 - Outstanding, a Must Have 8 - Excellent, Recommended to Anyone 7 - Very Good, Deserves a Look 6 - Good, Qualified Recommendation 5 - Fair, Solid yet Unremarkable 4 - Some Merit, Requires Improvements 3 - Poor Execution, Potential Unrealized 2 - Very Little Appeal 1 - Not Recommended to Anyone