Author Topic: Yet another MySQL tale..  (Read 379 times)

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Yet another MySQL tale..
« on: December 10, 2014, 09:25:17 pm »


               

Hey everyone!


 


I've taken it upon myself to learn MySQL for any database needs I may run into in the future, it's pretty straightforward so far and I've had no problems doing the basics with the NWN ODBC functions.


 


I am wanting to use this personal storage system: http://neverwinterva...-storage-system


 


with MySQL but I'm hitting a few bumps.


 


 


Here's the original of what I'm trying to change


 


http://pastebin.com/eRwAY9bu


 


 


Here's my attempt


 


http://pastebin.com/iQuLEUnJ


 


 


I've managed to get the object stored, and called properly with the proper inventory, but a problem I'm having now is running StorageClose() on PCs who have left (OBJECT_INVALID), which means duping is easily possible.


 


 


 


Also, something else I've been wondering: what is the limit on variables stored on items?


 


I know storing many variables on a PC items will slowly slowly raise the BIC size, but is there a limit or really any observable effect to having too many variables stores on items?


 


Thanks to anyone willing to take a quick look!



               
               

               
            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Yet another MySQL tale..
« Reply #1 on: December 10, 2014, 11:52:29 pm »


               

I've discovered NWNX_Funcs which has a nice hook into leaving clients, so you can actually run things based on clients that are no longer there. Using this, I can now run StorageClose() on the PC who has left, and not run into any issues with the DB not saving.


               
               

               
            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Yet another MySQL tale..
« Reply #2 on: December 11, 2014, 07:54:37 am »


               

Everything seems to be running smoothly so far, this database stuff really isn't so scary once you get used to it a little.


 


I'm still curious though, whether there's a limit to PC Item databases? I'm wondering if I should worry about transferring that type of storage to a DB.



               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Yet another MySQL tale..
« Reply #3 on: December 16, 2014, 04:52:39 pm »


               

IIRC the max reasonable number of variables per object is around 5000, not entirely sure though.


 


I have also used MySQL for storage (among several other things) in the past and I don't recall having met any kind of limit. I personally prefer MySQL over the bioware DB since the latter is a bit less flexible and needs to be periodically cleaned.


 


 


Kato