Guest User

Untitled

a guest
May 24th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. #import <Foundation/Foundation.h>
  2.  
  3.  
  4. @interface Server : NSObject {
  5. // Server Configuration
  6. NSString* _serverName;
  7. NSString* _serverGreeting;
  8. NSInteger _receiverPort;
  9. NSInteger _maxPlayers;
  10. NSString* _MD5Salt;
  11. NSString* _externalURL;
  12. BOOL _isPublic;
  13. BOOL _doesHeartbeat;
  14. BOOL _doesFListHeartbeat;
  15. BOOL _doesVerifyNames;
  16.  
  17. // Receiver
  18. NSFileHandle* _receiverHandle;
  19.  
  20. // RunLoop
  21. NSTimer* _heartbeatTimer;
  22. CFRunLoopSourceRef _runLoopStopSource;
  23. BOOL _shouldKeepRunning;
  24.  
  25. // Clients (hashed by uid)
  26. NSMutableDictionary* clients;
  27. NSMutableIndexSet* availablePIDs;
  28.  
  29. // Operation Queueing
  30. NSOperationQueue* _taskQueue;
  31. }
  32.  
  33. @property(copy) NSString* serverName;
  34. @property(copy) NSString* serverGreeting;
  35. @property(assign) NSInteger receiverPort;
  36. @property(assign) NSInteger maxPlayers;
  37. @property(copy) NSString* MD5Salt;
  38. @property(copy) NSString* externalURL;
  39. @property(assign) BOOL isPublic;
  40. @property(assign) BOOL doesHeartbeat;
  41. @property(assign) BOOL doesFListHeartbeat;
  42. @property(assign) BOOL doesVerifyNames;
  43.  
  44. @property(retain) NSFileHandle* receiverHandle;
  45.  
  46. @property(retain) NSTimer* heartbeatTimer;
  47. @property(assign) CFRunLoopSourceRef runLoopStopSource;
  48. @property(assign) BOOL shouldKeepRunning;
  49.  
  50. // Mutable types should
  51. // not be exposed.
  52.  
  53. @property(retain) NSOperationQueue* taskQueue;
  54.  
  55. + (Server*)sharedInstance;
  56.  
  57. -(void)start;
  58. -(void)stop;
  59. -(void)cleanup;
  60. -(void)heartbeat;
  61.  
  62. -(void)connectionWasAccepted:(NSNotification*)notification;
  63.  
  64. @end
Add Comment
Please, Sign In to add comment