This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] Knowledgebase XML/LUa  (Read 2669 times)

majorcyto

  • Registred Member
  • Race Changer
  • *****
  • Posts: 33
    • View Profile
[QUESTION] Knowledgebase XML/LUa
« on: June 22, 2014, 09:57:47 pm »
Question, does anyone know if we can edit the help/support in-game knowledgebase to display something else.. i guess i have 2 questions. Because the 3.3.5a KB no longer works since they changed something..

1.) Is it even possible for the xml/lua frames to pull or load HTML pages in-client.. i think this was added in the 5.X client because of the item store and stuff but in the 3.3.5a client?

2.) If not, can we tell it to load from a database query direct?

--

If it isnt possible to put in your own KB articles period, then i guess the easiest thing is just to remove that part of the window and make the default landing window submit ticket instead. But i would like to know if we can do something else first before removing it.

And, i guess there might always be the option of writing a custom KB base in LUA entirely? But.. that isn't efficient if you want to update it on the fly.

Any responses are appreciated  :geek:



====

Secondary Question - Where can i find a unlocked glue/xml  - wow.exe   - for 4.3.4?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Knowledgebase XML/LUa
« Reply #1 on: June 22, 2014, 11:00:31 pm »
Totally possible to remove it. Lua and XML only, pretty straight forward: look for stuff with KB_.

Totally possible to replace it. Pages will be loaded from your server, XML files. Of course those again can just be database queries via rewrite rule. The base URL is given in some global string in framexml, iirc. Maybe just look for KB in globalstrings, should breads to find.
The XML files read need a given structure. I don't remember if I still have that structure around or if that was for accountmessages only. Would have to check at home. For that bump on Thursday. Else, maybe stoneharry has it. You may as we'll try to reverse engineer it from the client. I may as well give it a look if i remember.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION] Knowledgebase XML/LUa
« Reply #2 on: June 22, 2014, 11:21:47 pm »
Quote from: "schlumpf"
I don't remember if I still have that structure around or if that was for accountmessages only. Would have to check at home. For that bump on Thursday. Else, maybe stoneharry has it. You may as we'll try to reverse engineer it from the client. I may as well give it a look if i remember.

https://github.com/stoneharry/Misc-WoW- ... ramxml.xml

https://github.com/stoneharry/Misc-WoW- ... tmessaging

Account messages only as far as I know.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

majorcyto

  • Registred Member
  • Race Changer
  • *****
  • Posts: 33
    • View Profile
Re: [QUESTION] Knowledgebase XML/LUa
« Reply #3 on: June 23, 2014, 01:48:48 am »
Quote from: "stoneharry"
Quote from: "schlumpf"
I don't remember if I still have that structure around or if that was for accountmessages only. Would have to check at home. For that bump on Thursday. Else, maybe stoneharry has it. You may as we'll try to reverse engineer it from the client. I may as well give it a look if i remember.

https://github.com/stoneharry/Misc-WoW- ... ramxml.xml

https://github.com/stoneharry/Misc-WoW- ... tmessaging

Account messages only as far as I know.

Awe, i was actually really hoping you would reply with the structure or a example. Hope you don't mind i poked around your repo a minute, the bug report viewer is useful and i completely forgot there was a table for that. The account message is cool, but last i heard it (sometimes) caused a random client crash.. or always caused a error on exit? Something like that.


Quote from: "schlumpf"
Totally possible to remove it. Lua and XML only, pretty straight forward: look for stuff with KB_.

Totally possible to replace it. Pages will be loaded from your server, XML files. Of course those again can just be database queries via rewrite rule. The base URL is given in some global string in framexml, iirc. Maybe just look for KB in globalstrings, should breads to find.
The XML files read need a given structure. I don't remember if I still have that structure around or if that was for accountmessages only. Would have to check at home. For that bump on Thursday. Else, maybe stoneharry has it. You may as we'll try to reverse engineer it from the client. I may as well give it a look if i remember.

I will bump it Thursday then, while i might eventually be able to get something going i am 100% positive you can do it 10X as quick as me lol. Plus, iyou might find the structure some where on your hard drive or something.

