mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Reverse Translation for DDRace64
This commit is contained in:
parent
be213e72d3
commit
08eb38230f
|
@ -1042,6 +1042,9 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
}
|
||||
|
||||
int KickID = str_toint(pMsg->m_Value);
|
||||
if (!Server()->ReverseTranslate(KickID, ClientID))
|
||||
return;
|
||||
|
||||
if(KickID < 0 || KickID >= MAX_CLIENTS || !m_apPlayers[KickID])
|
||||
{
|
||||
SendChatTarget(ClientID, "Invalid client id to kick");
|
||||
|
@ -1093,6 +1096,9 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
}
|
||||
|
||||
int SpectateID = str_toint(pMsg->m_Value);
|
||||
if (!Server()->ReverseTranslate(SpectateID, ClientID))
|
||||
return;
|
||||
|
||||
if(SpectateID < 0 || SpectateID >= MAX_CLIENTS || !m_apPlayers[SpectateID] || m_apPlayers[SpectateID]->GetTeam() == TEAM_SPECTATORS)
|
||||
{
|
||||
SendChatTarget(ClientID, "Invalid client id to move");
|
||||
|
@ -1239,6 +1245,10 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, -1);
|
||||
}
|
||||
}
|
||||
else if (MsgID == NETMSGTYPE_CL_ISDDRACE64)
|
||||
{
|
||||
Server()->SetCustClt(ClientID);
|
||||
}
|
||||
else if (MsgID == NETMSGTYPE_CL_SHOWOTHERS)
|
||||
{
|
||||
if(g_Config.m_SvShowOthers && !g_Config.m_SvShowOthersDefault)
|
||||
|
@ -1251,6 +1261,10 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
{
|
||||
CNetMsg_Cl_SetSpectatorMode *pMsg = (CNetMsg_Cl_SetSpectatorMode *)pRawMsg;
|
||||
|
||||
if(pMsg->m_SpectatorID != SPEC_FREEVIEW)
|
||||
if (!Server()->ReverseTranslate(pMsg->m_SpectatorID, ClientID))
|
||||
return;
|
||||
|
||||
if((pPlayer->GetTeam() != TEAM_SPECTATORS && !pPlayer->m_Paused) || pPlayer->m_SpectatorID == pMsg->m_SpectatorID || ClientID == pMsg->m_SpectatorID ||
|
||||
(g_Config.m_SvSpamprotection && pPlayer->m_LastSetSpectatorMode && pPlayer->m_LastSetSpectatorMode+Server()->TickSpeed() > Server()->Tick()))
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue