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!

[C++] How to make Launcher keep wating response until server start

Newbie Spellweaver
Joined
Feb 2, 2015
Messages
77
Reaction score
54
this will make launcher keep wating response from server. without (re-opening launcher)



AtumLauncherDlg.h
Code:
// add this to bottom of header list (if dont know just put some where until you can complie it)
[COLOR=#ff0000][B]define TIMERID_SERVER_START_CHECK		5[/B][/COLOR]

...

// find this
public:
	CUpdateWinSocket	*m_pUpdateWinsocket;

[B][COLOR=#ff0000]// add this inside that public:
BOOL				m_bReadyNextRequest;z
	BOOL				m_bProcessingServerRespone;
	DWORD					m_bDotCount;[/COLOR][/B]

AtumLauncherDlg.cpp
Code:
CAtumLauncherDlg::CAtumLauncherDlg(....)

[B][COLOR=#ff0000]// add this inside function 
m_bProcessingServerRespone = FALSE;
	m_bReadyNextRequest = FALSE;
	m_bDotCount = 0;

[/COLOR][/B]...

LONG CAtumLauncherDlg::OnSocketNotify(WPARAM wParam, LPARAM lParam)
// find case T_PC_CONNECT_VERSION_OK:

// replace this
SetProgressGroupText(STRMSG_S_ATUMLAUNCHER_0000);
				m_bProcessingVersionUpdate = TRUE;

[COLOR=#ff0000][B]// with this
m_bProcessingVersionUpdate = TRUE;
				if (m_bProcessingServerRespone == FALSE)
				{
     m_bReadyNextRequest = TRUE;
     SetTimer(TIMERID_SERVER_START_CHECK, 500, NULL);
     SetProgressGroupText(STRMSG_S_ATUMLAUNCHER_0000_A);
     return 0;
				}
				UPDATECOMPLETE:
				SetProgressGroupText(STRMSG_S_ATUMLAUNCHER_0000_B);[/B][/COLOR]

...

//find case T_PC_CONNECT_GET_SERVER_GROUP_LIST_OK:
// then focus to this

AtumMessageBox(STRERR_S_ATUMLAUNCHER_0012);
						OnCancel();

//replace with this

[COLOR=#ff0000][B]m_bReadyNextRequest = TRUE;
						if (m_bDotCount > 3)
							m_bDotCount = 0;
						++m_bDotCount;

						char xchar[128];
						char xdot[5] = "    ";
						for (int nNum = 0; nNum < m_bDotCount; nNum++)
						{
     xdot[nNum] = '.';
						}
						sprintf(xchar, "%s%s", STRMSG_S_ATUMLAUNCHER_0000_A, xdot);
						SetProgressGroupText(xchar);						return 0;[/B][/COLOR]

...
// find m_nOldSel = nIndexMinCrowdednessServerGroup;

[COLOR=#ff0000][B]// put this under that line[/B][/COLOR]
[COLOR=#ff0000][B]m_bProcessingServerRespone = TRUE;
					KillTimer(TIMERID_SERVER_START_CHECK);
					m_bReadyNextRequest = TRUE;
					goto UPDATECOMPLETE;[/B][/COLOR]
...


// find void CAtumLauncherDlg::OnTimer(UINT nIDEvent)
// add this below else if (TIMERID_NETWORK_STATE_CHECK == nIDEvent) { .. }

[B][COLOR=#ff0000]else if (TIMERID_SERVER_START_CHECK == nIDEvent)
	{
     if (m_bReadyNextRequest)
     {
          m_bReadyNextRequest = FALSE;
          m_pUpdateWinsocket->WriteMessageType(T_PC_CONNECT_GET_SERVER_GROUP_LIST);
          INIT_MSG_WITH_BUFFER(MSG_PC_CONNECT_VERSION, T_PC_CONNECT_VERSION, msgVersion, msgVersionBuff);
          msgVersion->ClientVersion[0] = m_CurrentVersion.GetVersion()[0];
          msgVersion->ClientVersion[1] = m_CurrentVersion.GetVersion()[1];
          msgVersion->ClientVersion[2] = m_CurrentVersion.GetVersion()[2];
          msgVersion->ClientVersion[3] = m_CurrentVersion.GetVersion()[3];
          msgVersion->nFirst = 1;
          m_pUpdateWinsocket->Write(msgVersionBuff, MSG_SIZE(MSG_PC_CONNECT_VERSION));
      }
	}[/COLOR][/B]

* dont forget add new text sting for
STRMSG_S_ATUMLAUNCHER_0000_A "Wating Server Starting"
STRMSG_S_ATUMLAUNCHER_0000_B "Ready"
 
Junior Spellweaver
Joined
Sep 12, 2014
Messages
119
Reaction score
34
and since most no longer use a website in the launcher it would be good to add that answer.That "Feature" makes it take time to respond to the launcher (the load is not much but it can improve)
 
Back
Top