Example #1
0
void LinkServer::OnServerStart()
{
	int errorcode;
	ServerWait dlg;

	UpdateData(TRUE);

	lanlink.numgbas = m_numplayers+1;
	lanlink.type = m_prottype;
	lanlink.server = 1;
	lanlink.speed = m_speed==1 ? true : false;

	if((errorcode=ls.Init(&dlg))!=0){
		char message[50];
		sprintf(message, _T("Error %d occured.\nPlease try again."), errorcode);
		MessageBox(message, _T("Error"), MB_OK);
		return;
	}

	dlg.DoModal();

	return;
}
Example #2
0
void LinkClient::OnLinkConnect()
{
	char ipaddress[31];
	int errorcode;
	ServerWait dlg;

	UpdateData(TRUE);

	lanlink.type = m_prottype;
	lanlink.server = 0;
	lanlink.speed = m_hacks==1 ? true : false;

	m_serverip.GetWindowText(ipaddress, 30);
	
	if((errorcode=lc.Init(gethostbyname(ipaddress), &dlg))!=0){
		
		char message[50];
		sprintf(message, _T("Error %d occured.\nPlease try again."), errorcode);
		MessageBox(message, _T("Error"), MB_OK);
		return;
	}
	dlg.DoModal();
	return;
}