mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-06-17 06:11:36 +00:00
Optional disable sops
This commit is contained in:
+3
-6
@@ -205,7 +205,7 @@ cleanup:
|
|||||||
return !!result;
|
return !!result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void client_pair(const char *address) {
|
void client_pair(const char *address) {
|
||||||
char url[4096];
|
char url[4096];
|
||||||
|
|
||||||
char pin[5];
|
char pin[5];
|
||||||
@@ -317,7 +317,7 @@ int client_get_app_id(const char *address, char *name) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_start_app(STREAM_CONFIGURATION *config, const char *address, int appId) {
|
void client_start_app(STREAM_CONFIGURATION *config, const char *address, int appId, bool sops) {
|
||||||
RAND_bytes(config->remoteInputAesKey, 16);
|
RAND_bytes(config->remoteInputAesKey, 16);
|
||||||
memset(config->remoteInputAesIv, 0, 16);
|
memset(config->remoteInputAesIv, 0, 16);
|
||||||
|
|
||||||
@@ -329,7 +329,7 @@ void client_start_app(STREAM_CONFIGURATION *config, const char *address, int app
|
|||||||
|
|
||||||
struct http_data *data = http_create_data();
|
struct http_data *data = http_create_data();
|
||||||
if (currentGame == 0)
|
if (currentGame == 0)
|
||||||
sprintf(url, "https://%s:47984/launch?uniqueid=%s&appid=%d&mode=%dx%dx%d&additionalStates=1&sops=1&rikey=%s&rikeyid=%d&localAudioPlayMode=0", address, unique_id, appId, config->width, config->height, config->fps, rikey_hex, rikeyid);
|
sprintf(url, "https://%s:47984/launch?uniqueid=%s&appid=%d&mode=%dx%dx%d&additionalStates=1&sops=%d&rikey=%s&rikeyid=%d&localAudioPlayMode=0", address, unique_id, appId, config->width, config->height, config->fps, sops, rikey_hex, rikeyid);
|
||||||
else
|
else
|
||||||
sprintf(url, "https://%s:47984/resume?uniqueid=%s&rikey=%s&rikeyid=%d", address, unique_id, rikey_hex, rikeyid);
|
sprintf(url, "https://%s:47984/resume?uniqueid=%s&rikey=%s&rikeyid=%d", address, unique_id, rikey_hex, rikeyid);
|
||||||
|
|
||||||
@@ -343,7 +343,4 @@ void client_init(const char *address) {
|
|||||||
client_load_cert();
|
client_load_cert();
|
||||||
|
|
||||||
client_load_server_status(address);
|
client_load_server_status(address);
|
||||||
if (!paired) {
|
|
||||||
client_pair(address);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -21,7 +21,10 @@
|
|||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include "limelight-common/Limelight.h"
|
||||||
|
|
||||||
|
#include "stdbool.h"
|
||||||
|
|
||||||
void client_init(const char* serverAddress);
|
void client_init(const char* serverAddress);
|
||||||
void client_start_app(STREAM_CONFIGURATION *config, const char* serverAddress, int appId);
|
void client_start_app(STREAM_CONFIGURATION *config, const char* serverAddress, int appId, bool sops);
|
||||||
struct app_list* client_applist(const char* serverAddress);
|
struct app_list* client_applist(const char* serverAddress);
|
||||||
int client_get_app_id(const char* serverAddress, char* name);
|
int client_get_app_id(const char* serverAddress, char* name);
|
||||||
|
void client_pair(const char *address);
|
||||||
|
|||||||
+11
-4
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
@@ -46,14 +47,14 @@ static void applist(const char* address) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stream(STREAM_CONFIGURATION* config, const char* address, const char* app) {
|
static void stream(STREAM_CONFIGURATION* config, const char* address, const char* app, bool sops) {
|
||||||
int appId = client_get_app_id(address, app);
|
int appId = client_get_app_id(address, app);
|
||||||
if (appId<0) {
|
if (appId<0) {
|
||||||
printf("Can't find app %s\n", app);
|
printf("Can't find app %s\n", app);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
client_start_app(config, address, appId);
|
client_start_app(config, address, appId, sops);
|
||||||
|
|
||||||
struct in_addr addr;
|
struct in_addr addr;
|
||||||
inet_aton(address, &addr);
|
inet_aton(address, &addr);
|
||||||
@@ -81,6 +82,7 @@ static void help() {
|
|||||||
printf("\t-bitrate <bitrate>\tSpecify the bitrate in Kbps\n");
|
printf("\t-bitrate <bitrate>\tSpecify the bitrate in Kbps\n");
|
||||||
printf("\t-packetsize <size>\tSpecify the maximum packetsize in bytes\n");
|
printf("\t-packetsize <size>\tSpecify the maximum packetsize in bytes\n");
|
||||||
printf("\t-app <app>\t\tName of app to stream\n");
|
printf("\t-app <app>\t\tName of app to stream\n");
|
||||||
|
printf("\t-nosops\t\t\tDon't allow GFE to modify game settings\n");
|
||||||
printf("\t-input <device>\t\tUse <device> as input. Can be used multiple times\n");
|
printf("\t-input <device>\t\tUse <device> as input. Can be used multiple times\n");
|
||||||
printf("\t-mapping <file>\t\tUse <file> as gamepad mapping configuration file (use before -input)\n");
|
printf("\t-mapping <file>\t\tUse <file> as gamepad mapping configuration file (use before -input)\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
@@ -106,6 +108,7 @@ int main(int argc, char* argv[]) {
|
|||||||
{"app", required_argument, 0, 'i'},
|
{"app", required_argument, 0, 'i'},
|
||||||
{"input", required_argument, 0, 'j'},
|
{"input", required_argument, 0, 'j'},
|
||||||
{"mapping", required_argument, 0, 'k'},
|
{"mapping", required_argument, 0, 'k'},
|
||||||
|
{"nosops", no_argument, 0, 'l'},
|
||||||
{0, 0, 0, 0},
|
{0, 0, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -114,8 +117,9 @@ int main(int argc, char* argv[]) {
|
|||||||
char* address = NULL;
|
char* address = NULL;
|
||||||
char* mapping = NULL;
|
char* mapping = NULL;
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
|
bool sops = true;
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt_long_only (argc, argv, "-abc:d:efg:h:i:j:", long_options, &option_index)) != -1) {
|
while ((c = getopt_long_only(argc, argv, "-abc:d:efg:h:i:j:k:l", long_options, &option_index)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
config.width = 720;
|
config.width = 720;
|
||||||
@@ -152,6 +156,9 @@ int main(int argc, char* argv[]) {
|
|||||||
case 'k':
|
case 'k':
|
||||||
mapping = optarg;
|
mapping = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'l':
|
||||||
|
sops = false;
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (action == NULL)
|
if (action == NULL)
|
||||||
action = optarg;
|
action = optarg;
|
||||||
@@ -177,7 +184,7 @@ int main(int argc, char* argv[]) {
|
|||||||
if (strcmp("applist", action) == 0)
|
if (strcmp("applist", action) == 0)
|
||||||
applist(address);
|
applist(address);
|
||||||
else if (strcmp("stream", action) == 0)
|
else if (strcmp("stream", action) == 0)
|
||||||
stream(&config, address, app);
|
stream(&config, address, app, sops);
|
||||||
else if (strcmp("pair", action) == 0)
|
else if (strcmp("pair", action) == 0)
|
||||||
client_pair(address);
|
client_pair(address);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user