I am actually in the KnowledgeBaseFrame.xml and .lua all though im not finding how its communicating where to pull the articles from.. (the globalstring) thanks both of you for your replies, and hopefully we can get this tracked down a bit!

--

In the mean time i will of course keep trying/looking, etc. Id much rather use my own KB articles, rather than remove it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION] Knowledgebase XML/LUa
« Reply #4 on: June 23, 2014, 02:03:27 am »
Quote from: "majorcyto"
Quote from: "stoneharry"
Quote from: "schlumpf"
I don't remember if I still have that structure around or if that was for accountmessages only. Would have to check at home. For that bump on Thursday. Else, maybe stoneharry has it. You may as we'll try to reverse engineer it from the client. I may as well give it a look if i remember.

https://github.com/stoneharry/Misc-WoW- ... ramxml.xml

https://github.com/stoneharry/Misc-WoW- ... tmessaging

Account messages only as far as I know.

Awe, i was actually really hoping you would reply with the structure or a example. Hope you don't mind i poked around your repo a minute, the bug report viewer is useful and i completely forgot there was a table for that. The account message is cool, but last i heard it (sometimes) caused a random client crash.. or always caused a error on exit? Something like that.

Upon hindsight I think the crashes were due to issues unrelated to account messaging. So it should be completely stable. It would require further testing.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

majorcyto

  • Registred Member
  • Race Changer
  • *****
  • Posts: 33
    • View Profile
Re: [QUESTION] Knowledgebase XML/LUa
« Reply #5 on: July 14, 2014, 01:41:28 am »
Quote from: "schlumpf"
-snip-

