add paused and spec to explayerflags

This commit is contained in:
Ryozuki 2019-08-02 18:16:58 +02:00
parent 968b5c1fed
commit e112cf6791
No known key found for this signature in database
GPG key ID: 848FCC08E5B89681
4 changed files with 14 additions and 2 deletions

View file

@ -19,7 +19,7 @@ GameInfoFlags = [
"ENTITIES_DDNET", "ENTITIES_DDRACE", "ENTITIES_RACE", "ENTITIES_FNG",
"ENTITIES_VANILLA", "DONT_MASK_ENTITIES",
]
ExPlayerFlags = ["AFK"]
ExPlayerFlags = ["AFK", "PAUSED", "SPEC"]
Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"]

View file

@ -1197,6 +1197,8 @@ void CGameClient::OnNewSnapshot()
const CNetObj_DDNetPlayer *pInfo = (const CNetObj_DDNetPlayer *)pData;
m_aClients[Item.m_ID].m_AuthLevel = pInfo->m_AuthLevel;
m_aClients[Item.m_ID].m_Afk = pInfo->m_Flags & EXPLAYERFLAG_AFK;
m_aClients[Item.m_ID].m_Paused = pInfo->m_Flags & EXPLAYERFLAG_PAUSED;
m_aClients[Item.m_ID].m_Spec = pInfo->m_Flags & EXPLAYERFLAG_SPEC;
}
else if(Item.m_Type == NETOBJTYPE_CHARACTER)
{
@ -1768,6 +1770,8 @@ void CGameClient::CClientData::Reset()
m_Foe = false;
m_AuthLevel = AUTHED_NO;
m_Afk = false;
m_Paused = false;
m_Spec = false;
m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(0)->m_ColorTexture;
m_SkinInfo.m_ColorBody = ColorRGBA(1,1,1);
m_SkinInfo.m_ColorFeet = ColorRGBA(1,1,1);

View file

@ -305,6 +305,8 @@ public:
int m_AuthLevel;
bool m_Afk;
bool m_Paused;
bool m_Spec;
void UpdateRenderInfo();
void Reset();

View file

@ -324,7 +324,13 @@ void CPlayer::Snap(int SnappingClient)
return;
pDDNetPlayer->m_AuthLevel = Server()->GetAuthedState(id);
pDDNetPlayer->m_Flags = m_Afk ? EXPLAYERFLAG_AFK : 0;
pDDNetPlayer->m_Flags = 0;
if(m_Afk)
pDDNetPlayer->m_Flags |= EXPLAYERFLAG_AFK;
if(m_Paused == PAUSE_SPEC)
pDDNetPlayer->m_Flags |= EXPLAYERFLAG_SPEC;
if(m_Paused == PAUSE_PAUSED)
pDDNetPlayer->m_Flags |= EXPLAYERFLAG_PAUSED;
}
void CPlayer::FakeSnap()