FIX DC and "Account in Use"

Codes submitted by developers and people of outpost. Come here to get codes for your client sources.
Dax
<3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

Some of you may be familiar with the bug on Hypno's WLS which causes your character to be disconnected when changing maps. You then get "Account in Use" when you try to log in. This fix is client side so it requires client sources built up from 2.20 .

1.
Open up your trusty client source(Your own edited 2.20). If you don't have that then open your not so trusty client source (That "3.81" which is floating around).

2. Go to the file Game.cpp and search for the function void CGame::NotifyMsg_ServerChange(char * pData)

3.
Find

Code: Select all

m_wEnterGameType = DEF_ENTERGAMEMSGTYPE_NEW_TOWLSBUTMLS;

Replace it with

Code: Select all

m_wEnterGameType = DEF_ENTERGAMEMSGTYPE_CHANGINGSERVER;//DEF_ENTERGAMEMSGTYPE_NEW_TOWLSBUTMLS;
You should now be able to freely change servers without interuptions using edited client source and that wonderful wonderful source called "Hypno's WLS".

All hail Hypno for coding us a WLS :D
Now if you have some spare time all hail Dax for a few minutes :P

I released this because Hypno was kind enough to make his source public so I think it's only fair I release any fix for it i discover.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

I :wub: You Dax!
SlammeR
Loyal fan
Posts: 219
Joined: Fri Nov 04, 2005 1:52 am
Location: Brazil

Post by SlammeR »

i was looking for this fix! =P

<3 Dax

Mass thanks for u! ^^
OWNED!<br><img src='http://img50.imageshack.us/img50/1386/p ... 3vsqn2.gif' border='0' alt='user posted image' /><br><br><img src="http://hbtop50.com/button.php?u=hbuonline" alt="Helbreath Top 50 - Keepin' it real." border="0" /><br><a href='http://www.hbuonline.net' target='_blank'>Helbreath United</a>
Kiruku
Loyal fan
Posts: 268
Joined: Wed Feb 22, 2006 12:00 pm
Contact:

Post by Kiruku »

thanks a lot now i can use hypno WLS :D
<img src='http://lichtdrache.lima-city.de/helbrea ... aramba.gif' border='0' alt='user posted image' />
Crossfade
Loyal fan
Posts: 354
Joined: Sun Mar 20, 2005 5:55 pm

Post by Crossfade »

weee
xmukox
Member
Posts: 175
Joined: Sun Sep 11, 2005 9:53 am

Post by xmukox »

ohh nice man thenks...
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

this fix dose not fix complet bug for anyone that wants to fully fix it not talking about dax only anyone here is more info i have gotten to help pll fix bug


This Bug Isnt
Some of you may be familiar with the bug on Hypno's WLS which causes your character to be disconnected when changing maps.
Yes This bug is Fixed
You then get "Account in Use" when you try to log in.


Code: Select all

case DEF_NOTIFY_SERVERCHANGE:
 memcpy(cp, m_pClientList[iToH]->m_cMapName, 10);
 cp += 10; 
 // World Server connection across hgservers, behind router problem
 // ArchAngel fix
 if (m_iGameServerMode == 1) // Mode = 1 is LAN (behind router
           if (memcmp(m_cLogServerAddr, m_cGameServerAddr, 16) == 0)
   memcpy(cp, m_cGameServerAddrExternal, 16);
  else
   memcpy(cp, m_cLogServerAddr, 16);
 else // mode = 2 INTERNET
  memcpy(cp, m_cLogServerAddr, 16);
	cp += 16;
	
	wp = (WORD *)cp;
	*wp = m_iLogServerPort;
	cp += 2;

 iRet = m_pClientList[iToH]->m_pXSock->iSendMsg(cData, 16 +19);
 break;
with this we have the closes to a sucesfull login

In World Srv
(2006:12:18:19:47) - (TestLog) Send character(NightRider) data...
(2006:12:18:19:47) - (TestLog) Set account(juggalo2) connection status PLAYING...
(2006:12:18:19:47) - (O) Character data file saved : Name(NightRider)
(2006:12:18:19:48) - (TestLog) Set account(juggalo2) connection status WAIT...
now with any other

Code: Select all

DEF_NOTIFY_SERVERCHANGE
(2006:12:18:18:36) - (TestLog) Send character(NightRider) data...
(2006:12:18:18:36) - (TestLog) Set account(juggalo2) connection status PLAYING...
(2006:12:18:18:36) - (O) Character data file saved : Name(NightRider)
(2006:12:18:18:36) - Client Accepted(23)
(2006:12:18:18:36) - (TestLog) Set account(juggalo2) connection status WAIT...
(2006:12:18:18:36) - (TestLog) ReqEnterGame: Accnt(juggalo2) Pass(1) Char(NightRider) Map(aresden) Addr() Port(9901) Code(0)
(2006:12:18:18:36) - (TestLog) ReqEnterGame Reject! Account(juggalo2) status NULL
(2006:12:18:18:36) - (TestLog) Set account(juggalo2) connection status NULL...
(2006:12:18:18:36) - <1> Connection Lost! Delete Client.
I have Tested with many diffent hg clients stock src and with this fix and with out
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

