Quantcast WoWInterface - View Single Post - Having a problem with RDXDB.SetPackageMetadata
View Single Post
02-18-12, 02:33 PM   #3
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
Ah. No, the thing that was blatantly wrong was my use of RDXDB.SetPackageMetadata().

lua Code:
  1. TRUESYS.PKG = {
  2.     "true_core",
  3.     "true_unitframes",
  4.     "true_multiframes"
  5. };
  6.  
  7.     TRUESYS.MD = {
  8.     "1.1",                                              -- infoVersion
  9.     "Unlimit",                                          -- infoAuthor
  10.     "Demon Soul US",                                    -- infoRealm
  11.     "[email protected]",                                  -- infoAuthorEmail
  12.     "manversuspixel.com",                               -- infoAuthorWebSite
  13.     "(True) Adaptive User Interface",                   -- infoComment
  14.     "infoIsShare",
  15.     "infoIsImmutable",
  16.     "infoIsIndelible"
  17. };
  18.  
  19. RDXEvents:Bind("INIT_DATABASE_LOADED", nil, function()
  20.     local version = RDXDB.GetPackageMetadata(TRUESYS.PKG[1], "infoVersion")
  21.     local update
  22.  
  23.     if not RDXDB.GetPackage(TRUESYS.PKG[1]) then return nil; end
  24.     if not version or version < TRUESYS.MD[1] then update = true; end
  25.  
  26.     if update == true then
  27.         RDX.print("Updating (True) Adaptive User Interface to the latest version!");
  28.         for i=1,3 do
  29.             RDXDB._EmptyPackage(TRUESYS.PKG[i], true)
  30.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoVersion", TRUESYS.MD[1]);
  31.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoAuthor", TRUESYS.MD[2]);
  32.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoAuthorRealm", TRUESYS.MD[3]);
  33.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoAuthorEmail", TRUESYS.MD[4]);
  34.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoAuthorWebSite", TRUESYS.MD[5]);
  35.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoComment", TRUESYS.MD[6]);
  36.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoIsShare", TRUESYS.MD[7]);
  37.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoIsImmutable", TRUESYS.MD[8]);
  38.             RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoIsIndelible", TRUESYS.MD[9]);
  39.         end
  40.     else
  41.         RDX.print("(True) Adaptive user Interface is up to date!");
  42.     end
  43. end);
  44.  
  45. RDXEvents:Bind("INIT_DATABASE_LOADED", nil, function()
  46.     -- Define a local to package name and set package metadata
  47.     local core = RDXDB.GetOrCreatePackage(TRUESYS.PKG[1]);
  48.     local unitframes = RDXDB.GetOrCreatePackage(TRUESYS.PKG[2]);
  49.     local multiframes = RDXDB.GetOrCreatePackage(TRUESYS.PKG[3]);
  50.     for i=1,3 do
  51.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoVersion", TRUESYS.MD[1]);
  52.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoAuthor", TRUESYS.MD[2]);
  53.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoAuthorRealm", TRUESYS.MD[3]);
  54.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoAuthorEmail", TRUESYS.MD[4]);
  55.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoAuthorWebSite", TRUESYS.MD[5]);
  56.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoComment", TRUESYS.MD[6]);
  57.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoIsShare", TRUESYS.MD[7]);
  58.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoIsImmutable", TRUESYS.MD[8]);
  59.         RDXDB.SetPackageMetadata(TRUESYS.PKG[i], "infoIsIndelible", TRUESYS.MD[9]);
  60.     end
  61.  
  62.     -- do stuff
  63.  
  64. end);
__________________


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

Last edited by unlimit : 02-18-12 at 11:15 PM.
  Reply With Quote