GameSpyThread.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. ** Command & Conquer Generals(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. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: GameSpyThread.h //////////////////////////////////////////////////////
  24. // Generals GameSpy thread class
  25. // Author: Matthew D. Campbell, March 2002
  26. #pragma once
  27. #ifndef __GAMESPYTHREAD_H__
  28. #define __GAMESPYTHREAD_H__
  29. #include "mutex.h"
  30. #include "thread.h"
  31. class GameSpyThreadClass : public ThreadClass
  32. {
  33. public:
  34. GameSpyThreadClass::GameSpyThreadClass() : ThreadClass() { m_doLogin = false; m_readStats = false; m_updateWins = false; m_updateLosses = false; m_updateLocale = false; m_showLocaleSelect = false; m_nextShellScreen.clear(); }
  35. void queueLogin(AsciiString nick, AsciiString pass, AsciiString email) { m_nick = nick; m_pass = pass; m_email = email; m_doLogin = true; }
  36. void queueReadPersistentStatsFromServer( void ) { m_readStats = true; }
  37. void queueUpdateLocale( AsciiString locale ) { m_locale = locale; m_updateLocale = true; }
  38. void queueUpdateWins ( AsciiString wins ) { m_wins = wins; m_updateWins = true; }
  39. void queueUpdateLosses( AsciiString losses ) { m_losses = losses; m_updateLosses = true; }
  40. void Thread_Function();
  41. AsciiString getNextShellScreen( void );
  42. Bool showLocaleSelect( void );
  43. void setNextShellScreen( AsciiString nextShellScreen );
  44. void setShowLocaleSelect( Bool val );
  45. private:
  46. AsciiString m_nick, m_pass, m_email;
  47. Bool m_doLogin, m_readStats, m_updateWins, m_updateLosses, m_updateLocale;
  48. AsciiString m_locale, m_wins, m_losses;
  49. AsciiString m_nextShellScreen;
  50. Bool m_showLocaleSelect;
  51. };
  52. extern GameSpyThreadClass *TheGameSpyThread;
  53. extern MutexClass TheGameSpyMutex;
  54. #endif // __GAMESPYTHREAD_H__