this didnt help me any.. seams to be no diffrence.

i just changed my code in Wl to put them to Null if the map is not registered to WL.

in function

Code: Select all

void CWorldLog::EnterGame(int iClientH, char * pData)
add

Code: Select all

bool bflag; bflag = FALSE; int i;
after

Code: Select all

iCode = iGetMapInformation(cMapName, cAddress, &iPort, iClientH);
	wsprintf(G_cTxt, "(TestLog) ReqEnterGame: Accnt(%s) Pass(%s) Char(%s) Map(%s) Addr(%s) Port(%d) Code(%d)", cAccountName, cAccountPassword, cCharacterName, cMapName, cAddress, iPort, iCode);
PutLogList(G_cTxt);
add

Code: Select all

	//game char fix
  for (i = 0; i < DEF_MAXGAMESERVERSMAPS; i++)
  if((m_cMapList[i] != NULL) && (strcmp(m_cMapList[i]->m_cName, cMapName) == 0)) bflag = TRUE;
  if(bflag == FALSE) {
  	wsprintf(G_cTxt, "(TestLog) ReqEnterGame Reject! Account(%s) status NULL", cAccountName);
  	PutLogList(G_cTxt);
  	SendEventToMLS(MSGID_REQUEST_CLEARACCOUNTSTATUS, DEF_MSGTYPE_CONFIRM, cData, 10, -1);
  	OnPlayerAccountMessage(DEF_MSGACCOUNTSET_NULL, cAccountName, NULL, NULL, NULL);
  	delete m_pClientList[iClientH];
  	m_pClientList[iClientH] = NULL;
  	return;
  	}
i tested it real fast, worked ok... sept i guess it still dose it on downed maps.
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
xenx
Member
Posts: 169
Joined: Tue Oct 03, 2006 7:08 am

Post by xenx »

guys, can i just say that im using the WL source pretty much as is, and iv never seen this bug even once, your sure its not your HG's or clients or something ?
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

ovsiouly what i posted earlyer dosnt solve this problem.

i dont see why its anything els but the WL or client, becouse without the wl source WLserver it never did this, and without the Client it never did this.

i dont know may be a problem with WLserver.

i realy cant understand why my code didnt work. unless thers another thing i have to delete to make the client none active.

i think it may be a problem with Messages to the Main server.

cuz it says Account in use, not Char in use.

and Main deals with all the accounts.

ill check more into Wlsource...

MSGID_REQUEST_CLEARACCOUNTSTATUS must be bad.....

but realy im stumped.
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

Can i just say once again this is a CLIENT FIX for 2.20 CLIENT SOURCE on Hypno's WL which gets the DC/Acc In Use issue. This is not for your HG bugs or other WL bugs. Yes there are more bugs, thats the price you guys pay for using short cuts.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Wow, harsh again dax. But Well Deserved. Enjoy your weed, while it lasts :P
Acidx
Member
Posts: 198
Joined: Tue Mar 23, 2004 4:27 am

Post by Acidx »

wtf this deleted my whole hb client source...
OMG FUCKING HAX!!!!
simple shit =/
Nice tho.. <3 u danny
<b>-<span style='color:green'>ACiD-x </span><span style='color:red'> Owning PCs Since 1987</span><br><img src='http://img204.imageshack.us/img204/2245/hackertf5.gif' border='0' alt='user posted image' /><br><img src='http://img509.imageshack.us/img509/6697 ... 4sc4ed.png' border='0' alt='user posted image' /><br><span style='color:orange'>i am Pwn NetGAYLORDS !</span></b><br><span style='color:blue'><br>I Pwn HBUSA =)</span>
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Welcome Back Acid-X. Your absence was well missed along with your Humor..
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

wow check it out :) i fixed character in use bug.

WL checks see if Map server registered to WL if not it sets accoutn to null / sends message Main telling accounts not in use*

i changed it for were it sends the message first*
so Client comes up with the HG is down message not a Close connection.


This is World Server Srouce

Code: Select all

