diff --git a/src/multiopt.cpp b/src/multiopt.cpp index 023f47d4bd8..3a0cd90e898 100644 --- a/src/multiopt.cpp +++ b/src/multiopt.cpp @@ -534,6 +534,8 @@ bool hostCampaign(const char *SessionName, char *hostPlayerName, bool spectatorH setMultiStats(selectedPlayer, playerStats, true); lookupRatingAsync(selectedPlayer); + multiStatsSetVerifiedHostIdentityFromJoin(playerStats.identity.toBytes(EcKey::Public)); + ActivityManager::instance().updateMultiplayGameData(game, ingame, NETGameIsLocked()); return true; } diff --git a/src/multistat.cpp b/src/multistat.cpp index a693abf3f4f..fe0c268393e 100644 --- a/src/multistat.cpp +++ b/src/multistat.cpp @@ -713,6 +713,12 @@ void multiStatsSetVerifiedIdentityFromJoin(uint32_t playerIndex, const EcKey::Ke } } +void multiStatsSetVerifiedHostIdentityFromJoin(const EcKey::Key &identity) +{ + ASSERT_OR_RETURN(, NetPlay.isHost || NetPlay.isHostAlive, "Unexpected state when called"); + hostVerifiedJoinIdentities[NetPlay.hostPlayer].fromBytes(identity, EcKey::Public); +} + // //////////////////////////////////////////////////////////////////////////// // Load Player Stats diff --git a/src/multistat.h b/src/multistat.h index d3aeadb0929..179cca1d647 100644 --- a/src/multistat.h +++ b/src/multistat.h @@ -112,6 +112,7 @@ bool recvMultiStats(NETQUEUE queue); void lookupRatingAsync(uint32_t playerIndex); void multiStatsSetVerifiedIdentityFromJoin(uint32_t playerIndex, const EcKey::Key &identity); +void multiStatsSetVerifiedHostIdentityFromJoin(const EcKey::Key &identity); bool swapPlayerMultiStatsLocal(uint32_t playerIndexA, uint32_t playerIndexB); diff --git a/src/screens/joiningscreen.cpp b/src/screens/joiningscreen.cpp index 3a3528fa43d..75bda9e379d 100644 --- a/src/screens/joiningscreen.cpp +++ b/src/screens/joiningscreen.cpp @@ -1545,6 +1545,11 @@ void WzJoiningGameScreen_HandlerRoot::processJoining() // tmpJoiningQueuePair is now "owned" by NetPlay.hostPlayer's netQueue - do not delete it here! tmpJoiningQueuePair = nullptr; + if ((game.blindMode == BLIND_MODE::NONE) || (NetPlay.hostPlayer >= MAX_PLAYER_SLOTS)) + { + multiStatsSetVerifiedHostIdentityFromJoin(hostIdentity.toBytes(EcKey::Public)); + } + handleSuccess(); return; }