bool CClientApp::startClient() { double retryTime; CScreen* clientScreen = NULL; try { if (s_clientScreen == NULL) { clientScreen = openClientScreen(); s_client = openClient(args().m_name, *args().m_serverAddress, clientScreen); s_clientScreen = clientScreen; LOG((CLOG_NOTE "started client")); } #if SYSAPI_WIN32 && GAME_DEVICE_SUPPORT if (args().m_gameDevice) { // TODO: currently this is failing because we're not // forcing compile with the DX XInput.h (so the win // SDK is being used)... we need to figure out how to // tell cmake to prefer the DX include path. LOG((CLOG_DEBUG "installing xinput hook")); InstallXInputHook(); } #endif s_client->connect(); updateStatus(); return true; } catch (XScreenUnavailable& e) { LOG((CLOG_WARN "secondary screen unavailable: %s", e.what())); closeClientScreen(clientScreen); updateStatus(CString("secondary screen unavailable: ") + e.what()); retryTime = e.getRetryTime(); } catch (XScreenOpenFailure& e) { LOG((CLOG_CRIT "failed to start client: %s", e.what())); closeClientScreen(clientScreen); return false; } catch (XBase& e) { LOG((CLOG_CRIT "failed to start client: %s", e.what())); closeClientScreen(clientScreen); return false; } if (args().m_restartable) { scheduleClientRestart(retryTime); return true; } else { // don't try again return false; } }
void ClientApp::stopClient() { closeClient(m_client); closeClientScreen(m_clientScreen); m_client = NULL; m_clientScreen = NULL; }
void ClientApp::stopClient() { closeClient(m_client); closeClientScreen(m_clientScreen); m_client = nullptr; m_clientScreen = nullptr; }
bool ClientApp::startClient() { double retryTime; synergy::Screen* clientScreen = NULL; try { if (m_clientScreen == NULL) { clientScreen = openClientScreen(); m_client = openClient(args().m_name, *m_serverAddress, clientScreen); m_clientScreen = clientScreen; LOG((CLOG_NOTE "started client")); } m_client->connect(); updateStatus(); return true; } catch (XScreenUnavailable& e) { LOG((CLOG_WARN "secondary screen unavailable: %s", e.what())); closeClientScreen(clientScreen); updateStatus(String("secondary screen unavailable: ") + e.what()); retryTime = e.getRetryTime(); } catch (XScreenOpenFailure& e) { LOG((CLOG_CRIT "failed to start client: %s", e.what())); closeClientScreen(clientScreen); return false; } catch (XBase& e) { LOG((CLOG_CRIT "failed to start client: %s", e.what())); closeClientScreen(clientScreen); return false; } if (args().m_restartable) { scheduleClientRestart(retryTime); return true; } else { // don't try again return false; } }
static void stopClient() { closeClient(s_client); closeClientScreen(s_clientScreen); s_client = NULL; s_clientScreen = NULL; }
static bool startClient() { double retryTime; CScreen* clientScreen = NULL; try { if (s_clientScreen == NULL) { clientScreen = openClientScreen(); s_client = openClient(ARG->m_name, *ARG->m_serverAddress, clientScreen); s_clientScreen = clientScreen; LOG((CLOG_NOTE "started client")); } s_client->connect(); updateStatus(); return true; } catch (XScreenUnavailable& e) { LOG((CLOG_WARN "cannot open secondary screen: %s", e.what())); closeClientScreen(clientScreen); updateStatus(CString("Cannot open secondary screen: ") + e.what()); retryTime = e.getRetryTime(); } catch (XScreenOpenFailure& e) { LOG((CLOG_CRIT "cannot open secondary screen: %s", e.what())); closeClientScreen(clientScreen); return false; } catch (XBase& e) { LOG((CLOG_CRIT "failed to start client: %s", e.what())); closeClientScreen(clientScreen); return false; } if (ARG->m_restartable) { scheduleClientRestart(retryTime); return true; } else { // don't try again return false; } }
void CClientApp::stopClient() { #if SYSAPI_WIN32 && GAME_DEVICE_SUPPORT if (args().m_gameDevice) { LOG((CLOG_DEBUG "removing xinput hook")); RemoveXInputHook(); } #endif closeClient(s_client); closeClientScreen(s_clientScreen); s_client = NULL; s_clientScreen = NULL; }