void CWorldLog::EnterGame(int iClientH, char * pData)
{
 char cData[256], cCharNameCheck[11], cMapName[11], cCharacterName[11], cAccountName[11], cAccountPassword[11], cAddress[16];
 int iPort, iCode, iLevel, iRet;
 char * cp;
 WORD *wp;
 DWORD *dwp;
 int i;
 bool bflag;
 bflag = FALSE;

	if (m_pClientList[iClientH] == NULL) return;
	ZeroMemory(cData, sizeof(cData));
	ZeroMemory(cCharNameCheck, sizeof(cCharNameCheck));
	ZeroMemory(cMapName, sizeof(cMapName));
	ZeroMemory(cCharacterName, sizeof(cCharacterName));
	ZeroMemory(cAccountName, sizeof(cAccountName));
	ZeroMemory(cAccountPassword, sizeof(cAccountPassword));
	ZeroMemory(cAddress, sizeof(cAddress));

	cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2);

	memcpy(cCharacterName, cp, 10);
	cp += 10;

	memcpy(cMapName, cp, 10);
	cp += 10;

	memcpy(cAccountName, cp, 10);
	cp += 10;

	memcpy(cAccountPassword, cp, 10);
	cp += 10;

	iCode = iGetMapInformation(cMapName, cAddress, &iPort, iClientH);
	wsprintf(G_cTxt, "(TestLog) ReqEnterGame: Accnt(%s) Pass(%s) Char(%s) Map(%s) Addr(%s) Port(%d) Code(%d)", cAccountName, cAccountPassword, cCharacterName, cMapName, cAddress, iPort, iCode);
	PutLogList(G_cTxt);
    //game char fix
  for (i = 0; i < DEF_MAXGAMESERVERSMAPS; i++)
  if((m_cMapList[i] != NULL) && (strcmp(m_cMapList[i]->m_cName, cMapName) == 0)) bflag = TRUE;

	if (iCode == -1) {
  dwp  = (DWORD *)(cData);
  *dwp = MSGID_RESPONSE_ENTERGAME;
  wp   = (WORD *)(cData + DEF_INDEX2_MSGTYPE);
  *wp  = DEF_ENTERGAMERESTYPE_REJECT;
  cp = (char *)(cData + DEF_INDEX2_MSGTYPE + 2);
  *cp = 3;
  iRet = m_pClientList[iClientH]->m_pXSock->iSendMsg(cData, 7, DEF_USE_ENCRYPTION);

	if(bflag == FALSE) {
  	wsprintf(G_cTxt, "(TestLog) ReqEnterGame Reject! Account(%s) status NULL", cAccountName);
  	PutLogList(G_cTxt);
  	SendEventToMLS(MSGID_REQUEST_CLEARACCOUNTSTATUS, DEF_MSGTYPE_CONFIRM, cData, 10, -1);
  	OnPlayerAccountMessage(DEF_MSGACCOUNTSET_NULL, cAccountName, NULL, NULL, NULL);
  	return;
  }
	}
	else if (iCode == -2) {
  dwp  = (DWORD *)(cData);
  *dwp = MSGID_RESPONSE_ENTERGAME;
  wp   = (WORD *)(cData + DEF_INDEX2_MSGTYPE);
  *wp  = DEF_ENTERGAMERESTYPE_REJECT;
  cp = (char *)(cData + DEF_INDEX2_MSGTYPE + 2);
  *cp = 5;
  iRet = m_pClientList[iClientH]->m_pXSock->iSendMsg(cData, 7, DEF_USE_ENCRYPTION);
  
	if(bflag == FALSE) {
  	wsprintf(G_cTxt, "(TestLog) ReqEnterGame Reject! Account(%s) status NULL", cAccountName);
  	PutLogList(G_cTxt);
  	SendEventToMLS(MSGID_REQUEST_CLEARACCOUNTSTATUS, DEF_MSGTYPE_CONFIRM, cData, 10, -1);
  	OnPlayerAccountMessage(DEF_MSGACCOUNTSET_NULL, cAccountName, NULL, NULL, NULL);
  	return;
  }
	}
	else {
  if (iGetCharacterInformation(cAccountName, cCharNameCheck, &iLevel) == FALSE) {
  	delete m_pClientList[iClientH];
  	m_pClientList[iClientH] = NULL;
  	wsprintf(G_cTxt, "(TestLog) ReqEnterGame Reject! Account(%s) status NULL", cAccountName);
  	PutLogList(G_cTxt);
  	SendEventToMLS(MSGID_REQUEST_CLEARACCOUNTSTATUS, DEF_MSGTYPE_CONFIRM, cData, 10, -1);
  	OnPlayerAccountMessage(DEF_MSGACCOUNTSET_NULL, cAccountName, NULL, NULL, NULL);
  	return;
  }
  dwp  = (DWORD *)(cData);
  *dwp = MSGID_RESPONSE_ENTERGAME;
  wp   = (WORD *)(cData + DEF_INDEX2_MSGTYPE);
  *wp  = DEF_ENTERGAMERESTYPE_CONFIRM;
	
  cp = (char *)(cData + DEF_INDEX2_MSGTYPE + 2);
  
  memcpy(cp, cAddress, 16);
  cp += 16;

  wp = (WORD *)cp;
  *wp = iPort;
  cp += 2;

  iRet = m_pClientList[iClientH]->m_pXSock->iSendMsg(cData, 24, DEF_USE_ENCRYPTION);
	}
	switch(iRet) {
	case DEF_XSOCKEVENT_QUENEFULL:
	case DEF_XSOCKEVENT_SOCKETERROR:
	case DEF_XSOCKEVENT_CRITICALERROR:
	case DEF_XSOCKEVENT_SOCKETCLOSED:
  delete m_pClientList[iClientH];
  m_pClientList[iClientH] = NULL;
  return;
	}
}
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
Post Reply