Ticket #4239: fix_aura_loading_order_v1.patch

File fix_aura_loading_order_v1.patch, 1.2 KB (added by elexis, 8 years ago)

Loads all aura templates on init in alphabetical order, thus should not cause different backref tags on different machines. Thus making it irrelevant whether the data is serialized or not (wishful thinking since I tested only 5 rejoins with the patch).

  • binaries/data/mods/public/simulation/components/DataTemplateManager.js

    DataTemplateManager.prototype.Schema =  
    88
    99DataTemplateManager.prototype.Init = function()
    1010{
    1111    this.allTechs = {};
    1212    this.allAuras = {};
    13     var techNames = this.ListAllTechs();
    14     for (var i in techNames)
    15         this.GetTechnologyTemplate(techNames[i]);
     13
     14    for (let techName of this.ListAllTechs())
     15        this.GetTechnologyTemplate(techName);
     16
     17    for (let auraName of this.ListAllAuras())
     18        this.GetAuraTemplate(auraName);
    1619};
    1720
    1821DataTemplateManager.prototype.GetTechnologyTemplate = function(template)
    1922{
    2023    if (!this.allTechs[template])
    DataTemplateManager.prototype.GetAuraTem  
    4245DataTemplateManager.prototype.ListAllTechs = function()
    4346{
    4447    return Engine.FindJSONFiles("technologies", true);
    4548};
    4649
     50DataTemplateManager.prototype.ListAllAuras = function()
     51{
     52    return Engine.FindJSONFiles("auras", true);
     53};
     54
    4755DataTemplateManager.prototype.GetAllTechs = function()
    4856{
    4957    return this.allTechs;
    5058};
    5159