ReplicaNet and RNLobby  1
BackendClient.h
1 /* START_LICENSE_HEADER
2 
3 Copyright (C) 2000 Martin Piper, original design and program code
4 Copyright (C) 2001 Replica Software
5 
6 This program file is copyright (C) Replica Software and can only be used under license.
7 For more information visit: http://www.replicanet.com/
8 Or email: info@replicanet.com
9 
10 END_LICENSE_HEADER */
11 #include "RNPlatform/Inc/MemoryTracking.h"
12 #ifndef _BACKENDCLIENT_H_
13 #define _BACKENDCLIENT_H_
14 #include "RNPlatform/Inc/Encryption.h"
15 #include "RNPlatform/Inc/ThreadClass.h"
16 #include "RNPlatform/Inc/Thread.h"
17 #include "RNXPSockets/Inc/XPSockets.h"
18 #include "RNLobby/Inc/BackendServer.h"
19 
20 namespace RNReplicaNet
21 {
22 
23 namespace RNLobby
24 {
25 
32 class BackendClient : public BaseServer
33 {
34 public:
35  BackendClient();
36  virtual ~BackendClient();
37 
41  bool Start(const int titleID,const char *encryptionKey);
42 
45  bool GetCompleted(void);
46 
49  BackendServer::Reply GetReply(void) const;
50 
51  virtual void CallbackCompleted(void) {}
52 
54  virtual bool CallbackServerAddress(XPAddress &address);
55 
58  static void DisableValidateOrderingCheck(void);
59 
61  static bool IsAuthenticated(void);
62 
65  void UseReleaseServers(const bool use = false);
66 
67 private:
68  bool CallbackParseValidMessage(DynamicMessageHelper &message,const size_t length,const XPAddress &address);
69 
70  void CleanQuery(void);
71 
72  bool CallbackPoll(void);
73 
74  BackendServer::Reply mReply;
75  int mTitleID;
76  std::string mEncryptionKey;
77 
78  XPAddress mAddress;
79 
80  SysTimeType mLastSentTime;
81  int mTries;
82  bool mAddressGot;
83 
84  bool mUseReleaseServers;
85 };
86 
87 } // namespace RNLobby
88 
89 } // namespace RNReplicaNet
90 
91 #endif
BackendServer::Reply GetReply(void) const
virtual bool CallbackServerAddress(XPAddress &address)
Definition: XPSocket.h:91
static bool IsAuthenticated(void)
When the BackendClient has successfully completed an authentication request this returns true...
void UseReleaseServers(const bool use=false)
static void DisableValidateOrderingCheck(void)
Definition: BackendClient.h:32
Definition: MessageHelper.h:211
bool Start(const int titleID, const char *encryptionKey)
A server base class that handles encrypted messages to and from a socket.
Definition: BaseServer.h:24