MCPcopy Create free account
hub / github.com/ddnet/ddnet / SendChatTarget

Method SendChatTarget

src/game/server/gamecontext.cpp:599–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599void CGameContext::SendChatTarget(int To, const char *pText, int VersionFlags) const
600{
601 CNetMsg_Sv_Chat Msg;
602 Msg.m_Team = 0;
603 Msg.m_ClientId = -1;
604 Msg.m_pMessage = pText;
605
606 if(g_Config.m_SvDemoChat)
607 Server()->SendPackMsg(&Msg, MSGFLAG_NOSEND, SERVER_DEMO_CLIENT);
608
609 if(To == -1)
610 {
611 for(int i = 0; i < Server()->MaxClients(); i++)
612 {
613 if(!((Server()->IsSixup(i) && (VersionFlags & FLAG_SIXUP)) ||
614 (!Server()->IsSixup(i) && (VersionFlags & FLAG_SIX))))
615 continue;
616
617 Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, i);
618 }
619 }
620 else
621 {
622 if(!((Server()->IsSixup(To) && (VersionFlags & FLAG_SIXUP)) ||
623 (!Server()->IsSixup(To) && (VersionFlags & FLAG_SIX))))
624 return;
625
626 Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, To);
627 }
628}
629
630void CGameContext::SendChatTeam(int Team, const char *pText) const
631{

Callers 15

ConModerateMethod · 0.80
OnCharacterStartMethod · 0.80
OnFinishMethod · 0.80
RequestTeamSwapMethod · 0.80
SwapTeamCharactersMethod · 0.80
CancelTeamSwapMethod · 0.80
ProcessSaveTeamMethod · 0.80
ConMapInfoMethod · 0.80
ConPracticeCmdListMethod · 0.80
ConSaveMethod · 0.80
ConLoadMethod · 0.80
ConInviteMethod · 0.80

Calls 4

ServerClass · 0.50
SendPackMsgMethod · 0.45
MaxClientsMethod · 0.45
IsSixupMethod · 0.45

Tested by

no test coverage detected