diff --git a/lang/English.ini b/lang/English.ini index 5abb8385..7109ecc3 100644 --- a/lang/English.ini +++ b/lang/English.ini @@ -27,6 +27,8 @@ LOBBY_JOIN_FAILED = "\\#ffa0a0\\Failed to join the lobby!" LOBBY_PASSWORD_INCORRECT = "\\#ffa0a0\\Entered the wrong lobby password!" COOPNET_VERSION = "\\#ffa0a0\\Your version is no longer compatible with CoopNet. Update the game!" PEER_FAILED = "\\#ffa0a0\\Failed to connect to player '@'" +UNKNOWN = "unknown" +LOBBY_HOST = "the lobby's host" [CHAT] KICKING = "Kicking '@'!" diff --git a/lib/coopnet/linux/libcoopnet.a b/lib/coopnet/linux/libcoopnet.a index 95b3b417..843ebc8b 100644 Binary files a/lib/coopnet/linux/libcoopnet.a and b/lib/coopnet/linux/libcoopnet.a differ diff --git a/src/pc/network/coopnet/coopnet.c b/src/pc/network/coopnet/coopnet.c index e7c09d81..1f3d7e89 100644 --- a/src/pc/network/coopnet/coopnet.c +++ b/src/pc/network/coopnet/coopnet.c @@ -100,11 +100,13 @@ static void coopnet_on_error(enum MPacketErrorNumber error, uint64_t tag) { { char built[256] = { 0 }; u8 localIndex = coopnet_user_id_to_local_index(tag); - if (localIndex == UNKNOWN_LOCAL_INDEX || gNetworkPlayers[localIndex].name[0] == '\0') { - snprintf(built, 256, "%s", "unknown"); - } else { - djui_language_replace(DLANG(NOTIF, IMPORT_MOD_SUCCESS), built, 256, '@', gNetworkPlayers[localIndex].name); + char* name = DLANG(NOTIF, UNKNOWN); + if (localIndex == 0) { + name = DLANG(NOTIF, LOBBY_HOST); + } else if (localIndex != UNKNOWN_LOCAL_INDEX && gNetworkPlayers[localIndex].connected) { + name = gNetworkPlayers[localIndex].name; } + djui_language_replace(DLANG(NOTIF, IMPORT_MOD_SUCCESS), built, 256, '@', name); djui_popup_create(built, 2); } break;