mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
Inform client about failure to join because of invalid utf8
This commit is contained in:
parent
e40e1866e2
commit
0ba18cd891
|
@ -2304,12 +2304,22 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
|
||||
CNetMsg_Cl_StartInfo *pMsg = (CNetMsg_Cl_StartInfo *)pRawMsg;
|
||||
|
||||
if(!str_utf8_check(pMsg->m_pName)
|
||||
|| !str_utf8_check(pMsg->m_pClan)
|
||||
|| !str_utf8_check(pMsg->m_pSkin))
|
||||
if(!str_utf8_check(pMsg->m_pName))
|
||||
{
|
||||
Server()->Kick(ClientID, "name is not valid utf8");
|
||||
return;
|
||||
}
|
||||
if(!str_utf8_check(pMsg->m_pClan))
|
||||
{
|
||||
Server()->Kick(ClientID, "clan is not valid utf8");
|
||||
return;
|
||||
}
|
||||
if(!str_utf8_check(pMsg->m_pSkin))
|
||||
{
|
||||
Server()->Kick(ClientID, "skin is not valid utf8");
|
||||
return;
|
||||
}
|
||||
|
||||
pPlayer->m_LastChangeInfo = Server()->Tick();
|
||||
|
||||
// set start infos
|
||||
|
|
Loading…
Reference in a new issue