ClubClient.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*-------------------------------------------------------------------------
  2. client.h
  3. Per client stuff
  4. Owner:
  5. Copyright 1986-2000 Microsoft Corporation, All Rights Reserved
  6. *-----------------------------------------------------------------------*/
  7. #ifndef _CLIENT_H_
  8. #define _CLIENT_H_
  9. class CFLClient : public IObject
  10. {
  11. public:
  12. CFLClient(CFMConnection * pcnxn) :
  13. m_dwID(c_dwID),
  14. m_pcnxn(pcnxn)
  15. {
  16. assert(pcnxn);
  17. m_pcnxn->SetPrivateData((DWORD) this); // set up two-way link between connection and this
  18. }
  19. ~CFLClient()
  20. {
  21. m_pcnxn->SetPrivateData(0); // disconnect two-way link between connection and this
  22. }
  23. bool IsValidThisPtr() // this
  24. {
  25. bool fValid = this && (c_dwID == m_dwID);
  26. assert (fValid); // this should only be false if either a bug in the client, or hacked client
  27. return fValid;
  28. }
  29. static CFLClient * FromConnection(CFMConnection & cnxn)
  30. {
  31. return (CFLClient *)cnxn.GetPrivateData();
  32. }
  33. CFMConnection * GetConnection()
  34. {
  35. return m_pcnxn;
  36. }
  37. int GetZoneID()
  38. {
  39. return m_nMemberID;
  40. }
  41. void SetZoneID(int idZone)
  42. {
  43. m_nMemberID = idZone;
  44. }
  45. bool GetClubMember()
  46. {
  47. return m_fClubMember;
  48. }
  49. void SetClubMember(bool fMember)
  50. {
  51. m_fClubMember = fMember;
  52. }
  53. private:
  54. static const DWORD c_dwID;
  55. char m_szName[c_cbNameDB];
  56. CFMConnection * m_pcnxn;
  57. DWORD m_dwID;
  58. int m_nMemberID;
  59. bool m_fClubMember : 1; // if they're not a club member, they can still come in, but not do stuff
  60. };
  61. #endif