net_find.hh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /********************************************************************** <BR>
  2. This file is part of Crack dot Com's free source code release of
  3. Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
  4. information about compiling & licensing issues visit this URL</a>
  5. <PRE> If that doesn't help, contact Jonathan Clark at
  6. golgotha_source@usa.net (Subject should have "GOLG" in it)
  7. ***********************************************************************/
  8. #ifndef I4_NET_FIND_HH
  9. #define I4_NET_FIND_HH
  10. #include "string/string.hh"
  11. class i4_net_address;
  12. /*
  13. This class responds to 'search' packets. When other games are looking for
  14. a server they should have some way of finding the notifier socket.
  15. */
  16. class i4_notifier_socket
  17. {
  18. public:
  19. virtual int poll() = 0; // returns # of clients notified (this number may be inaccurate)
  20. virtual ~i4_notifier_socket() { ; }
  21. };
  22. class i4_finder_socket
  23. {
  24. public:
  25. struct server
  26. {
  27. i4_str *notification_string;
  28. i4_net_address *addr;
  29. };
  30. virtual i4_bool poll() = 0; // returns true if list changed
  31. virtual int total_servers() = 0;
  32. virtual void get_server(int num, server &s) = 0;
  33. virtual ~i4_finder_socket() { ; }
  34. };
  35. #endif