Ramkhamhaeng
Warlord
- Joined
- Feb 24, 2014
- Messages
- 209
Hello DarkLunaPhantom,
there are a few 'reasons' for this approach.
1. Previous versions of PBSpy parses the year information only. The month information was attached later and adding it in the upper bits was the easiest solution.
2. I prefer the storage of numbers over strings.
3. For security reasons the input string should not be stored/displayed without any parsing. I wrote the most restrictive parsing function and wait until somebody needs a more flexible solution.
(Well, this point is not 100% valid because two fields, game name and mod name, are string fields the values were currently saved raw. I will update this in the next version and strip out tags, etc...)
4. The Pitboss server method CyPitboss().getGamedate(bSavegameSyntax) depends on the selected language. This could mess up the displayed string on the interface. A new more robust/general solution should respect this.
=========
It exists two possible solution.
A) Simply display the full calendar string, given getGamedate() a.k.a. CyGameTextMgr::getDateStr(...). This approach will work for all mods, too. (Your suggestion)
B) Write an own function, similar to getDateStr, which returns all information in a predefined, language independent form. This is secure, but do not respect new/fancy calendar types. Disadvantage is complexity and redundancy.
Currently, I prefer solution B.
there are a few 'reasons' for this approach.
1. Previous versions of PBSpy parses the year information only. The month information was attached later and adding it in the upper bits was the easiest solution.
2. I prefer the storage of numbers over strings.
3. For security reasons the input string should not be stored/displayed without any parsing. I wrote the most restrictive parsing function and wait until somebody needs a more flexible solution.
(Well, this point is not 100% valid because two fields, game name and mod name, are string fields the values were currently saved raw. I will update this in the next version and strip out tags, etc...)
4. The Pitboss server method CyPitboss().getGamedate(bSavegameSyntax) depends on the selected language. This could mess up the displayed string on the interface. A new more robust/general solution should respect this.
=========
It exists two possible solution.
A) Simply display the full calendar string, given getGamedate() a.k.a. CyGameTextMgr::getDateStr(...). This approach will work for all mods, too. (Your suggestion)
B) Write an own function, similar to getDateStr, which returns all information in a predefined, language independent form. This is secure, but do not respect new/fancy calendar types. Disadvantage is complexity and redundancy.
Currently, I prefer solution B.