(V17/VS19) Bug disconnection and reconnection (Login Server / Neuz)

04/08/2020 12:41 cinki#1
Hello Guys,



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;
			}
	}
}
LoginServer/DPLoginSrvr.cpp :

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;
		}
	}
}
So I looked for the code that disconnects me and here it is my for a few days I can not progress more than that.


I am a beginner on the sources.
Sorry for english i used translate to help me.
04/08/2020 18:28 - DK#2
Quote:
Originally Posted by cinki View Post
Hello Guys,



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;
			}
	}
}
LoginServer/DPLoginSrvr.cpp :

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;
		}
	}
}
So I looked for the code that disconnects me and here it is my for a few days I can not progress more than that.


I am a beginner on the sources.
Sorry for english i used translate to help me.
Use Blouflash Files. Its better!
04/08/2020 19:47 cinki#3
Ok Thanks i go restarted on blouflash files thanks.

You think is bad ketchup files for beginner ?
04/09/2020 03:00 Hyellow#4
Quote:
Originally Posted by cinki View Post
Ok Thanks i go restarted on blouflash files thanks.

You think is bad ketchup files for beginner ?
No its not.
04/09/2020 06:32 flyforall123#5
Check port and ip . did you use local ip ? 127.0.0.1 ?
because im using ketchup source . i dont have any problems
04/09/2020 10:55 cinki#6
Quote:
Originally Posted by flyforall123 View Post
Check port and ip . did you use local ip ? 127.0.0.1 ?
because im using ketchup source . i dont have any problems
I already checked the port and ip my my first connection could not work if it was that while it works is that when I mz connect a first time and I disconnect and reconnect that I have this worries as if the loginserver / neuz does not send the information that I am disconnected.
04/12/2020 10:59 - DK#7
Quote:
Originally Posted by cinki View Post
Ok Thanks i go restarted on blouflash files thanks.

You think is bad ketchup files for a beginner ?
That's it :)

Don't listen to other guys because I do the upgrade from v15 to V21 and it work fine... Basic start by V15 is important to learn it! Do an upgrade by yourself or u will find awesome bugs by the bad quality of other guys.