WOLNetUtilObserver.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * $Archive: /Commando/Code/WWOnline/WOLNetUtilObserver.h $
  22. *
  23. * DESCRIPTION
  24. *
  25. * PROGRAMMER
  26. * $Author: Denzil_l $
  27. *
  28. * VERSION INFO
  29. * $Revision: 4 $
  30. * $Modtime: 1/22/02 5:53p $
  31. *
  32. ******************************************************************************/
  33. #ifndef __WOLNETUTILOBSERVER_H__
  34. #define __WOLNETUTILOBSERVER_H__
  35. #include <windows.h>
  36. #include "WOLUser.h"
  37. namespace WOL
  38. {
  39. #include <WOLAPI\wolapi.h>
  40. }
  41. template<typename T> class RefPtr;
  42. namespace WWOnline {
  43. class Session;
  44. class SquadData;
  45. class NetUtilObserver :
  46. public WOL::INetUtilEvent
  47. {
  48. public:
  49. NetUtilObserver();
  50. void Init(Session& outer);
  51. //---------------------------------------------------------------------------
  52. // IUnknown methods
  53. //---------------------------------------------------------------------------
  54. virtual HRESULT STDMETHODCALLTYPE QueryInterface(const IID& iid, void** ppv);
  55. virtual ULONG STDMETHODCALLTYPE AddRef(void);
  56. virtual ULONG STDMETHODCALLTYPE Release(void);
  57. //---------------------------------------------------------------------------
  58. // INetUtilEvent Methods
  59. //---------------------------------------------------------------------------
  60. STDMETHOD(OnPing)(HRESULT hr, int time, unsigned long ip, int handle);
  61. STDMETHOD(OnLadderList)(HRESULT hr, WOL::Ladder* list, int count, long time, int keyRung);
  62. STDMETHOD(OnGameresSent)(HRESULT hr);
  63. STDMETHOD(OnNewNick)(HRESULT hr, LPCSTR message, LPCSTR nick, LPCSTR pass);
  64. STDMETHOD(OnAgeCheck)(HRESULT hr, int years, int consent);
  65. STDMETHOD(OnWDTState)(HRESULT hr, unsigned char* state, int length);
  66. STDMETHOD(OnHighscore)(HRESULT hr, WOL::Highscore* list, int count, long time, int keyRung);
  67. protected:
  68. virtual ~NetUtilObserver();
  69. NetUtilObserver(const NetUtilObserver&);
  70. const NetUtilObserver& operator=(const NetUtilObserver&);
  71. void ProcessLadderListResults(WOL::Ladder* list, long timeStamp);
  72. void NotifyClanLadderUpdate(const UserList& users, const RefPtr<SquadData>& squad);
  73. private:
  74. ULONG mRefCount;
  75. Session* mOuter;
  76. };
  77. }
  78. #endif // _WOLNETUTILOBSERVER_H__