Do more Discord API cleanup on network shutdown
This commit is contained in:
parent
91988cc426
commit
2c9f42abd6
|
@ -76,8 +76,9 @@ void discord_network_init(int64_t lobbyId) {
|
|||
}
|
||||
|
||||
void discord_network_shutdown(void) {
|
||||
app.lobbies->flush_network(app.lobbies);
|
||||
if (gCurLobbyId == 0) { return; }
|
||||
app.lobbies->flush_network(app.lobbies);
|
||||
app.lobbies->disconnect_network(app.lobbies, gCurLobbyId);
|
||||
app.lobbies->flush_network(app.lobbies);
|
||||
LOGFILE_INFO(LFT_DISCORD, "shutdown network, lobby = " DISCORD_ID_FORMAT, gCurLobbyId);
|
||||
}
|
|
@ -115,6 +115,13 @@ void discord_lobby_leave(void) {
|
|||
|
||||
LOGFILE_INFO(LFT_DISCORD, "left lobby " DISCORD_ID_FORMAT, gCurLobbyId);
|
||||
|
||||
if (snprintf(gCurActivity.party.id, 128, "%s", "none") < 0) {
|
||||
LOGFILE_ERROR(LFT_DISCORD, "Truncating party id");
|
||||
}
|
||||
gCurActivity.party.size.current_size = 1;
|
||||
gCurActivity.party.size.max_size = 1;
|
||||
discord_activity_update(gNetworkType == NT_SERVER);
|
||||
|
||||
isHosting = false;
|
||||
gCurLobbyId = 0;
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ bool network_init(enum NetworkType inNetworkType) {
|
|||
return false;
|
||||
}
|
||||
|
||||
network_forget_all_reliable();
|
||||
crash_handler_init();
|
||||
|
||||
// set server settings
|
||||
|
|
Loading…
Reference in New Issue