I work with Ketchup source v17 (vs19).
For some time I have had problems with reconnection disconnection.
That is to say I connect to my server and I disconnect and reconnect and the coming selection of characters I click on valid.
He tells me that the connection with the server has been interrupted.
Neuz/DPLoginClient.cpp :
Code:
void CDPLoginClient::SysMessageHandler( LPDPMSG_GENERIC lpMsg, DWORD dwMsgSize, DPID idFrom )
{
switch( lpMsg->dwType )
{
case DPSYS_CREATEPLAYERORGROUP:
m_fConn = TRUE;
break;
case DPSYS_DESTROYPLAYERORGROUP:
{
#ifdef __INFO_SOCKLIB0516
{
LPDPMSG_DESTROYPLAYERORGROUP lpDestroyPlayer = (LPDPMSG_DESTROYPLAYERORGROUP)lpMsg;
m_lError = lpDestroyPlayer->dwFlags;
}
#endif
CNetwork::GetInstance().OnEvent( LOGIN_DISCONNECT );
m_fConn = FALSE;
g_DPlay.DeleteDPObject();
if( m_bShowDisconnectMsg )
g_WndMng.OpenMessageBoxUpper( prj.GetText(TID_DIAG_0023), MB_OK, TRUE ); //서버로부터 접속이 해제되었습니다.
m_bShowDisconnectMsg = TRUE;
break;
}
}
}
Code:
void CDPLoginSrvr::SysMessageHandler( LPDPMSG_GENERIC lpMsg, DWORD dwMsgSize, DPID idFrom )
{
switch( lpMsg->dwType )
{
case DPSYS_CREATEPLAYERORGROUP:
{
LPDPMSG_CREATEPLAYERORGROUP lpCreatePlayer = (LPDPMSG_CREATEPLAYERORGROUP)lpMsg;
DPID dpid = lpCreatePlayer->dpId;
CUser* pUser = new CUser( dpid );
if( g_UserMng.AddUser( dpid, pUser ) )
{
}
else
{
DestroyPlayer( dpid );
safe_delete( pUser );
}
break;
}
case DPSYS_DESTROYPLAYERORGROUP:
{
LPDPMSG_DESTROYPLAYERORGROUP lpDestroyPlayer = (LPDPMSG_DESTROYPLAYERORGROUP)lpMsg;
OnRemoveConnection( lpDestroyPlayer->dpId );
break;
}
}
}
I am a beginner on the sources.
Sorry for english i used translate to help me.






