Beaming Scene Service  2.0
RakNet wrapper for managing data communications between multiple Beaming clients
netClient/PHPConnections.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef __WEB_CLIENT_LIST
00019 #define __WEB_CLIENT_LIST
00020 
00021 #include "Export.h"
00022 #include "RakString.h"
00023 #include "HTTPConnection.h"
00024 #include "RakNetTypes.h"
00025 #include "DS_Queue.h"
00026 #include "DS_Table.h"
00027 #include "DS_Map.h"
00028 
00029 struct SystemAddress;
00030 
00031 enum HTTPReadResult
00032 {
00033         HTTP_RESULT_GOT_TABLE,
00034         HTTP_RESULT_EMPTY
00035 };
00036 
00040 class RAK_DLL_EXPORT PHPConnections
00041 {
00042 public:
00043     PHPConnections();
00044         virtual ~PHPConnections();
00045 
00049         void Init(HTTPConnection *_http, const char *_path);
00050 
00056         void SetField(RakNet::RakString columnName, RakNet::RakString value);
00057 
00059         unsigned int GetFieldCount(void) const;
00060 
00065         void GetField(unsigned int index, RakNet::RakString &columnName, RakNet::RakString &value);
00066 
00069         void SetFields(DataStructures::Table *table);
00070 
00072         void ClearFields(void);
00073 
00083         void UploadTable(RakNet::RakString uploadPassword, RakNet::RakString clientName, unsigned short clientPort, bool autoRepost);
00084 
00092         void DownloadTable(RakNet::RakString downloadPassword);
00093 
00100         void UploadAndDownloadTable(RakNet::RakString uploadPassword, RakNet::RakString downloadPassword, RakNet::RakString clientName, unsigned short clientPort, bool autoRepost);
00101 
00106         HTTPReadResult ProcessHTTPRead(RakNet::RakString httpRead);
00107 
00111         const DataStructures::Table *GetLastDownloadedTable(void) const;
00112 
00114         void Update(void);
00115     
00116 private:
00117     HTTPConnection *http;
00118         RakNet::RakString pathToPHP;
00119     
00120         RakNet::RakString clientNameParam;
00121         unsigned short clientPortParam;
00122 
00123         void SendOperation(void);
00124         void PushColumnsAndValues(DataStructures::List<RakNet::RakString> &columns, DataStructures::List<RakNet::RakString> &values);
00125 
00126         DataStructures::Table lastDownloadedTable;
00127         DataStructures::Map<RakNet::RakString, RakNet::RakString> fields;
00128         RakNet::RakString currentOperation;
00129         RakNetTimeMS nextRepost;
00130 
00131 };
00132 
00133 #endif
00134 
 All Classes Files Functions Variables Enumerations Enumerator Defines