|
@@ -494,7 +494,7 @@ namespace LOTRO_DAT {
|
|
|
}
|
|
|
|
|
|
BinaryData fragments_count(4);
|
|
|
- fragments_count.FromNumber<4>(0);
|
|
|
+ fragments_count = BinaryData::FromNumber<4>(0);
|
|
|
|
|
|
BinaryData file_data = fragments_count + data.CutData(4);
|
|
|
|
|
@@ -526,28 +526,13 @@ namespace LOTRO_DAT {
|
|
|
}
|
|
|
|
|
|
void DatFile::UpdateHeader() {
|
|
|
- BinaryData data(4);
|
|
|
-
|
|
|
- data.FromNumber<4>(constant1_);
|
|
|
- WriteData(data, 4, 0x100);
|
|
|
-
|
|
|
- data.FromNumber<4>(constant2_);
|
|
|
- WriteData(data, 4, 0x140);
|
|
|
-
|
|
|
- data.FromNumber<4>(file_size_);
|
|
|
- WriteData(data, 4, 0x148);
|
|
|
-
|
|
|
- data.FromNumber<4>(version1_);
|
|
|
- WriteData(data, 4, 0x14C);
|
|
|
-
|
|
|
- data.FromNumber<4>(version2_);
|
|
|
- WriteData(data, 4, 0x150);
|
|
|
-
|
|
|
- data.FromNumber<4>(fragmentation_journal_offset_);
|
|
|
- WriteData(data, 4, 0x154);
|
|
|
-
|
|
|
- data.FromNumber<4>(root_directory_offset_);
|
|
|
- WriteData(data, 4, 0x160);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(constant1_), 4, 0x100);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(constant2_), 4, 0x140);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(constant2_), 4, 0x148);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(version1_), 4, 0x14C);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(version2_), 4, 0x150);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(fragmentation_journal_offset_), 4, 0x154);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(root_directory_offset_), 4, 0x160);
|
|
|
}
|
|
|
|
|
|
void DatFile::UpdateFragmentationJournal(const std::vector<std::pair<long long, long long> > &journal) {
|
|
@@ -555,12 +540,8 @@ namespace LOTRO_DAT {
|
|
|
long long size = journal[i].first;
|
|
|
long long offset = journal[i].second;
|
|
|
|
|
|
- BinaryData data(4);
|
|
|
- data.FromNumber<4>(size);
|
|
|
- WriteData(data, 4, fragmentation_journal_offset_ + 8 * (i + 1));
|
|
|
-
|
|
|
- data.FromNumber<4>(offset);
|
|
|
- WriteData(data, 4, fragmentation_journal_offset_ + 8 * (i + 1) + 4);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(size), 4, fragmentation_journal_offset_ + 8 * (i + 1));
|
|
|
+ WriteData(BinaryData::FromNumber<4>(offset), 4, fragmentation_journal_offset_ + 8 * (i + 1) + 4);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -663,16 +644,19 @@ namespace LOTRO_DAT {
|
|
|
if (dictionary_[file.first]->MakeHeaderData().CutData(8, 16) == file.second->MakeHeaderData().CutData(8, 16))
|
|
|
continue;
|
|
|
|
|
|
- dictionary_[file.first]->file_offset_ = file.second->file_offset_;
|
|
|
- dictionary_[file.first]->file_size_ = file.second->file_size_;
|
|
|
- dictionary_[file.first]->block_size_= file.second->block_size_;
|
|
|
- dictionary_[file.first]->timestamp_ = file.second->timestamp_;
|
|
|
- dictionary_[file.first]->version_ = file.second->version_;
|
|
|
+ long long file_id = file.first;
|
|
|
+ Subfile* new_file = file.second;
|
|
|
+
|
|
|
+ dictionary_[file_id]->file_offset_ = new_file->file_offset_;
|
|
|
+ dictionary_[file_id]->file_size_ = new_file->file_size_;
|
|
|
+ dictionary_[file_id]->block_size_= new_file->block_size_;
|
|
|
+ dictionary_[file_id]->timestamp_ = new_file->timestamp_;
|
|
|
+ dictionary_[file_id]->version_ = new_file->version_;
|
|
|
|
|
|
- dictionary_[file.first] = file.second;
|
|
|
patched_list.insert(file.first);
|
|
|
dat_state_ = UPDATED;
|
|
|
}
|
|
|
+
|
|
|
current_locale_ = locale;
|
|
|
CommitChanges();
|
|
|
}
|