00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _BACKENDCLIENT_H_
00012 #define _BACKENDCLIENT_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include "RNPlatform/Inc/Encryption.h"
00015 #include "RNPlatform/Inc/ThreadClass.h"
00016 #include "RNPlatform/Inc/Thread.h"
00017 #include "RNXPSockets/Inc/XPSockets.h"
00018 #include "RNLobby/Inc/BackendServer.h"
00019
00020 namespace RNReplicaNet
00021 {
00022
00023 namespace RNLobby
00024 {
00025
00032 class BackendClient : public BaseServer
00033 {
00034 public:
00035 BackendClient();
00036 virtual ~BackendClient();
00037
00041 bool Start(const int titleID,const char *encryptionKey);
00042
00045 bool GetCompleted(void);
00046
00049 BackendServer::Reply GetReply(void) const;
00050
00051 virtual void CallbackCompleted(void) {}
00052
00054 virtual bool CallbackServerAddress(XPAddress &address);
00055
00058 static void DisableValidateOrderingCheck(void);
00059
00060 static bool IsAuthenticated(void);
00061
00062 private:
00063 bool CallbackParseValidMessage(DynamicMessageHelper &message,const size_t length,const XPAddress &address);
00064
00065 void CleanQuery(void);
00066
00067 bool CallbackPoll(void);
00068
00069 BackendServer::Reply mReply;
00070 int mTitleID;
00071 std::string mEncryptionKey;
00072
00073 XPAddress mAddress;
00074
00075 float mLastSentTime;
00076 int mTries;
00077 bool mAddressGot;
00078 };
00079
00080 }
00081
00082 }
00083
00084 #endif