Ignore enable-pro with no license key. makes it easier to launch a demo from the open source version

Former-commit-id: 31ab6bcd6f39f0a4a9e50a5af613b293eecfb4c2
This commit is contained in:
John Sully 2019-12-17 23:40:59 -05:00
parent 21a9a19f9d
commit 4eaed7ef34

View File

@ -841,12 +841,15 @@ void loadServerConfigFromString(char *config) {
} else if (!strcasecmp(argv[0],"storage-provider") && argc >= 2) {
if (!initializeStorageProvider(argv+1, argc-1, &err))
goto loaderr;
} else if (!strcasecmp(argv[0],"enable-pro") && argc == 2) {
if (!FValidKey(argv[1], strlen(argv[1]))) {
err = "Invalid license key";
goto loaderr;
} else if (!strcasecmp(argv[0],"enable-pro") && (argc == 1 || argc == 2)) {
if (argc == 2)
{
if (!FValidKey(argv[1], strlen(argv[1]))) {
err = "Invalid license key";
goto loaderr;
}
cserver.license_key = zstrdup(argv[1]);
}
cserver.license_key = zstrdup(argv[1]);
} else {
err = "Bad directive or wrong number of arguments"; goto loaderr;
}