Jump to content

[bug] Gameobject/page localization is broken


Recommended Posts

Posted

Mangos Version: 10479 [problem begins around 1042x]

Custom Patches: none

SD2 Version: none

Database Name and Version : YTDB 563

How it SHOULD work: Display correct locale text in game

How it DOES work: Now it is only displaying english (name from template), localization is not working.

Last test:

2010-09-12 18:02:39 >> Loaded 15841 gameobject locale strings

2010-09-12 18:02:40 >> Loaded 1676 PageText locale strings

2010-09-12 18:02:40 >>> Localization strings loaded

login game and check around objects, ex: mailbox, chair, store sign, mine, and any books in game, all display name/content from template, not from locales_gameobject or locales_page_text

However, all other localization are working fine, creature name, npc chat, quest, and item.

Posted

1. Problem only on gcc compiler.

2. I can't explain how, but after loading go locales, all objects of GameObjectLocale in our GameObjectLocaleMap are broken or empty or not exist.

3. Its can be temp fix because finally I cannot understand how it happened.

In GameObject.h:

+struct GameObjectLocale
+{
+    std::vector<std::string> Name;
+    std::vector<std::string> CastBarCaption;
+};
+
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
#if defined( __GNUC__ )
#pragma pack()
#else
#pragma pack(pop)
#endif

-struct GameObjectLocale
-{
-    std::vector<std::string> Name;
-    std::vector<std::string> CastBarCaption;
-};
-

  • 3 weeks later...
Posted
1. Problem only on gcc compiler.

2. I can't explain how, but after loading go locales, all objects of GameObjectLocale in our GameObjectLocaleMap are broken or empty or not exist.

3. Its can be temp fix because finally I cannot understand how it happened.

In GameObject.h:

+struct GameObjectLocale
+{
+    std::vector<std::string> Name;
+    std::vector<std::string> CastBarCaption;
+};
+
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
#if defined( __GNUC__ )
#pragma pack()
#else
#pragma pack(pop)
#endif

-struct GameObjectLocale
-{
-    std::vector<std::string> Name;
-    std::vector<std::string> CastBarCaption;
-};
-

This patch works on 0.12. Thank you cyberbrest2.

Posted
1. Problem only on gcc compiler.

2. I can't explain how, but after loading go locales, all objects of GameObjectLocale in our GameObjectLocaleMap are broken or empty or not exist.

3. Its can be temp fix because finally I cannot understand how it happened.

In GameObject.h:

+struct GameObjectLocale
+{
+    std::vector<std::string> Name;
+    std::vector<std::string> CastBarCaption;
+};
+
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
#if defined( __GNUC__ )
#pragma pack()
#else
#pragma pack(pop)
#endif

-struct GameObjectLocale
-{
-    std::vector<std::string> Name;
-    std::vector<std::string> CastBarCaption;
-};
-

Thanks u!! Temp fix is working on latest rev for gameobject.

And 4 struct PageTextLocales { } ?

Posted

If I remember right, there's an issue with new operator allocating less memory then the actual packed object size. Something to do with added padding.

Is there specific reason ( beside saving few bytes per packed structure ) packing is used?

I'm asking since non default aligned sizes are known to cause some cache inefficiencies. Simply since architecture assumes defaults are used.

From looking at mangos code, some structures are packed by 1byte while they don't use any members that take padding at all.

What I'm really saying here is, maybe we can cut it altogether?

Take care.

Posted

Mostly packed structures used for cases when it read form somewhere as one raw memory block. this is mostly DBC loading case and some SQL tables case.

Packed set need for cases when we need have exacrlt same memory structure by field position independent from x32/x64 specific.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use