123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- /*-------------------------------------------------------------------------
- mission.h
-
- Per mission stuff on lobby side
-
- Owner:
-
- Copyright 1986-2000 Microsoft Corporation, All Rights Reserved
- *-----------------------------------------------------------------------*/
- #ifndef _MISSION_H_
- #define _MISSION_H_
- class CFLServer;
- class CFLClient;
- class CFLMission : public IObject
- {
- public:
- CFLMission(CFLServer * pServer, CFLClient * pClientCreator);
- ~CFLMission();
- bool IsValidThisPtr() // this
- {
- bool fValid = this &&
- !IsBadReadPtr(this, sizeof(*this)) &&
- IMPLIES(m_plmi, (!IsBadReadPtr(m_plmi, sizeof(m_plmi)) && !IsBadReadPtr(m_plmi, sizeof(m_plmi->cbmsg)))) &&
- (c_dwID == m_dwID);
- // this should only be false if a hacked client or timing issue
- return fValid;
- }
- DWORD GetCookie()
- {
- return (DWORD) this;
- }
- FMD_LS_LOBBYMISSIONINFO * GetMissionInfo()
- {
- return m_plmi;
- }
- CFLServer * GetServer()
- {
- return m_pServer;
- }
- void SetLobbyInfo(FMD_LS_LOBBYMISSIONINFO * plmi);
- int GetPlayerCount()
- {
- return m_cPlayers;
- }
- void AddPlayer();
- void RemovePlayer();
- CFLClient * GetCreator()
- {
- return m_pClientCreator;
- }
- void NotifyCreator();
- static CFLMission * FromCookie(DWORD dwCookie)
- {
- CFLMission * pMission = (CFLMission*) dwCookie;
- if (pMission->IsValidThisPtr())
- return pMission;
- else
- return NULL;
- }
-
-
- private:
- static const DWORD c_dwID;
- FMD_LS_LOBBYMISSIONINFO * m_plmi;
- CFLServer * m_pServer;
- CFLClient * m_pClientCreator; // to notify them when the game is ready to go
- bool m_fNotifiedCreator;
- DWORD m_dwID;
- int m_cPlayers;
- };
- typedef TList<CFLMission*> MissionList;
- #endif
|