|
@@ -510,11 +510,12 @@ namespace LOTRO_DAT {
|
|
|
long long dict_size = dicts_data.ToNumber<4>(0);
|
|
|
|
|
|
if (binary_data.size() > dict_size || dict_offset == 0) {
|
|
|
+ WriteData(BinaryData::FromNumber<4>(file_size_), 4, 300);
|
|
|
+
|
|
|
WriteData(BinaryData::FromNumber<4>(std::max(binary_data.size() + 4, 20u * 1024u * 1024u)), 4, file_size_);
|
|
|
WriteData(BinaryData::FromNumber<4>(100), 4, file_size_ + 4);
|
|
|
WriteData(binary_data, binary_data.size(), file_size_ + 8);
|
|
|
- WriteData(BinaryData::FromNumber<4>(file_size_), 4, 300);
|
|
|
- file_size_ += binary_data.size();
|
|
|
+ file_size_ += binary_data.size() + 8;
|
|
|
|
|
|
// Adding space for 25 megabytes locales file in total.
|
|
|
BinaryData nulls(unsigned(20 * 1024 * 1024));
|
|
@@ -1103,13 +1104,8 @@ namespace LOTRO_DAT {
|
|
|
patch_dict_.clear();
|
|
|
LOG(INFO) << "DAT FILE WAS UPDATED!!!! CLEARING PATCH DATA";
|
|
|
pending_patch_.insert(file_id);
|
|
|
- truncate64(filename_.c_str(), file_size_);
|
|
|
+ WriteData(BinaryData::FromNumber<4>(0), 4, 300);
|
|
|
return true;
|
|
|
-
|
|
|
- orig_dict_.erase(file_id);
|
|
|
- patch_dict_.erase(file_id);
|
|
|
- updated = true;
|
|
|
- dat_state_ = UPDATED;
|
|
|
}
|
|
|
}
|
|
|
return updated;
|