Opened 4 years ago

Closed 4 years ago

Last modified 2 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 4 years ago.
renameTechManNoFile.diff (15.7 KB) - added by sanderd17 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by sanderd17

Attachment: renameTechMan.diff added

Changed 4 years ago by sanderd17

Attachment: renameTechManNoFile.diff added

comment:1 Changed 4 years ago by sanderd17

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

comment:2 Changed 4 years ago by Itms

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 Changed 4 years ago by sanderd17

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 Changed 2 years ago by elexis

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 Changed 2 years ago by elexis

In 20610:

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

Refs #3834, #3909, #4239, #4868, D1108
Differential Revision: https://code.wildfiregames.com/D1130
Reviewed By: mimo

comment:6 Changed 2 years ago by elexis

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: https://code.wildfiregames.com/D1108

comment:7 Changed 2 years ago by elexis

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: https://code.wildfiregames.com/D1201
Reviewed By: bb
Comments By: gameboy
Fixes #4924

Note: See TracTickets for help on using tickets.