Disable /show_others (for DDRace-Client instead use menu). Fix sending all teams information to new joiners

This commit is contained in:
btd 2010-09-14 15:38:46 +04:00
parent 83e384892c
commit 0221f68d35
5 changed files with 20 additions and 5 deletions

View file

@ -89,6 +89,10 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
m_Alive = true;
if(m_pPlayer->m_RconFreeze) Freeze(-1);
GameServer()->m_pController->OnCharacterSpawn(this);
if(GetPlayer()->m_IsUsingRaceClient) {
Teams()->SendAllInfo(GetPlayer()->GetCID());
}
return true;
}

View file

@ -850,6 +850,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
else
Score()->ShowRank(p->GetCID(), Server()->ClientName(ClientId));
}
/* disable it for vanilla clients
else if(!str_comp(pMsg->m_pMessage, "/show_others"))
{
if(!g_Config.m_SvShowOthers && !Server()->IsAuthed(ClientId)) {
@ -860,7 +861,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
SendChatTarget(ClientId, "Please use the settings to switch this option.");
else
p->m_ShowOthers = !p->m_ShowOthers;
}
}*/
else if (!str_comp_nocase(pMsg->m_pMessage, "/time") && g_Config.m_SvEmotionalTees)
{

View file

@ -32,10 +32,7 @@ CPlayer::CPlayer(CGameContext *pGameServer, int CID, int Team)
m_PauseInfo.m_Respawn = false;
if(!g_Config.m_SvShowOthers)
m_ShowOthers = false;
else
m_ShowOthers = true;
m_ShowOthers = false;
m_IsUsingRaceClient = false;
m_LastSentTime = 0;

View file

@ -120,3 +120,14 @@ int CGameTeams::TeamMask(int Team) {
}
return Mask;
}
void CGameTeams::SendAllInfo(int Cid) {
for(int i = 0; i < MAX_CLIENTS; ++i) {
if(m_Core.Team(i) != 0) {
CNetMsg_Sv_PlayerTeam Msg;
Msg.m_Team = m_Core.Team(i);
Msg.m_Cid = i;
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, Cid);
}
}
}

View file

@ -39,6 +39,8 @@ public:
bool TeamFinished(int Team);
int TeamMask(int Team);
void SendAllInfo(int Cid);
};
#endif