Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

GunZ has stopped working when I push button connect on Login

Newbie Spellweaver
Joined
May 14, 2011
Messages
30
Reaction score
12
Hi, I've migrated my source code from Visual Studio 2003 to Visual Studio 2010 or 2012. I get an error when I push button connect on Login: "GunZ has stopped working". I tried absolutely everything, or something.

I wrote mlog's functions after initialization interface will load up to a function called ZPostConnect.
I know where the error lies, on ZPostConnect.


ZInterfaceListener.cpp (line 171)

class MLoginListener : public MListener{
public:
virtual bool OnCommand(MWidget* pWidget, const char* szMessage){
if(MWidget::IsMsg(szMessage, MBTN_CLK_MSG)==true)
{
ZIDLResource* pResource = ZGetGameInterface()->GetIDLResource();

ZServerView* pServerList = (ZServerView*)pResource->FindWidget( "SelectedServer");
if ( !pServerList)
return false;

ServerInfo* pServer = pServerList->GetSelectedServer();
if ( pServer)
{
if ( pServer->nType == 0 )
return false;

if( !pServer->bIsLive )
return false;

MWidget* pWidget = pResource->FindWidget( "LoginOK");
if ( pWidget)
pWidget->Enable( false);

pWidget = pResource->FindWidget( "LoginFrame");
if ( pWidget)
pWidget->Show( false);

pWidget = pResource->FindWidget( "Login_ConnectingMsg");
if ( pWidget)
pWidget->Show( true);


ZGetGameInterface()->m_bLoginTimeout = true;
ZGetGameInterface()->m_dwLoginTimeout = timeGetTime() + (90 * 1000);


if ( pServer->nType == 7)
{
MWidget* pAddr = pResource->FindWidget( "ServerAddress");
MWidget* pPort = pResource->FindWidget( "ServerPort");

ZPostConnect( pAddr->GetText(), atoi(pPort->GetText()));
}
else

ZPostConnect( pServer->szAddress, pServer->nPort);


MLabel* pLabel = (MLabel*)pResource->FindWidget( "LoginError");
if ( pLabel)
pLabel->SetText("");
}
}
return false;
}
};


Definition:
inline void ZPostConnect(const char* szAddr, unsigned int nPort)
{
char szCmd[256];
sprintf(szCmd, "%s:%u", szAddr, nPort);

ZPOSTCMD1(MC_NET_CONNECT, MCmdParamStr(szCmd));

}

Oop, ZPOSTCMD1 seems to be the error, I go the statement... and I wrote mlog's functions so:

#define ZPOSTCMD1(_ID, _P0) { mlog("Error 1 \n"); MCommand* pC=ZNewCmd(_ID); mlog("Error 2 \n"); pC->AP(_P0); mlog("Error 3 \n"); ZPostCommand(pC); }

And it comes to error 3, I conclude that it is a problem with the packets send via the ZPostConnect...
I do not know that trying to this point, I need someone with a more or less advanced knowledge to help me get it. I'll get it back somehow.

Thanks and sorry for the bad english, I'm a Spanish speaker.


Posdata: is from Gunz.exe not from MatchServer.exe
I tried with the old version of MatchServer (VS2003) and I get the same error, and when I tried with the server off, I can push the button and it not crash.
 
Newbie Spellweaver
Joined
May 14, 2011
Messages
30
Reaction score
12
Great, thanks for the hand. You know more about this error? could be more specific?
 
Upvote 0
I'm retired, I'm already
Banned
Joined
Oct 3, 2011
Messages
832
Reaction score
155
try these.

PHP:
#pragma once
//NEW 2011

// ASM Dirección 1
#ifdef _DEBUG
#define CHECK_RETURN_CALLSTACK(FuncName)			DWORD ret_ptr_dlrjsTmwlakdy	= 0; \
													DWORD *dwI = NULL; \
													__asm {pushad} \
													__asm {mov eax, ebp} \
													__asm {add eax, 4} \
													__asm {mov eax, dword ptr ds:[eax]}	\
													__asm {mov ret_ptr_dlrjsTmwlakdy, eax}	\ //La Verga
													__asm {mov eax, FuncName} \
													__asm {mov dwI, eax}	\
													__asm {popad}; \
														DWORD top		= (DWORD)0x00401000 + 0x246000; \
														DWORD bottom	= (DWORD)0x00401000; \
														if( (ret_ptr_dlrjsTmwlakdy <= bottom) || (ret_ptr_dlrjsTmwlakdy >= top) ) { \
														MCommand* pC=ZNewCmd(MC_REQUEST_GIVE_ONESELF_UP); ZPostCommand(pC); } 
#else
#define CHECK_RETURN_CALLSTACK(FuncName)
#endif


// ASM Dirección 2
#ifdef _DEBUG
#define CHECK_RETURN_CALLSTACK_ESP(FuncName)		DWORD ret_ptr_dlrjsTmwlakdy	= 0; \
													DWORD *dwI = NULL; \
													__asm {pushad} \
													__asm {mov eax, esp} \
													__asm {add eax, 4} \
													__asm {mov eax, dword ptr ds:[eax]}	\
													__asm {mov ret_ptr_dlrjsTmwlakdy, eax}	\
													__asm {mov eax, FuncName} \
													__asm {mov dwI, eax}	\
													__asm {popad}; \
													DWORD top		= (DWORD)0x00401000 + 0x246000; \
													DWORD bottom	= (DWORD)0x00401000; \ //La pija
													if( (ret_ptr_dlrjsTmwlakdy <= bottom) || (ret_ptr_dlrjsTmwlakdy >= top) ) { \
													MCommand* pC=ZNewCmd(MC_REQUEST_GIVE_ONESELF_UP); ZPostCommand(pC); } 
#else
#define CHECK_RETURN_CALLSTACK_ESP(FuncName)
#endif
 
Upvote 0
Back
Top