mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-22 07:32:07 -05:00
added --coopnet parameter (#625)
* added --coopnet parameter * bug fix * bugfix 2 * bug fix 3 * require password * removed old text * fixed indentation
This commit is contained in:
parent
357db4fa5e
commit
b75df78712
3 changed files with 14 additions and 3 deletions
|
@ -27,6 +27,7 @@ static void print_help(void) {
|
|||
printf("--skip-intro Skips the Peach and Lakitu intros when on a zero star save.\n");
|
||||
printf("--server PORT Starts the game and creates a new server on PORT.\n");
|
||||
printf("--client IP PORT Starts the game and joins an existing server.\n");
|
||||
printf("--coopnet PASSWORD Starts the game and creates a new private coopnet server with a password.\n");
|
||||
printf("--playername PLAYERNAME Starts the game with a specific playername.\n");
|
||||
printf("--playercount PLAYERCOUNT Starts the game with a specific player count limit.\n");
|
||||
printf("--skip-update-check Skips the update check when loading the game.\n");
|
||||
|
@ -90,6 +91,9 @@ bool parse_cli_opts(int argc, char* argv[]) {
|
|||
} else {
|
||||
gCLIOpts.networkPort = 7777;
|
||||
}
|
||||
} else if (!strcmp(argv[i], "--coopnet") && (i + 1) < argc && argv[i + 1][0] != '-') {
|
||||
gCLIOpts.coopnet = true;
|
||||
arg_string("--coopnet <password>", argv[++i], gCLIOpts.coopnetPassword, MAX_CONFIG_STRING);
|
||||
} else if (!strcmp(argv[i], "--playername") && (i + 1) < argc) {
|
||||
arg_string("--playername <playername>", argv[++i], gCLIOpts.playerName, MAX_CONFIG_STRING);
|
||||
} else if (!strcmp(argv[i], "--playercount") && (i + 1) < argc) {
|
||||
|
|
|
@ -31,6 +31,8 @@ struct CLIOptions {
|
|||
bool hideLoadingScreen;
|
||||
bool skipUpdateCheck;
|
||||
bool noDiscord;
|
||||
bool coopnet;
|
||||
char coopnetPassword[MAX_CONFIG_STRING];
|
||||
bool disableMods;
|
||||
int enabledModsCount;
|
||||
char** enableMods;
|
||||
|
|
|
@ -511,9 +511,14 @@ int main(int argc, char *argv[]) {
|
|||
snprintf(configJoinIp, MAX_CONFIG_STRING, "%s", gCLIOpts.joinIp);
|
||||
configJoinPort = gCLIOpts.networkPort;
|
||||
network_init(NT_CLIENT, false);
|
||||
} else if (gCLIOpts.network == NT_SERVER) {
|
||||
configNetworkSystem = NS_SOCKET;
|
||||
configHostPort = gCLIOpts.networkPort;
|
||||
} else if (gCLIOpts.network == NT_SERVER || gCLIOpts.coopnet == true) {
|
||||
if (gCLIOpts.network == NT_SERVER) {
|
||||
configNetworkSystem = NS_SOCKET;
|
||||
configHostPort = gCLIOpts.networkPort;
|
||||
} else {
|
||||
configNetworkSystem = NS_COOPNET;
|
||||
snprintf(configPassword, MAX_CONFIG_STRING, "%s", gCLIOpts.coopnetPassword);
|
||||
}
|
||||
|
||||
// horrible, hacky fix for mods that access marioObj straight away
|
||||
// best fix: host with the standard main menu method
|
||||
|
|
Loading…
Reference in a new issue