diff --git a/datasrc/network.py b/datasrc/network.py index 9a2114c75..3fbf7446c 100644 --- a/datasrc/network.py +++ b/datasrc/network.py @@ -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"] diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 5074db494..79360c269 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -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); diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index 7034b3743..472770621 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -305,6 +305,8 @@ public: int m_AuthLevel; bool m_Afk; + bool m_Paused; + bool m_Spec; void UpdateRenderInfo(); void Reset(); diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 4f6ee05f3..003fe4f79 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -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()