Quantcast WoWInterface - View Single Post - Having a problem with RDXDB.SetPackageMetadata
View Single Post
02-18-12, 12:46 AM   #1
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
Having a problem with RDXDB.SetPackageMetadata

I created a table (??? think that's what it's called) named TRUESYS.MD, that will always have my metadata available.

I then have another function that runs to check if TRYESYS.MD[1] is greater than the current version of my package, and if so, empties the package then using RDXDB.SetPackageMetadata I reassign all of my metadata.

This doesn't seem to work for me, though. Do you see anything blatantly wrong, Sigg? I end up with no metadata at all after emptying the package, even after supposedly reassigning all of my metadata.

lua Code:
  1. TRUESYS.PKG = {
  2.     "true_core",
  3.     "true_unitframes",
  4.     "true_multiframes"
  5. };
  6.  
  7. TRUESYS.MD = {
  8.     "1.1",
  9.     "Unlimit",
  10.     "Demon Soul US",
  11.     "manversuspixel.com",
  12.     "(True) Adaptive User Interface",
  13.     "infoIsShare",
  14.     "infoIsImmutable",
  15.     "infoIsIndelible"
  16. };
  17.  
  18. RDXEvents:Bind("INIT_DATABASE_LOADED", nil, function()
  19.     if not RDXDB.GetPackage(TRUESYS.PKG[1]) then return nil; end
  20.     if not RDXDB.GetPackageMetadata(TRUESYS.PKG[1], "infoVersion") then return nil; end
  21.  
  22.     if RDXDB.GetPackageMetadata(TRUESYS.PKG[1], "infoVersion") < TRUESYS.MD[1] then
  23.         RDX.print("Updating (True) Adaptive User Interface to the latest version!");
  24.         for i=1,3 do
  25.             RDXDB._EmptyPackage(TRUESYS.PKG[i])
  26.             for g=1,9 do
  27.                 RDXDB.SetPackageMetadata(TRUESYS.PKG[i], TRUESYS.MD[g], true)
  28.             end
  29.         end
  30.     end
  31. end);
  32.  
  33. RDXEvents:Bind("INIT_DATABASE_LOADED", nil, function()
  34.     -- Define a local to package name and set package metadata
  35.     local core = RDXDB.GetOrCreatePackage(TRUESYS.PKG[1]);
  36.     local unitframes = RDXDB.GetOrCreatePackage(TRUESYS.PKG[2]);
  37.     local multiframes = RDXDB.GetOrCreatePackage(TRUESYS.PKG[3]);
  38.     for i=1,3 do
  39.         for g=1,9 do
  40.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], TRUESYS.MD[g], true)
  41.         end
  42.     end
  43.  
  44. -- Do stuff
  45.  
  46. end);
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **
  Reply With Quote