Change how discord secrets are sent

This commit is contained in:
MysterD 2023-04-15 20:05:04 -07:00
parent f2591bd5b4
commit a17841106c
2 changed files with 5 additions and 4 deletions

View File

@ -33,7 +33,7 @@ static void on_activity_join_callback(UNUSED void* data, enum EDiscordResult res
static void on_activity_join(UNUSED void* data, const char* secret) {
LOG_INFO("> on_activity_join, secret: %s", secret);
//djui_connect_menu_open();
app.lobbies->connect_lobby_with_activity_secret(app.lobbies, (char*)secret, NULL, on_activity_join_callback);
//app.lobbies->connect_lobby_with_activity_secret(app.lobbies, (char*)secret, NULL, on_activity_join_callback);
}
static void on_activity_join_request_callback(UNUSED void* data, enum EDiscordResult result) {

View File

@ -127,7 +127,8 @@ void ns_coopnet_update(void) {
LOG_INFO("Create lobby");
char mode[64] = "";
mods_get_main_mod_name(mode, 64);
coopnet_lobby_create(CN_GAME_STR, get_version(), configPlayerName, mode, (uint16_t)configAmountofPlayers, configPassword);
snprintf(gCoopNetPassword, 64, "%s", configPassword);
coopnet_lobby_create(CN_GAME_STR, get_version(), configPlayerName, mode, (uint16_t)configAmountofPlayers, gCoopNetPassword);
}
} else if (sNetworkType == NT_CLIENT) {
LOG_INFO("Join lobby");
@ -151,7 +152,7 @@ static void ns_coopnet_get_lobby_id(UNUSED char* destination, UNUSED u32 destLen
if (sLocalLobbyId == 0) {
snprintf(destination, destLength, "%s", "");
} else {
snprintf(destination, destLength, "coopnet-id:%" PRIu64 "", sLocalLobbyId);
snprintf(destination, destLength, "coopnet:%" PRIu64 "", sLocalLobbyId);
}
}
@ -159,7 +160,7 @@ static void ns_coopnet_get_lobby_secret(UNUSED char* destination, UNUSED u32 des
if (sLocalLobbyId == 0) {
snprintf(destination, destLength, "%s", "");
} else {
snprintf(destination, destLength, "coopnet-pw:%s", gCoopNetPassword);
snprintf(destination, destLength, "coopnet:%" PRIu64":%s", sLocalLobbyId, gCoopNetPassword);
}
}