mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] fix host wait logic and print more useful help
This commit is contained in:
parent
fc0dbd8782
commit
18cc8d7cab
@ -1448,31 +1448,37 @@ static int lg_run()
|
|||||||
lgWaitEvent(e_startup, TIMEOUT_INFINITE);
|
lgWaitEvent(e_startup, TIMEOUT_INFINITE);
|
||||||
|
|
||||||
LGMP_STATUS status;
|
LGMP_STATUS status;
|
||||||
while(true)
|
uint32_t udataSize;
|
||||||
{
|
KVMFR *udata;
|
||||||
uint32_t udataSize;
|
int waitCount = 0;
|
||||||
KVMFR *udata;
|
|
||||||
|
|
||||||
|
while(state.running)
|
||||||
|
{
|
||||||
if ((status = lgmpClientInit(state.shm.mem, state.shm.size, &state.lgmp,
|
if ((status = lgmpClientInit(state.shm.mem, state.shm.size, &state.lgmp,
|
||||||
&udataSize, (uint8_t **)&udata)) == LGMP_OK)
|
&udataSize, (uint8_t **)&udata)) == LGMP_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (status == LGMP_ERR_INVALID_SESSION || status == LGMP_ERR_INVALID_MAGIC)
|
if (status == LGMP_ERR_INVALID_SESSION || status == LGMP_ERR_INVALID_MAGIC)
|
||||||
{
|
{
|
||||||
SDL_WaitEventTimeout(NULL, 1000);
|
if (waitCount++ == 0)
|
||||||
continue;
|
{
|
||||||
}
|
DEBUG_BREAK();
|
||||||
|
DEBUG_INFO("The host application seems to not be running");
|
||||||
|
DEBUG_INFO("Waiting for the host application to start...");
|
||||||
|
}
|
||||||
|
|
||||||
if (udataSize != sizeof(KVMFR) ||
|
if (waitCount == 30)
|
||||||
memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 ||
|
{
|
||||||
udata->version != KVMFR_VERSION)
|
DEBUG_BREAK();
|
||||||
{
|
DEBUG_INFO("Please check the host application is running and is the correct version");
|
||||||
DEBUG_BREAK();
|
DEBUG_INFO("Check the host log in your guest at %%TEMP%%\\looking-glass-host.txt");
|
||||||
DEBUG_ERROR("The host application is not compatible with this client");
|
DEBUG_INFO("Continuing to wait...");
|
||||||
DEBUG_ERROR("Expected KVMFR version %d", KVMFR_VERSION);
|
}
|
||||||
DEBUG_ERROR("This is not a Looking Glass error, do not report this");
|
|
||||||
DEBUG_BREAK();
|
if (status == LGMP_ERR_INVALID_SESSION)
|
||||||
return -1;
|
SDL_WaitEventTimeout(NULL, 1000);
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_ERROR("lgmpClientInit Failed: %s", lgmpStatusString(status));
|
DEBUG_ERROR("lgmpClientInit Failed: %s", lgmpStatusString(status));
|
||||||
@ -1482,6 +1488,18 @@ static int lg_run()
|
|||||||
if (!state.running)
|
if (!state.running)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (udataSize != sizeof(KVMFR) ||
|
||||||
|
memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 ||
|
||||||
|
udata->version != KVMFR_VERSION)
|
||||||
|
{
|
||||||
|
DEBUG_BREAK();
|
||||||
|
DEBUG_ERROR("The host application is not compatible with this client");
|
||||||
|
DEBUG_ERROR("Expected KVMFR version %d", KVMFR_VERSION);
|
||||||
|
DEBUG_ERROR("This is not a Looking Glass error, do not report this");
|
||||||
|
DEBUG_BREAK();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG_INFO("Host ready, starting session");
|
DEBUG_INFO("Host ready, starting session");
|
||||||
|
|
||||||
if (!lgCreateThread("cursorThread", cursorThread, NULL, &t_cursor))
|
if (!lgCreateThread("cursorThread", cursorThread, NULL, &t_cursor))
|
||||||
@ -1496,7 +1514,6 @@ static int lg_run()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool *closeAlert = NULL;
|
|
||||||
while(state.running)
|
while(state.running)
|
||||||
{
|
{
|
||||||
SDL_WaitEventTimeout(NULL, 1000);
|
SDL_WaitEventTimeout(NULL, 1000);
|
||||||
@ -1506,31 +1523,6 @@ static int lg_run()
|
|||||||
DEBUG_WARN("Session is invalid, has the host shutdown?");
|
DEBUG_WARN("Session is invalid, has the host shutdown?");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)closeAlert;
|
|
||||||
/*
|
|
||||||
if (closeAlert == NULL)
|
|
||||||
{
|
|
||||||
if (state.kvmfr->flags & KVMFR_HEADER_FLAG_PAUSED)
|
|
||||||
{
|
|
||||||
if (state.lgr && params.showAlerts)
|
|
||||||
state.lgr->on_alert(
|
|
||||||
state.lgrData,
|
|
||||||
LG_ALERT_WARNING,
|
|
||||||
"Stream Paused",
|
|
||||||
&closeAlert
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!(state.kvmfr->flags & KVMFR_HEADER_FLAG_PAUSED))
|
|
||||||
{
|
|
||||||
*closeAlert = true;
|
|
||||||
closeAlert = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 61c9178c87df46f39a817e63eb85afe2a131e51d
|
Subproject commit 520350a8af533a8ef307da13fa95a19d5ae78762
|
Loading…
Reference in New Issue
Block a user