![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
00001 00002 00003 00004 00005 00006 00007 #ifndef __FILE_LIST_TRANSFER_CALLBACK_INTERFACE_H 00008 #define __FILE_LIST_TRANSFER_CALLBACK_INTERFACE_H 00009 00010 #include "RakMemoryOverride.h" 00011 #include "FileListNodeContext.h" 00012 00013 #ifdef _MSC_VER 00014 #pragma warning( push ) 00015 #endif 00016 00017 namespace RakNet 00018 { 00019 00023 class FileListTransferCBInterface 00024 { 00025 public: 00026 // Note: If this structure is changed the struct in the swig files need to be changed as well 00027 struct OnFileStruct 00028 { 00030 unsigned fileIndex; 00031 00033 char fileName[512]; 00034 00036 char *fileData; 00037 00039 BitSize_t byteLengthOfThisFile; 00040 00042 BitSize_t bytesDownloadedForThisFile; 00043 00046 unsigned short setID; 00047 00049 unsigned numberOfFilesInThisSet; 00050 00052 unsigned byteLengthOfThisSet; 00053 00055 unsigned bytesDownloadedForThisSet; 00056 00059 FileListNodeContext context; 00060 00062 SystemAddress senderSystemAddress; 00063 00065 RakNetGUID senderGuid; 00066 }; 00067 00068 // Note: If this structure is changed the struct in the swig files need to be changed as well 00069 struct FileProgressStruct 00070 { 00072 OnFileStruct *onFileStruct; 00074 unsigned int partCount; 00076 unsigned int partTotal; 00078 unsigned int dataChunkLength; 00080 char *firstDataChunk; 00082 char *iriDataChunk; 00084 unsigned int iriWriteOffset; 00086 SystemAddress senderSystemAddress; 00088 RakNetGUID senderGuid; 00090 bool allocateIrIDataChunkAutomatically; 00091 }; 00092 00093 struct DownloadCompleteStruct 00094 { 00097 unsigned short setID; 00098 00100 unsigned numberOfFilesInThisSet; 00101 00103 unsigned byteLengthOfThisSet; 00104 00106 SystemAddress senderSystemAddress; 00107 00109 RakNetGUID senderGuid; 00110 }; 00111 00112 FileListTransferCBInterface() {} 00113 virtual ~FileListTransferCBInterface() {} 00114 00118 virtual bool OnFile(OnFileStruct *onFileStruct)=0; 00119 00127 virtual void OnFileProgress(FileProgressStruct *fps)=0; 00128 00132 virtual bool Update(void) {return true;} 00133 00138 virtual bool OnDownloadComplete(DownloadCompleteStruct *dcs) {(void) dcs; return false;} 00139 00144 virtual void OnDereference(void) {} 00145 }; 00146 00147 } // namespace RakNet 00148 00149 #ifdef _MSC_VER 00150 #pragma warning( pop ) 00151 #endif 00152 00153 #endif 00154
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.