Neverwinter Nights 2: Auction house
I've donne a pretty nice work on my Neverwinter Nights 2 server ("La Colère d'Aurile") : a complete auction house
This system replaces the older one that has been removed due to item duplications caused by the script being aborted after a short time (a security on the game server to prevent infinite loops to crash the whole server)
The new system correct those issues, using:
All database queries are done with a MySQL server using the NWNX4 plugin, instead of the standard solution using the Bioware Database.
This gives lighting fast database queries and prevents the script from being aborted on long queries.
The items are handled with the SCORCO part of the plugin (Store Campaign Objects & Retrieve Campaign Objects), available with some modification on the nwscript source nwnx_sql.nss
The new GUI handle everything you need. The old system was using multiple GUI and a chest where the player could examine the items.
This has been possible with a horrible hack on the game examine GUI to get the whole item description ( blueprint description, magical properties, base item description, ...) to store it in the database.
Thanks to SQL Database, the new GUI have also more filter options: you can filter by name (case and accent insensitive), item base type, price, level required, vendor account/name, date , etc...
Double check everything
Every transaction in the auction house is double checked (before and 3sec after) and the script lines have been ordered to disadvantage the player in most cases if it crash (to force players to report the bugs)
If something goes wrong during the double check, the problem is logged as a cheat attempt and reported to all DM at their next login.
The system is now online for 2 weeks and no cheat attempt has been logged, and no issue have been reported by the players.