mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-02 15:56:02 +00:00
Show information about host system
This commit is contained in:
parent
129962d126
commit
43c06a2338
@ -172,7 +172,6 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
char *stateText = NULL;
|
char *stateText = NULL;
|
||||||
char *heightText = NULL;
|
char *heightText = NULL;
|
||||||
char *serverCodecModeSupportText = NULL;
|
char *serverCodecModeSupportText = NULL;
|
||||||
char *maxLumaPixelsHEVC = NULL;
|
|
||||||
|
|
||||||
uuid_t uuid;
|
uuid_t uuid;
|
||||||
char uuid_str[37];
|
char uuid_str[37];
|
||||||
@ -215,14 +214,12 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
if (xml_search(data->memory, data->size, "gputype", &server->gpuType) != GS_OK)
|
if (xml_search(data->memory, data->size, "gputype", &server->gpuType) != GS_OK)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (xml_search(data->memory, data->size, "GfeVersion", &server->gfeVersion) != GS_OK)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
server->paired = pairedText != NULL && strcmp(pairedText, "1") == 0;
|
server->paired = pairedText != NULL && strcmp(pairedText, "1") == 0;
|
||||||
server->currentGame = currentGameText == NULL ? 0 : atoi(currentGameText);
|
server->currentGame = currentGameText == NULL ? 0 : atoi(currentGameText);
|
||||||
server->supports4K = heightText != NULL && serverCodecModeSupportText != NULL && atoi(heightText) >= 2160;
|
server->supports4K = heightText != NULL && serverCodecModeSupportText != NULL && atoi(heightText) >= 2160;
|
||||||
server->maxLumaPixelsHEVC = maxLumaPixelsHEVC == NULL ? 0 : atol(maxLumaPixelsHEVC);
|
|
||||||
char *versionSep = strstr(versionText, ".");
|
|
||||||
if (versionSep != NULL) {
|
|
||||||
*versionSep = 0;
|
|
||||||
}
|
|
||||||
server->serverMajorVersion = atoi(versionText);
|
server->serverMajorVersion = atoi(versionText);
|
||||||
if (strstr(stateText, "_SERVER_AVAILABLE")) {
|
if (strstr(stateText, "_SERVER_AVAILABLE")) {
|
||||||
// After GFE 2.8, current game remains set even after streaming
|
// After GFE 2.8, current game remains set even after streaming
|
||||||
@ -251,9 +248,6 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
if (serverCodecModeSupportText != NULL)
|
if (serverCodecModeSupportText != NULL)
|
||||||
free(serverCodecModeSupportText);
|
free(serverCodecModeSupportText);
|
||||||
|
|
||||||
if (maxLumaPixelsHEVC != NULL)
|
|
||||||
free(maxLumaPixelsHEVC);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@
|
|||||||
typedef struct _SERVER_DATA {
|
typedef struct _SERVER_DATA {
|
||||||
const char* address;
|
const char* address;
|
||||||
char* gpuType;
|
char* gpuType;
|
||||||
|
char* gfeVersion;
|
||||||
bool paired;
|
bool paired;
|
||||||
bool supports4K;
|
bool supports4K;
|
||||||
int currentGame;
|
int currentGame;
|
||||||
int serverMajorVersion;
|
int serverMajorVersion;
|
||||||
long maxLumaPixelsHEVC;
|
|
||||||
} SERVER_DATA, *PSERVER_DATA;
|
} SERVER_DATA, *PSERVER_DATA;
|
||||||
|
|
||||||
int gs_init(PSERVER_DATA server, const char *keyDirectory);
|
int gs_init(PSERVER_DATA server, const char *keyDirectory);
|
||||||
|
@ -201,6 +201,7 @@ int main(int argc, char* argv[]) {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
config.address[0] = 0;
|
config.address[0] = 0;
|
||||||
|
printf("Searching for server...\n");
|
||||||
gs_discover_server(config.address);
|
gs_discover_server(config.address);
|
||||||
if (config.address[0] == 0) {
|
if (config.address[0] == 0) {
|
||||||
fprintf(stderr, "Autodiscovery failed. Specify an IP address next time.\n");
|
fprintf(stderr, "Autodiscovery failed. Specify an IP address next time.\n");
|
||||||
@ -229,6 +230,8 @@ int main(int argc, char* argv[]) {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("NVIDIA %s, GFE %s (protocol version %d)\n", server.gpuType, server.gfeVersion, server.serverMajorVersion);
|
||||||
|
|
||||||
if (strcmp("list", config.action) == 0) {
|
if (strcmp("list", config.action) == 0) {
|
||||||
pair_check(&server);
|
pair_check(&server);
|
||||||
applist(&server);
|
applist(&server);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user