瀏覽代碼

*** empty log message ***

Joe Shochet 25 年之前
父節點
當前提交
2e192a8ca9
共有 2 個文件被更改,包括 16 次插入2 次删除
  1. 14 1
      panda/src/downloader/downloadDb.I
  2. 2 1
      panda/src/downloader/downloadDb.h

+ 14 - 1
panda/src/downloader/downloadDb.I

@@ -127,10 +127,12 @@ set_client_multifile_size(string mfname, int size) {
 //       Access: Public
 //  Description: 
 ////////////////////////////////////////////////////////////////////
-INLINE void DownloadDb::
+INLINE int DownloadDb::
 set_client_multifile_delta_size(string mfname, int size) {
   (_client_db.get_multifile_record_named(mfname))->_size += size;
   write_db(_client_db._filename, _client_db);
+  // Return the new total
+  return (_client_db.get_multifile_record_named(mfname))->_size;
 }
 
 
@@ -157,6 +159,17 @@ set_server_multifile_size(string mfname, int size) {
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: DownloadDb::
+//       Access: Public
+//  Description: 
+////////////////////////////////////////////////////////////////////
+INLINE void DownloadDb::
+set_client_multifile_incomplete(string mfname) {
+  (_client_db.get_multifile_record_named(mfname))->_status = Status_incomplete;
+  write_db(_client_db._filename, _client_db);
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: DownloadDb::
 //       Access: Public

+ 2 - 1
panda/src/downloader/downloadDb.h

@@ -80,13 +80,14 @@ public:
 
   INLINE int get_client_multifile_size(string mfname) const;
   INLINE void set_client_multifile_size(string mfname, int size);
-  INLINE void set_client_multifile_delta_size(string mfname, int size);
+  INLINE int set_client_multifile_delta_size(string mfname, int size);
   INLINE int get_server_multifile_size(string mfname) const;
   INLINE void set_server_multifile_size(string mfname, int size);
 
   INLINE int get_client_multifile_phase(string mfname) const;
   INLINE int get_server_multifile_phase(string mfname) const;
 
+  INLINE void set_client_multifile_incomplete(string mfname);
   INLINE void set_client_multifile_complete(string mfname);
   INLINE void set_client_multifile_decompressed(string mfname);
   INLINE void set_client_multifile_expanded(string mfname);