Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#3909 closed defect (fixed)

[PATCH] Rename TechnologyTemplateManager to JsonTemplateManager

Reported by: sanderd17 Owned by: sanderd17
Priority: Should Have Milestone: Alpha 21
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description (last modified by elexis)

Since the TechnologyTemplateManager doesn't only do techs anymore, it should be renamed to something more generic, like JsonTemplateManager.

Note: this also disables serialization of the cached tech data (refs #3834 )

Due to the difficulty of renaming files and creating diffs of those, I've included two patches. They're the same with the exception that one has renamed files and the other one doesn't.

Attachments (2)

renameTechMan.diff (21.1 KB ) - added by sanderd17 7 years ago.
renameTechManNoFile.diff (15.7 KB ) - added by sanderd17 7 years ago.

Download all attachments as: .zip

Change History (9)

by sanderd17, 7 years ago

Attachment: renameTechMan.diff added

by sanderd17, 7 years ago

Attachment: renameTechManNoFile.diff added

comment:1 by sanderd17, 7 years ago

Note from leper: jsonTemplateManager isn't a good name either (data can contain any data format). Better is something like dataTemplateManager.

comment:2 by Itms, 7 years ago

Keywords: review removed

I agree with the naming CCmpDataTemplateManager.

Why do you change the function name in TechnologyManager? After all it is still the technology manager so GetTechnologyTemplate is not an inaccurate name.

comment:3 by sanderd17, 7 years ago

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 18100:

Rename TechnologyTemplateManager to DataTemplateManager in order to reflect its new function. Fixes #3909. Disable serialisation of technology templates. Refs #3834

comment:4 by elexis, 5 years ago

Description: modified (diff)

Since it wasn't linked here yet, it was broken because the Auras and TechnologyManager components still serialized the objects from the DataTemplateManager, thus yielding different backrefs for rejoined clients, thus OOS deluxe (not even visible in the textual dump diff), see #4239.

The component should be a globalscript, so that it can be used by the AI, GUI and rmgen as well.

I initially agreed with JSONTemplateManager so that we immediately know how its different from the TemplateManager. But even better would be splitting the file into an Aura and a Technology file.

comment:5 by elexis, 5 years ago

In 20610:

Remove unused serialized cache of technology templates in TechnologyManager.researchedTechs.

Refs #3834, #3909, #4239, #4868, D1108
Differential Revision:
Reviewed By: mimo

comment:6 by elexis, 5 years ago

In 20737:

Replace DataTemplateManager simulation component with a globalscript, refs #4868.

Removes the serialization of JSON files, shrinking savegame files and rejoin states sent across the network, refs #3834, #4239, #3909, rP18100.
Removes the AI C++ code to read JSON files from rP13225 since the AI can now use the globalscript.
Allows the AI to read Aura templates and removal of GUIInterface code to improve performance.
Serialization of the JSON objects in other simulation components was removed in r20606 / D1109, r20610 / D1130.

Serialization removal planned by sanderd17
AI part proofread by mimo
Simulation part proofread by bb
Discussed with Itms on irc

Differential Revision:

comment:7 by elexis, 5 years ago

In 21014:

Fix AuraManager OOS on rejoin following rP20737 / D1108.

The AuraManager serialized the affects array of the aura JSON files, while the Auras components create new affects arrays upon deserialization.
So the AuraManager of rejoined clients failed to identify and remove the according aura effects of units who received the aura effect before the rejoin.

Fix it by not serializing the array but only the strings inside the array.
It were preferable to rebuild the modification cache and remove the serialization altogether, refs #3834.

rP18100 introduced the same OOS on rejoin, refs #3909, #4239, but it wasn't noticed due to the revert in rP18804.

Differential Revision:
Reviewed By: bb
Comments By: gameboy
Fixes #4924

Note: See TracTickets for help on using tickets.