Bumping per schlumpf request (was supposed to do this a while back, but got busy.

==

Edit - Also while im thinking about it schlumpf.. can the unlocked LUA interface pull in HTML pages, even if its in limited form? Or is it still locked to XML only.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Knowledgebase XML/LUa
« Reply #6 on: July 14, 2014, 10:12:09 pm »
Please note that this is based on 5.0.1.15464, as I don't have a different client currently.

The whole thing is visible from Lua using

Code: [Select]
Script_KBSetup_BeginLoading
Script_KBSetup_IsLoaded
Script_KBSetup_GetLanguageCount
Script_KBSetup_GetLanguageData
Script_KBSetup_GetCategoryCount
Script_KBSetup_GetCategoryData
Script_KBSetup_GetSubCategoryCount
Script_KBSetup_GetSubCategoryData
Script_KBSetup_GetArticleHeaderCount
Script_KBSetup_GetArticleHeaderData
Script_KBSetup_GetTotalArticleCount
Script_KBQuery_BeginLoading
Script_KBQuery_IsLoaded
Script_KBQuery_GetArticleHeaderCount
Script_KBQuery_GetArticleHeaderData
Script_KBQuery_GetTotalArticleCount
Script_KBArticle_BeginLoading
Script_KBArticle_IsLoaded
Script_KBArticle_GetData
Script_KBSystem_GetMOTD
Script_KBSystem_GetServerStatus
Script_KBSystem_GetServerNotice

For descriptions of those, see http://wowprogramming.com/docs/api_categories#kb. The most important ones for us are the BeginLoading ones, as they show how the data is retrieved, while Get*Count and Get*Data describes the format.

So, lets see CKBSetup::BeginLoading(CKBSetup *userdata, uint numArticles, uint pageNumber) (excerpts only):
Code: [Select]
const char* base_url = NULL;
switch (IsoLocaleStringToIsoEnum (g_currentLocaleName))
{
  case zhTW:
  case enTW:
    base_url = "http://support.worldofwarcraft.co.kr/kbtw/";
    break;
  case koKR:
    base_url = "http://support.worldofwarcraft.co.kr/kb/";
    break;
  case deDE:
  case enGB:
  case esES:
  case frFR:
  case ruRU:
  case itIT:
  case ptPT:
    base_url = "http://support.wow-europe.com/kb/";
    break;
  case zhCN:
  case enCN:
    base_url = "http://cn.kbase.blizzard.com/kb/wow/";
    break;
  default:
    base_url = "http://support.worldofwarcraft.com/kb/";
    break;
}
These are _hardcoded_. Thus, you will need to modify the binary or redirect those hosts via other ways to point to your own server. Next up is assembling the url:
Code: [Select]
CDynamicString url;
url.setCapacity (1024);
url += base_url;
url += "getKBSetup.xml";
url += "?languageId=";
url += g_currentLanguage;
url += "&numArticles=";
url += numArticles;
url += "&pageNumber=";
url += pageNumber;
url += "&locale=";
url += locale; // as string like "enGB"
locale is a string like "enGB", g_currentLanguage is as in WowEnum:
Code: [Select]
   switch (iso_enum)
    {
      default:
        return 0;
      case deDE:
        return 3;
      case esES:
        return 6;
      case frFR:
        return 2;
      case koKR:
        return 1;
      case zhCN:
      case enCN:
        return 4;
      case zhTW:
      case enTW:
        return 5;
      case esMX:
        return 7;
      case ruRU:
        return 8;
      case ptBR:
      case ptPT:
        return 10;
      case itIT:
        return 11;
    }

So that's what is retrieved at begin.
[hr:1m34u98j]-[/hr:1m34u98j]
Raid currently. Tanking heroic siegecrafter and reversing is a pain. Will continue later.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Knowledgebase XML/LUa
« Reply #7 on: July 14, 2014, 10:14:06 pm »
In the end, figure it out yourself.

Also,
Code: [Select]
   CDynamicString::operator__((CDynamicString *)&this, base_url);
    CDynamicString::operator__((CDynamicString *)&this, "sendKBArticleQuery.xml");
    CDynamicString::operator__((CDynamicString *)&this, "?articleId=");
    CDynamicString::operator__((CDynamicString *)&this, a2);
    CDynamicString::operator__((CDynamicString *)&this, "&languageId=");
    CDynamicString::operator__((CDynamicString *)&this, *g_currentLanguage_ptr);
    CDynamicString::operator__((CDynamicString *)&this, "&searchType=");
    CDynamicString::operator__((CDynamicString *)&this, a3);
    CDynamicString::operator__((CDynamicString *)&this, "&locale=");
    CDynamicString::operator__((CDynamicString *)&this, v4);



  CDynamicString::operator__(&this, base_url);
  CDynamicString::operator__(&this, "sendKBQuery.xml");
  CDynamicString::operator__(&this, 63);
  if ( userdata->m_eState == 1 )
    SErrDisplayError(0x85100000u, "/Users/patchman/buildserver/wow-b/work/WoW-code/trunk/WoW/Source/Mac/../Ui/KnowledgeBase.cpp", 0x3EFu, "m_eState != KBState_LoadInProgress", 0, 1, 0, 286331153);
  v8 = a3 != -1;
  if ( !v5 )
  {
    if ( !v8 )
      goto LABEL_12;
    goto LABEL_25;
  }
  if ( v8 )
  {
    CDynamicString::operator__(&this, "searchQuery=");
    CKBQuery::_AppendMangledSearchQuery(userdata, &this, v5);
    CDynamicString::operator__(&this, 38);
LABEL_25:
    CDynamicString::operator__(&this, "categoryId=");
    CDynamicString::operator__(&this, a3);
    goto LABEL_11;
  }
  CDynamicString::operator__(&this, "searchQuery=");
  CKBQuery::_AppendMangledSearchQuery(userdata, &this, v5);
LABEL_11:
  CDynamicString::operator__(&this, 38);
LABEL_12:
  CDynamicString::operator__(&this, "languageId=");
  CDynamicString::operator__(&this, *g_currentLanguage_ptr);
  CDynamicString::operator__(&this, "&numArticles=");
  CDynamicString::operator__(&this, a4);
  CDynamicString::operator__(&this, "&pageNumber=");
  CDynamicString::operator__(&this, a5);
  CDynamicString::operator__(&this, "&locale=");
  CDynamicString::operator__(&this, g_currentLocaleName_ptr);
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Knowledgebase XML/LUa
« Reply #8 on: July 14, 2014, 10:15:45 pm »
As everything is still live, just assemble an url manually and look at the xml. Likely that's faster than me properly reversing it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »