Jump to content

[bug] Gameobject/page localization is broken


Guest ckegg

Recommended Posts

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.

Link to comment
Share on other sites

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;
-};
-

Link to comment
Share on other sites

  • 3 weeks later...
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.

Link to comment
Share on other sites

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 { } ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

×
×
  • 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