mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Update lobby info on rehost
This commit is contained in:
parent
0cf453f347
commit
5337f206f0
3 changed files with 5 additions and 3 deletions
|
|
@ -50,6 +50,7 @@ CoopNetRc coopnet_begin(const char* aHost, uint32_t aPort);
|
||||||
CoopNetRc coopnet_shutdown(void);
|
CoopNetRc coopnet_shutdown(void);
|
||||||
CoopNetRc coopnet_update(void);
|
CoopNetRc coopnet_update(void);
|
||||||
CoopNetRc coopnet_lobby_create(const char* aGame, const char* aVersion, const char* aHostName, const char* aMode, uint16_t aMaxConnections, const char* aPassword);
|
CoopNetRc coopnet_lobby_create(const char* aGame, const char* aVersion, const char* aHostName, const char* aMode, uint16_t aMaxConnections, const char* aPassword);
|
||||||
|
CoopNetRc coopnet_lobby_update(uint64_t aLobbyId, const char* aGame, const char* aVersion, const char* aHostName, const char* aMode);
|
||||||
CoopNetRc coopnet_lobby_join(uint64_t aLobbyId, const char* aPassword);
|
CoopNetRc coopnet_lobby_join(uint64_t aLobbyId, const char* aPassword);
|
||||||
CoopNetRc coopnet_lobby_leave(uint64_t aLobbyId);
|
CoopNetRc coopnet_lobby_leave(uint64_t aLobbyId);
|
||||||
CoopNetRc coopnet_lobby_list_get(const char* aGame, const char* aPassword);
|
CoopNetRc coopnet_lobby_list_get(const char* aGame, const char* aPassword);
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -145,12 +145,13 @@ void ns_coopnet_update(void) {
|
||||||
coopnet_update();
|
coopnet_update();
|
||||||
if (gNetworkType != NT_NONE && sNetworkType != NT_NONE) {
|
if (gNetworkType != NT_NONE && sNetworkType != NT_NONE) {
|
||||||
if (sNetworkType == NT_SERVER) {
|
if (sNetworkType == NT_SERVER) {
|
||||||
if (sReconnecting) {
|
|
||||||
// TODO: send lobby update packet
|
|
||||||
} else {
|
|
||||||
LOG_INFO("Create lobby");
|
|
||||||
char mode[64] = "";
|
char mode[64] = "";
|
||||||
mods_get_main_mod_name(mode, 64);
|
mods_get_main_mod_name(mode, 64);
|
||||||
|
if (sReconnecting) {
|
||||||
|
LOG_INFO("Update lobby");
|
||||||
|
coopnet_lobby_update(sLocalLobbyId, CN_GAME_STR, get_version(), configPlayerName, mode);
|
||||||
|
} else {
|
||||||
|
LOG_INFO("Create lobby");
|
||||||
snprintf(gCoopNetPassword, 64, "%s", configPassword);
|
snprintf(gCoopNetPassword, 64, "%s", configPassword);
|
||||||
coopnet_lobby_create(CN_GAME_STR, get_version(), configPlayerName, mode, (uint16_t)configAmountofPlayers, gCoopNetPassword);
|
coopnet_lobby_create(CN_GAME_STR, get_version(), configPlayerName, mode, (uint16_t)configAmountofPlayers, gCoopNetPassword);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue