View Single Post
  #17  
Old 08-22-2014, 05:23 AM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 354
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
Quote:
Originally Posted by Restraint View Post
In theory, you are correct. It *should* never be garbage collected. However, it often is.

I ran into this problem thrice: once for a jailing/punishments system, once for a Graphics Viewer system, and once for some system I don't recall.

They all had active references, namely this.'s that were initialized onCreated. 2 of them were in DB NPCs, and 1 was in a Weapon NPC. They DO appear to have some arbitrary time limit.

If you never ran into it -- and I'm not doubting you -- I'm sure we can chalk this up as one of those "random Graal glitches."

I agree with you entirely with regards to SQLite Database and caching. I have also done similar with file databases and caching. Such caches make it very easy to submit data to the clientside as well (Again, via .saveVarsToArray()).
are you using the default onInitialized() event within database npcs as well?

i have always set up database systems in the following way:

PHP Code:
function onCreated()
  
this.onInitialized();

function 
onInitialized() {
  if (
this.cache == NULL) {
    
this.cache = new tStaticVar();
    
this.populateCache();
  } 

even prior to the introduction of tStaticVar() you needed to use onInitialize() within a database npc for it to be reliable
__________________
This signature has been deleted by Darlene159.
Reply With Quote