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] New expansion id  (Read 1906 times)

davidfaca

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 19
    • View Profile
[QUESTION] New expansion id
« on: January 04, 2013, 05:55:50 pm »
Hi, i've been trying to implement a new expansion ID in 3.3.5a.

Until now I've implemented it correctly on the server and it startsup correctly, if I use an account marked as expansion 2 i can even log in.

The problem is, when i try to log in with an account marked as expansion 3 I just receive a message saying that I have an account flagged as lich king but i have no lich king data installed.

After some research I've seen that this is the standard message after LK for when an account expansion and client expansion mismatch, but i haven't found any clue about how to solve this.

Can anyone give a clue about that?

Thanks.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] New expansion id
« Reply #1 on: January 04, 2013, 05:58:56 pm »
Without further investigation, I guess it is either in LUA (less likely) or hardcoded in the client (more likely). Try searching for the error given in the GlueXML files.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

davidfaca

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 19
    • View Profile
Re: [QUESTION] New expansion id
« Reply #2 on: January 04, 2013, 08:41:33 pm »
The error seems to be called in accountlogin.lua

GlueDialog_Show("CLIENT_ACCOUNT_MISMATCH", CLIENT_ACCOUNT_MISMATCH_LK);   

which is part of this function:
Code: [Select]
function AccountLogin_OnEvent(event, arg1, arg2, arg3)
if ( event == "SHOW_SERVER_ALERT" ) then
ServerAlertText:SetText(arg1);
ServerAlertFrame:Show();
elseif ( event == "SHOW_SURVEY_NOTIFICATION" ) then
AccountLogin_ShowSurveyNotification();
elseif ( event == "CLIENT_ACCOUNT_MISMATCH" ) then
local accountExpansionLevel = arg1;
local installationExpansionLevel = arg2;
if ( accountExpansionLevel == 1 ) then
GlueDialog_Show("CLIENT_ACCOUNT_MISMATCH", CLIENT_ACCOUNT_MISMATCH_BC);
else
GlueDialog_Show("CLIENT_ACCOUNT_MISMATCH", CLIENT_ACCOUNT_MISMATCH_LK);
end
elseif ( event == "CLIENT_TRIAL" ) then
GlueDialog_Show("CLIENT_TRIAL");
elseif ( event == "SCANDLL_ERROR" ) then
GlueDialog:Hide();
ScanDLLContinueAnyway();
AccountLoginUI:Show();
elseif ( event == "SCANDLL_FINISHED" ) then
if ( arg1 == "OK" ) then
GlueDialog:Hide();
AccountLoginUI:Show();
else
AccountLogin.hackURL = _G["SCANDLL_URL_"..arg1];
AccountLogin.hackName = arg2;
AccountLogin.hackType = arg1;
local formatString = _G["SCANDLL_MESSAGE_"..arg1];
if ( arg3 == 1 ) then
formatString = _G["SCANDLL_MESSAGE_HACKNOCONTINUE"];
end
local msg = format(formatString, AccountLogin.hackName, AccountLogin.hackURL);
if ( arg3 == 1 ) then
GlueDialog_Show("SCANDLL_HACKFOUND_NOCONTINUE", msg);
else
GlueDialog_Show("SCANDLL_HACKFOUND", msg);
end
PlaySoundFile("Sound\Creature\MobileAlertBot\MobileAlertBotIntruderAlert01.wav");
end
end
end

But i can't find exactly how this is called.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] New expansion id
« Reply #3 on: January 04, 2013, 09:57:57 pm »
CLIENT_ACCOUNT_MISMATCH is pushed by the executable. You can't modify that. Your goal thus needs to be to prevent event. To do that, you need to find out, where it is pushed, thus reverse engineering.
There are two methods: GetAccountExpansionLevel and GetExpansionLevel. They can be different. Also there is a CVar "accounttype", which has one of the hardcoded values CL, BC, LK, CT,

CLIENT_ACCOUNT_MISMATCH is 27. And I can't find it right now. Even after I have searched for at least half an hour now.

You will run into client limitations for sure, by the way. For example CalendarDefaultGuildFilter has a MAX_LEVELS_FOR_EXPANSIONS array with fixed length. ClientConnection has a hardcoded value MAX_EXPANSIONS, with playerExpansionLevel<NUM_EXPANSIONS asserted.

Expansion level in CGServerInfo is sent by the server.

To allow me finding out more: When does CLIENT_ACCOUNT_MISMATCH happen?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

davidfaca

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 19
    • View Profile
Re: [QUESTION] New expansion id
« Reply #4 on: January 04, 2013, 10:19:43 pm »
Thanks for the reply, the thing is that i've been searching for that but i haven't found anything in the lua files other than in accountlogin.lua but i'm not experienced enough in lua to assure that.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] New expansion id
« Reply #5 on: January 04, 2013, 10:35:36 pm »
So well, when does that event happen? (Not on a code side, but on the login progress.)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

davidfaca

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 19
    • View Profile
Re: [QUESTION] New expansion id
« Reply #6 on: January 04, 2013, 10:38:26 pm »
It appears just after the connected message during the login process.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] New expansion id
« Reply #7 on: January 05, 2013, 12:10:48 am »
I'm sorry, but I can't help you. I really can't find anything pushing that event.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

davidfaca

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 19
    • View Profile
Re: [QUESTION] New expansion id
« Reply #8 on: January 05, 2013, 12:34:13 am »
Thank you a lot anyway for trying to help.

I think i'll give a look again and if i don't find anything i'll simply give up.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] New expansion id
« Reply #9 on: January 05, 2013, 12:43:37 am »
As said: The chance of everything working fine is pretty low, regarding all that hardcoded stuff. I wouldn't try to add an expansion id.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »