1878: Add paused and spec to explayerflags r=Learath2 a=Ryozuki

I think client should know about this, maybe we can do something with it in the future.

It also may help with https://github.com/ddnet/ddnet/issues/259 but i didn't figure out yet a way to fix it.

1903: Consistent spacing for getters and setters r=Learath2 a=ChillerDragon



Co-authored-by: Ryozuki <ryo@ryozuki.xyz>
Co-authored-by: ChillerDragon <chillerdragon@gmail.com>
This commit is contained in:
bors[bot] 2019-09-15 13:41:19 +00:00 committed by GitHub
commit 0c34b6eb55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 13 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

@ -434,7 +434,7 @@ public:
bool EditorHasUnsavedData() { return m_pEditor->HasUnsavedData(); }
virtual IFriends* Foes() {return &m_Foes; }
virtual IFriends* Foes() { return &m_Foes; }
void GetSmoothTick(int *pSmoothTick, float *pSmoothIntraTick, float MixAmount);
};

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

@ -126,11 +126,11 @@ public:
// Setters/Getters because i don't want to modify vanilla vars access modifiers
int GetLastWeapon() { return m_LastWeapon; };
void SetLastWeapon(int LastWeap) {m_LastWeapon = LastWeap; };
void SetLastWeapon(int LastWeap) { m_LastWeapon = LastWeap; };
int GetActiveWeapon() { return m_Core.m_ActiveWeapon; };
void SetActiveWeapon(int ActiveWeap) {m_Core.m_ActiveWeapon = ActiveWeap; };
void SetActiveWeapon(int ActiveWeap) { m_Core.m_ActiveWeapon = ActiveWeap; };
CCharacterCore GetCore() { return m_Core; };
void SetCore(CCharacterCore Core) {m_Core = Core; };
void SetCore(CCharacterCore Core) { m_Core = Core; };
CCharacterCore* Core() { return &m_Core; };
bool GetWeaponGot(int Type) { return m_aWeapons[Type].m_Got; };
void SetWeaponGot(int Type, bool Value) { m_aWeapons[Type].m_Got = Value; };

View file

@ -83,7 +83,7 @@ public:
void Rescue();
int NeededFaketuning() {return m_NeededFaketuning;}
int NeededFaketuning() { return m_NeededFaketuning;}
bool IsAlive() const { return m_Alive; }
bool IsPaused() const { return m_Paused; }
class CPlayer *GetPlayer() { return m_pPlayer; }
@ -259,14 +259,14 @@ public:
// Setters/Getters because i don't want to modify vanilla vars access modifiers
int GetLastWeapon() { return m_LastWeapon; };
void SetLastWeapon(int LastWeap) {m_LastWeapon = LastWeap; };
void SetLastWeapon(int LastWeap) { m_LastWeapon = LastWeap; };
int GetActiveWeapon() { return m_Core.m_ActiveWeapon; };
void SetActiveWeapon(int ActiveWeap) {m_Core.m_ActiveWeapon = ActiveWeap; };
void SetLastAction(int LastAction) {m_LastAction = LastAction; };
void SetActiveWeapon(int ActiveWeap) { m_Core.m_ActiveWeapon = ActiveWeap; };
void SetLastAction(int LastAction) { m_LastAction = LastAction; };
int GetArmor() { return m_Armor; };
void SetArmor(int Armor) {m_Armor = Armor; };
void SetArmor(int Armor) { m_Armor = Armor; };
CCharacterCore GetCore() { return m_Core; };
void SetCore(CCharacterCore Core) {m_Core = Core; };
void SetCore(CCharacterCore Core) { m_Core = Core; };
CCharacterCore* Core() { return &m_Core; };
bool GetWeaponGot(int Type) { return m_aWeapons[Type].m_Got; };
void SetWeaponGot(int Type, bool Value) { m_aWeapons[Type].m_Got = Value; };

View file

@ -322,7 +322,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()

View file

@ -94,7 +94,7 @@ public:
CSaveTeam(IGameController* Controller);
~CSaveTeam();
char* GetString();
int GetMembersCount() {return m_MembersCount;}
int GetMembersCount() { return m_MembersCount; }
int LoadString(const char* String);
int save(int Team);
int load(int Team);