mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Rename CHAT_SIX/SEVEN to more generic FLAG_SIX/SEVEN
This commit is contained in:
parent
54271aef2a
commit
00b9eab2ce
|
@ -546,7 +546,7 @@ void CGameContext::CallVote(int ClientId, const char *pDesc, const char *pCmd, c
|
||||||
if(!pPlayer)
|
if(!pPlayer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SendChat(-1, TEAM_ALL, pChatmsg, -1, CHAT_SIX);
|
SendChat(-1, TEAM_ALL, pChatmsg, -1, FLAG_SIX);
|
||||||
if(!pSixupDesc)
|
if(!pSixupDesc)
|
||||||
pSixupDesc = pDesc;
|
pSixupDesc = pDesc;
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ void CGameContext::CallVote(int ClientId, const char *pDesc, const char *pCmd, c
|
||||||
pPlayer->m_LastVoteCall = Now;
|
pPlayer->m_LastVoteCall = Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameContext::SendChatTarget(int To, const char *pText, int Flags) const
|
void CGameContext::SendChatTarget(int To, const char *pText, int VersionFlags) const
|
||||||
{
|
{
|
||||||
CNetMsg_Sv_Chat Msg;
|
CNetMsg_Sv_Chat Msg;
|
||||||
Msg.m_Team = 0;
|
Msg.m_Team = 0;
|
||||||
|
@ -571,8 +571,8 @@ void CGameContext::SendChatTarget(int To, const char *pText, int Flags) const
|
||||||
{
|
{
|
||||||
for(int i = 0; i < Server()->MaxClients(); i++)
|
for(int i = 0; i < Server()->MaxClients(); i++)
|
||||||
{
|
{
|
||||||
if(!((Server()->IsSixup(i) && (Flags & CHAT_SIXUP)) ||
|
if(!((Server()->IsSixup(i) && (VersionFlags & FLAG_SIXUP)) ||
|
||||||
(!Server()->IsSixup(i) && (Flags & CHAT_SIX))))
|
(!Server()->IsSixup(i) && (VersionFlags & FLAG_SIX))))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, i);
|
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, i);
|
||||||
|
@ -580,8 +580,8 @@ void CGameContext::SendChatTarget(int To, const char *pText, int Flags) const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!((Server()->IsSixup(To) && (Flags & CHAT_SIXUP)) ||
|
if(!((Server()->IsSixup(To) && (VersionFlags & FLAG_SIXUP)) ||
|
||||||
(!Server()->IsSixup(To) && (Flags & CHAT_SIX))))
|
(!Server()->IsSixup(To) && (VersionFlags & FLAG_SIX))))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, To);
|
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, To);
|
||||||
|
@ -595,7 +595,7 @@ void CGameContext::SendChatTeam(int Team, const char *pText) const
|
||||||
SendChatTarget(i, pText);
|
SendChatTarget(i, pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameContext::SendChat(int ChatterClientId, int Team, const char *pText, int SpamProtectionClientId, int Flags)
|
void CGameContext::SendChat(int ChatterClientId, int Team, const char *pText, int SpamProtectionClientId, int VersionFlags)
|
||||||
{
|
{
|
||||||
if(SpamProtectionClientId >= 0 && SpamProtectionClientId < MAX_CLIENTS)
|
if(SpamProtectionClientId >= 0 && SpamProtectionClientId < MAX_CLIENTS)
|
||||||
if(ProcessSpamProtection(SpamProtectionClientId))
|
if(ProcessSpamProtection(SpamProtectionClientId))
|
||||||
|
@ -631,8 +631,8 @@ void CGameContext::SendChat(int ChatterClientId, int Team, const char *pText, in
|
||||||
{
|
{
|
||||||
if(!m_apPlayers[i])
|
if(!m_apPlayers[i])
|
||||||
continue;
|
continue;
|
||||||
bool Send = (Server()->IsSixup(i) && (Flags & CHAT_SIXUP)) ||
|
bool Send = (Server()->IsSixup(i) && (VersionFlags & FLAG_SIXUP)) ||
|
||||||
(!Server()->IsSixup(i) && (Flags & CHAT_SIX));
|
(!Server()->IsSixup(i) && (VersionFlags & FLAG_SIX));
|
||||||
|
|
||||||
if(!m_apPlayers[i]->m_DND && Send)
|
if(!m_apPlayers[i]->m_DND && Send)
|
||||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, i);
|
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, i);
|
||||||
|
@ -1181,7 +1181,7 @@ void CGameContext::OnTick()
|
||||||
Console()->ExecuteLine(m_aVoteCommand);
|
Console()->ExecuteLine(m_aVoteCommand);
|
||||||
Server()->SetRconCid(IServer::RCON_CID_SERV);
|
Server()->SetRconCid(IServer::RCON_CID_SERV);
|
||||||
EndVote();
|
EndVote();
|
||||||
SendChat(-1, TEAM_ALL, "Vote passed", -1, CHAT_SIX);
|
SendChat(-1, TEAM_ALL, "Vote passed", -1, FLAG_SIX);
|
||||||
|
|
||||||
if(m_apPlayers[m_VoteCreator] && !IsKickVote() && !IsSpecVote())
|
if(m_apPlayers[m_VoteCreator] && !IsKickVote() && !IsSpecVote())
|
||||||
m_apPlayers[m_VoteCreator]->m_LastVoteCall = 0;
|
m_apPlayers[m_VoteCreator]->m_LastVoteCall = 0;
|
||||||
|
@ -1189,22 +1189,22 @@ void CGameContext::OnTick()
|
||||||
else if(m_VoteEnforce == VOTE_ENFORCE_YES_ADMIN)
|
else if(m_VoteEnforce == VOTE_ENFORCE_YES_ADMIN)
|
||||||
{
|
{
|
||||||
Console()->ExecuteLine(m_aVoteCommand, m_VoteEnforcer);
|
Console()->ExecuteLine(m_aVoteCommand, m_VoteEnforcer);
|
||||||
SendChat(-1, TEAM_ALL, "Vote passed enforced by authorized player", -1, CHAT_SIX);
|
SendChat(-1, TEAM_ALL, "Vote passed enforced by authorized player", -1, FLAG_SIX);
|
||||||
EndVote();
|
EndVote();
|
||||||
}
|
}
|
||||||
else if(m_VoteEnforce == VOTE_ENFORCE_NO_ADMIN)
|
else if(m_VoteEnforce == VOTE_ENFORCE_NO_ADMIN)
|
||||||
{
|
{
|
||||||
EndVote();
|
EndVote();
|
||||||
SendChat(-1, TEAM_ALL, "Vote failed enforced by authorized player", -1, CHAT_SIX);
|
SendChat(-1, TEAM_ALL, "Vote failed enforced by authorized player", -1, FLAG_SIX);
|
||||||
}
|
}
|
||||||
//else if(m_VoteEnforce == VOTE_ENFORCE_NO || time_get() > m_VoteCloseTime)
|
//else if(m_VoteEnforce == VOTE_ENFORCE_NO || time_get() > m_VoteCloseTime)
|
||||||
else if(m_VoteEnforce == VOTE_ENFORCE_NO || (time_get() > m_VoteCloseTime && g_Config.m_SvVoteMajority))
|
else if(m_VoteEnforce == VOTE_ENFORCE_NO || (time_get() > m_VoteCloseTime && g_Config.m_SvVoteMajority))
|
||||||
{
|
{
|
||||||
EndVote();
|
EndVote();
|
||||||
if(VetoStop || (m_VoteWillPass && Veto))
|
if(VetoStop || (m_VoteWillPass && Veto))
|
||||||
SendChat(-1, TEAM_ALL, "Vote failed because of veto. Find an empty server instead", -1, CHAT_SIX);
|
SendChat(-1, TEAM_ALL, "Vote failed because of veto. Find an empty server instead", -1, FLAG_SIX);
|
||||||
else
|
else
|
||||||
SendChat(-1, TEAM_ALL, "Vote failed", -1, CHAT_SIX);
|
SendChat(-1, TEAM_ALL, "Vote failed", -1, FLAG_SIX);
|
||||||
}
|
}
|
||||||
else if(m_VoteUpdate)
|
else if(m_VoteUpdate)
|
||||||
{
|
{
|
||||||
|
@ -3345,7 +3345,7 @@ void CGameContext::ConForceVote(IConsole::IResult *pResult, void *pUserData)
|
||||||
if(str_comp_nocase(pValue, pOption->m_aDescription) == 0)
|
if(str_comp_nocase(pValue, pOption->m_aDescription) == 0)
|
||||||
{
|
{
|
||||||
str_format(aBuf, sizeof(aBuf), "authorized player forced server option '%s' (%s)", pValue, pReason);
|
str_format(aBuf, sizeof(aBuf), "authorized player forced server option '%s' (%s)", pValue, pReason);
|
||||||
pSelf->SendChatTarget(-1, aBuf, CHAT_SIX);
|
pSelf->SendChatTarget(-1, aBuf, FLAG_SIX);
|
||||||
pSelf->Console()->ExecuteLine(pOption->m_aCommand);
|
pSelf->Console()->ExecuteLine(pOption->m_aCommand);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,15 +250,15 @@ public:
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
CHAT_SIX = 1 << 0,
|
FLAG_SIX = 1 << 0,
|
||||||
CHAT_SIXUP = 1 << 1,
|
FLAG_SIXUP = 1 << 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
// network
|
// network
|
||||||
void CallVote(int ClientId, const char *pDesc, const char *pCmd, const char *pReason, const char *pChatmsg, const char *pSixupDesc = 0);
|
void CallVote(int ClientId, const char *pDesc, const char *pCmd, const char *pReason, const char *pChatmsg, const char *pSixupDesc = 0);
|
||||||
void SendChatTarget(int To, const char *pText, int Flags = CHAT_SIX | CHAT_SIXUP) const;
|
void SendChatTarget(int To, const char *pText, int VersionFlags = FLAG_SIX | FLAG_SIXUP) const;
|
||||||
void SendChatTeam(int Team, const char *pText) const;
|
void SendChatTeam(int Team, const char *pText) const;
|
||||||
void SendChat(int ClientId, int Team, const char *pText, int SpamProtectionClientId = -1, int Flags = CHAT_SIX | CHAT_SIXUP);
|
void SendChat(int ClientId, int Team, const char *pText, int SpamProtectionClientId = -1, int VersionFlags = FLAG_SIX | FLAG_SIXUP);
|
||||||
void SendStartWarning(int ClientId, const char *pMessage);
|
void SendStartWarning(int ClientId, const char *pMessage);
|
||||||
void SendEmoticon(int ClientId, int Emoticon, int TargetClientId) const;
|
void SendEmoticon(int ClientId, int Emoticon, int TargetClientId) const;
|
||||||
void SendWeaponPickup(int ClientId, int Weapon) const;
|
void SendWeaponPickup(int ClientId, int Weapon) const;
|
||||||
|
|
|
@ -410,7 +410,7 @@ void IGameController::OnPlayerDisconnect(class CPlayer *pPlayer, const char *pRe
|
||||||
str_format(aBuf, sizeof(aBuf), "'%s' has left the game (%s)", Server()->ClientName(ClientId), pReason);
|
str_format(aBuf, sizeof(aBuf), "'%s' has left the game (%s)", Server()->ClientName(ClientId), pReason);
|
||||||
else
|
else
|
||||||
str_format(aBuf, sizeof(aBuf), "'%s' has left the game", Server()->ClientName(ClientId));
|
str_format(aBuf, sizeof(aBuf), "'%s' has left the game", Server()->ClientName(ClientId));
|
||||||
GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1, CGameContext::CHAT_SIX);
|
GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1, CGameContext::FLAG_SIX);
|
||||||
|
|
||||||
str_format(aBuf, sizeof(aBuf), "leave player='%d:%s'", ClientId, Server()->ClientName(ClientId));
|
str_format(aBuf, sizeof(aBuf), "leave player='%d:%s'", ClientId, Server()->ClientName(ClientId));
|
||||||
GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "game", aBuf);
|
GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "game", aBuf);
|
||||||
|
|
|
@ -127,7 +127,7 @@ void CGameControllerDDRace::OnPlayerConnect(CPlayer *pPlayer)
|
||||||
{
|
{
|
||||||
char aBuf[512];
|
char aBuf[512];
|
||||||
str_format(aBuf, sizeof(aBuf), "'%s' entered and joined the %s", Server()->ClientName(ClientId), GetTeamName(pPlayer->GetTeam()));
|
str_format(aBuf, sizeof(aBuf), "'%s' entered and joined the %s", Server()->ClientName(ClientId), GetTeamName(pPlayer->GetTeam()));
|
||||||
GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1, CGameContext::CHAT_SIX);
|
GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1, CGameContext::FLAG_SIX);
|
||||||
|
|
||||||
GameServer()->SendChatTarget(ClientId, "DDraceNetwork Mod. Version: " GAME_VERSION);
|
GameServer()->SendChatTarget(ClientId, "DDraceNetwork Mod. Version: " GAME_VERSION);
|
||||||
GameServer()->SendChatTarget(ClientId, "please visit DDNet.org or say /info and make sure to read our /rules");
|
GameServer()->SendChatTarget(ClientId, "please visit DDNet.org or say /info and make sure to read our /rules");
|
||||||
|
|
|
@ -711,9 +711,9 @@ void CGameTeams::OnFinish(CPlayer *Player, int TimeTicks, const char *pTimestamp
|
||||||
Server()->ClientName(ClientId), (int)Time / 60,
|
Server()->ClientName(ClientId), (int)Time / 60,
|
||||||
Time - ((int)Time / 60 * 60));
|
Time - ((int)Time / 60 * 60));
|
||||||
if(g_Config.m_SvHideScore || !g_Config.m_SvSaveWorseScores)
|
if(g_Config.m_SvHideScore || !g_Config.m_SvSaveWorseScores)
|
||||||
GameServer()->SendChatTarget(ClientId, aBuf, CGameContext::CHAT_SIX);
|
GameServer()->SendChatTarget(ClientId, aBuf, CGameContext::FLAG_SIX);
|
||||||
else
|
else
|
||||||
GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1., CGameContext::CHAT_SIX);
|
GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1., CGameContext::FLAG_SIX);
|
||||||
|
|
||||||
float Diff = absolute(Time - pData->m_BestTime);
|
float Diff = absolute(Time - pData->m_BestTime);
|
||||||
|
|
||||||
|
@ -730,9 +730,9 @@ void CGameTeams::OnFinish(CPlayer *Player, int TimeTicks, const char *pTimestamp
|
||||||
str_format(aBuf, sizeof(aBuf), "New record: %5.2f second(s) better.",
|
str_format(aBuf, sizeof(aBuf), "New record: %5.2f second(s) better.",
|
||||||
Diff);
|
Diff);
|
||||||
if(g_Config.m_SvHideScore || !g_Config.m_SvSaveWorseScores)
|
if(g_Config.m_SvHideScore || !g_Config.m_SvSaveWorseScores)
|
||||||
GameServer()->SendChatTarget(ClientId, aBuf, CGameContext::CHAT_SIX);
|
GameServer()->SendChatTarget(ClientId, aBuf, CGameContext::FLAG_SIX);
|
||||||
else
|
else
|
||||||
GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1, CGameContext::CHAT_SIX);
|
GameServer()->SendChat(-1, TEAM_ALL, aBuf, -1, CGameContext::FLAG_SIX);
|
||||||
}
|
}
|
||||||
else if(pData->m_BestTime != 0) // tee has already finished?
|
else if(pData->m_BestTime != 0) // tee has already finished?
|
||||||
{
|
{
|
||||||
|
@ -752,7 +752,7 @@ void CGameTeams::OnFinish(CPlayer *Player, int TimeTicks, const char *pTimestamp
|
||||||
str_format(aBuf, sizeof(aBuf),
|
str_format(aBuf, sizeof(aBuf),
|
||||||
"%5.2f second(s) worse, better luck next time.",
|
"%5.2f second(s) worse, better luck next time.",
|
||||||
Diff);
|
Diff);
|
||||||
GameServer()->SendChatTarget(ClientId, aBuf, CGameContext::CHAT_SIX); // this is private, sent only to the tee
|
GameServer()->SendChatTarget(ClientId, aBuf, CGameContext::FLAG_SIX); // this is private, sent only to the tee
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue