Syllabus

15 - Clean-up database model

  • The db.char.known is done with the exception that there is no need to put the name of the skill. I did it only for debugging reason.
  • db.global needs to be redone I think, some points:
    • In skill, trainers and valid_rep should be normal array
    • Remove unused profile options
    • trainers can be shared between Alliance and Horde (a tag might be needed and the rep might be different some times)
    • Skills should be indexed by spell_id. Professions and Classes skills could be in the same list (with proper tags), reference lists with Profession/class names and skill names can be built at startup
  • It might be a good idea to save db.char.known as one big string that is split at start

Draft of the new data model

db.profile.xxx = value

Stays as it is except that I'll remove the variables that are not used

db.char.known.spell_id = true

Replace the spell name by true to save spece in the SaveVariables. Maybe keep a dev swith to activate for debugging. All the other entries in db.char.known will be erased.

db.global.version = "M.m"

M = major, m = minor, both numeric. This will allow the database model upgrade in the future.

db.global.trainers = {
   trainer_name = {
      continent_id = decimal, -- The first four variables allow to map with TomTom or others
      zone_id = decimal,
      x = float,
      y = float,
      zone = "string", -- zone and sub_zone are for display and filtering
      sub_zone = "string",
      rep = "string", -- for filtering
      Horde = bolean, -- for filtering
      Alliance = bolean, -- for filtering
   }
}

Two variables for Horde and Alliance because some trainers can be used by both factions.

db.global.skills = {
}

(to come when I have more time)

User When Change
LaoTseu Nov 16, 2010 at 18:06 UTC Changed description:
  ** Skills should be indexed by spell_id. Professions and Classes skills could be in the same list (with proper tags), reference lists with Profession/class names and skill names can be built at startup
  * It might be a good idea to save **db.char.known** as one big string that is split at start

+ === Draft of the new data model ===
+
+ <<code lua>>
+ db.profile.xxx = value
+ <</code>>
+ Stays as it is except that I'll remove the variables that are not used
+
+ <<code lua>>
+ db.char.known.spell_id = true
+ <</code>>
+ Replace the spell name by true to save spece in the SaveVariables. Maybe keep a dev swith to activate for debugging. All the other entries in //db.char.known// will be erased.
+
+
+ <<code lua>>
+ db.global.version = "M.m"
+ <</code>>
+ M = major, m = minor, both numeric. This will allow the database model upgrade in the future.
+
+ <<code lua>>
+ db.global.trainers = {
+    trainer_name = {
+       continent_id = decimal, -- The first four variables allow to map with TomTom or others
+       zone_id = decimal,
+       x = float,
+       y = float,
+       zone = "string", -- zone and sub_zone are for display and filtering
+       sub_zone = "string",
+       rep = "string", -- for filtering
+       Horde = bolean, -- for filtering
+       Alliance = bolean, -- for filtering
+    }
+ }
+ <</code>>
+ Two variables for Horde and Alliance because some trainers can be used by both factions.
+
+ <<code lua>>
+ db.global.skills = {
+ }
+ <</code>>
+ (to come when I have more time)
LaoTseu Nov 15, 2010 at 04:42 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of LaoTseu LaoTseu Dec 22, 2010 at 23:53 UTC - 0 likes

    The skills are done now. Works better with spell_id as key and allow me to put the spell name instead of the skill name if the skill name is not known. This in turn will help with pre-populating with data that won't need to be localized.

    I've started gathering NPC ID for the trainers in a couple of weeks (when there most trainers will have been revisited), I'll see about using that as key for trainers. In this case, it will not remove the need for localisation but we will have to localize only in the trainer list and it should save space in the skill list.

    Unfortunately, there is no ID for rep that I could find.

  • 1 comment

Facts

Last updated
Nov 16, 2010
Reported
Nov 15, 2010
Status
Accepted - Problem reproduced / Need acknowledged.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees