mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Send result of random_unfinished_map
to all clients
This commit is contained in:
parent
3a2cecb8b4
commit
c4ff37d9d9
|
@ -1277,7 +1277,7 @@ void CGameContext::OnTick()
|
|||
if(m_SqlRandomMapResult->m_Success)
|
||||
{
|
||||
if(PlayerExists(m_SqlRandomMapResult->m_ClientId) && m_SqlRandomMapResult->m_aMessage[0] != '\0')
|
||||
SendChatTarget(m_SqlRandomMapResult->m_ClientId, m_SqlRandomMapResult->m_aMessage);
|
||||
SendChat(-1, TEAM_ALL, m_SqlRandomMapResult->m_aMessage);
|
||||
if(m_SqlRandomMapResult->m_aMap[0] != '\0')
|
||||
Server()->ChangeMap(m_SqlRandomMapResult->m_aMap);
|
||||
else
|
||||
|
|
|
@ -1560,7 +1560,8 @@ bool CScoreWorker::RandomUnfinishedMap(IDbConnection *pSqlServer, const ISqlData
|
|||
}
|
||||
else
|
||||
{
|
||||
str_copy(pResult->m_aMessage, "You have no more unfinished maps on this server!", sizeof(pResult->m_aMessage));
|
||||
str_format(aBuf, sizeof(aBuf), "%s has no more unfinished maps on this server!", pData->m_aRequestingPlayer);
|
||||
str_copy(pResult->m_aMessage, aBuf, sizeof(pResult->m_aMessage));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -580,7 +580,7 @@ TEST_P(RandomMap, UnfinishedDoesntExist)
|
|||
ASSERT_FALSE(CScoreWorker::RandomUnfinishedMap(m_pConn, &m_RandomMapRequest, m_aError, sizeof(m_aError))) << m_aError;
|
||||
EXPECT_EQ(m_pRandomMapResult->m_ClientId, 0);
|
||||
EXPECT_STREQ(m_pRandomMapResult->m_aMap, "");
|
||||
EXPECT_STREQ(m_pRandomMapResult->m_aMessage, "You have no more unfinished maps on this server!");
|
||||
EXPECT_STREQ(m_pRandomMapResult->m_aMessage, "nameless tee has no more unfinished maps on this server!");
|
||||
}
|
||||
|
||||
auto g_pSqliteConn = CreateSqliteConnection(":memory:", true);
|
||||
|
|
Loading…
Reference in a new issue