mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-08-17 17:06:10 +00:00
Check protocol version
This commit is contained in:
parent
9b98371afc
commit
b30cf20f8c
@ -268,6 +268,16 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
i++;
|
i++;
|
||||||
} while (ret != GS_OK && i < 2);
|
} while (ret != GS_OK && i < 2);
|
||||||
|
|
||||||
|
if (ret == GS_OK) {
|
||||||
|
if (server->serverMajorVersion > MAX_SUPPORTED_GFE_VERSION) {
|
||||||
|
gs_error = "Ensure you're running the latest version of Moonlight Embedded or downgrade GeForce Experience and try again";
|
||||||
|
ret = GS_UNSUPPORTED_VERSION;
|
||||||
|
} else if (server->serverMajorVersion < MIN_SUPPORTED_GFE_VERSION) {
|
||||||
|
gs_error = "Moonlight Embedded requires a newer version of GeForce Experience. Please upgrade GFE on your PC and try again.";
|
||||||
|
ret = GS_UNSUPPORTED_VERSION;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#define MIN_SUPPORTED_GFE_VERSION 3
|
||||||
|
#define MAX_SUPPORTED_GFE_VERSION 7
|
||||||
|
|
||||||
typedef struct _SERVER_DATA {
|
typedef struct _SERVER_DATA {
|
||||||
const char* address;
|
const char* address;
|
||||||
char* gpuType;
|
char* gpuType;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of Moonlight Embedded.
|
* This file is part of Moonlight Embedded.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Iwan Timmer
|
* Copyright (C) 2015, 2016 Iwan Timmer
|
||||||
*
|
*
|
||||||
* Moonlight is free software; you can redistribute it and/or modify
|
* Moonlight is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -26,5 +26,6 @@
|
|||||||
#define GS_WRONG_STATE -4
|
#define GS_WRONG_STATE -4
|
||||||
#define GS_IO_ERROR -5
|
#define GS_IO_ERROR -5
|
||||||
#define GS_NOT_SUPPORTED_4K -6
|
#define GS_NOT_SUPPORTED_4K -6
|
||||||
|
#define GS_UNSUPPORTED_VERSION -7
|
||||||
|
|
||||||
const char* gs_error;
|
const char* gs_error;
|
||||||
|
@ -226,6 +226,9 @@ int main(int argc, char* argv[]) {
|
|||||||
} else if (ret == GS_INVALID) {
|
} else if (ret == GS_INVALID) {
|
||||||
fprintf(stderr, "Invalid data received from server: %s\n", config.address, gs_error);
|
fprintf(stderr, "Invalid data received from server: %s\n", config.address, gs_error);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
} else if (ret == GS_UNSUPPORTED_VERSION) {
|
||||||
|
fprintf(stderr, "Unsupported version: %s\n", gs_error);
|
||||||
|
exit(-1);
|
||||||
} else if (ret != GS_OK) {
|
} else if (ret != GS_OK) {
|
||||||
fprintf(stderr, "Can't connect to server %s\n", config.address);
|
fprintf(stderr, "Can't connect to server %s\n", config.address);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user