1859: Move the afk flag up front r=heinrich5991 a=Learath2



Co-authored-by: Learath <learath2@gmail.com>
This commit is contained in:
bors[bot] 2019-07-29 11:49:36 +00:00
commit 29e691c2db
3 changed files with 5 additions and 3 deletions

View file

@ -1,7 +1,7 @@
from datatypes import *
Emotes = ["NORMAL", "PAIN", "HAPPY", "SURPRISE", "ANGRY", "BLINK"]
PlayerFlags = ["PLAYING", "IN_MENU", "CHATTING", "SCOREBOARD", "AIM", "AFK"]
PlayerFlags = ["PLAYING", "IN_MENU", "CHATTING", "SCOREBOARD", "AIM"]
GameFlags = ["TEAMS", "FLAGS"]
GameStateFlags = ["GAMEOVER", "SUDDENDEATH", "PAUSED", "RACETIME"]
CharacterFlags = ["SOLO", "JETPACK", "NO_COLLISION", "ENDLESS_HOOK", "ENDLESS_JUMP", "SUPER",
@ -19,6 +19,7 @@ GameInfoFlags = [
"ENTITIES_DDNET", "ENTITIES_DDRACE", "ENTITIES_RACE", "ENTITIES_FNG",
"ENTITIES_VANILLA",
]
ExPlayerFlags = ["AFK"]
Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"]
@ -73,6 +74,7 @@ Flags = [
Flags("GAMESTATEFLAG", GameStateFlags),
Flags("CHARACTERFLAG", CharacterFlags),
Flags("GAMEINFOFLAG", GameInfoFlags),
Flags("EXPLAYERFLAG", ExPlayerFlags),
]
Objects = [

View file

@ -1194,7 +1194,7 @@ 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 & PLAYERFLAG_AFK;
m_aClients[Item.m_ID].m_Afk = pInfo->m_Flags & EXPLAYERFLAG_AFK;
}
else if(Item.m_Type == NETOBJTYPE_CHARACTER)
{

View file

@ -324,7 +324,7 @@ void CPlayer::Snap(int SnappingClient)
return;
pDDNetPlayer->m_AuthLevel = Server()->GetAuthedState(id);
pDDNetPlayer->m_Flags = m_Afk ? PLAYERFLAG_AFK : 0;
pDDNetPlayer->m_Flags = m_Afk ? EXPLAYERFLAG_AFK : 0;
}
void CPlayer::FakeSnap()