Skip to content

Commit 893c3f5

Browse files
committed
- Updated offsets for Korean version to patch 5.4 offsets.
1 parent 6dbc5fd commit 893c3f5

File tree

3 files changed

+52
-17
lines changed

3 files changed

+52
-17
lines changed

xivModdingFramework/Exd/FileTypes/Ex.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,17 @@ public async Task<Dictionary<int, byte[]>> ReadExData(XivEx exFile)
179179

180180
var exdFolderHash = HashGenerator.GetHash("exd");
181181
var exdFileHash = HashGenerator.GetHash(exdFile);
182+
var offset = await _index.GetDataOffset(exdFolderHash, exdFileHash, XivDataFile._0A_Exd);
182183

183-
exdNameOffsetDictionary.Add(await _index.GetDataOffset(exdFolderHash, exdFileHash, XivDataFile._0A_Exd), exdFile);
184+
try
185+
{
186+
exdNameOffsetDictionary.Add(offset, exdFile);
187+
}
188+
catch (Exception ex)
189+
{
190+
var zz = "zz";
191+
throw ex;
192+
}
184193
}
185194

186195
await Task.Run(async () =>

xivModdingFramework/Items/Categories/Gear.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ public async Task<List<XivGear>> GetGearList(string substring = null)
6363
return await XivCache.GetCachedGearList(substring);
6464
}
6565

66+
private static Dictionary<string, int> DataLengthByPatch = new Dictionary<string, int>()
67+
{
68+
{ "5.3", 160 },
69+
{ "5.4", 168 },
70+
{ "5.5", 160 },
71+
};
72+
73+
private static Dictionary<string, int> SlotDataOffsetByPatch = new Dictionary<string, int>()
74+
{
75+
{ "5.3", 154 },
76+
{ "5.4", 156 },
77+
{ "5.5", 154 },
78+
};
79+
80+
6681
/// <summary>
6782
/// A getter for available gear in the Item exd files
6883
/// </summary>
@@ -72,21 +87,21 @@ public async Task<List<XivGear>> GetUnCachedGearList()
7287
// These are the offsets to relevant data
7388
// These will need to be changed if data gets added or removed with a patch
7489
const int modelDataCheckOffset = 30;
75-
int dataLength = 160;
90+
int dataLength = DataLengthByPatch["5.5"];
7691
const int nameDataOffset = 14;
7792
const int modelDataOffset = 24;
7893
const int iconDataOffset = 136;
79-
int slotDataOffset = 154;
94+
int slotDataOffset = SlotDataOffsetByPatch["5.5"];
8095

8196

8297
if( _xivLanguage == XivLanguage.Korean)
8398
{
84-
dataLength = 160;
85-
slotDataOffset = 154;
99+
dataLength = DataLengthByPatch["5.4"];
100+
slotDataOffset = SlotDataOffsetByPatch["5.4"];
86101
} else if (_xivLanguage == XivLanguage.Chinese)
87102
{
88-
dataLength = 168;
89-
slotDataOffset = 156;
103+
dataLength = DataLengthByPatch["5.4"];
104+
slotDataOffset = SlotDataOffsetByPatch["5.4"];
90105
}
91106

92107
var xivGearList = new List<XivGear>();

xivModdingFramework/Items/Categories/Housing.cs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ public async Task<List<XivFurniture>> GetUncachedFurnitureList()
7171
return furnitureList;
7272
}
7373

74+
private static Dictionary<string, int> DataLengthByPatch = new Dictionary<string, int>()
75+
{
76+
{ "5.3", 160 },
77+
{ "5.4", 168 },
78+
{ "5.5", 160 },
79+
};
80+
81+
7482
/// <summary>
7583
/// Gets the list of indoor furniture
7684
/// </summary>
@@ -91,15 +99,15 @@ private async Task<List<XivFurniture>> GetIndoorFurniture()
9199
const int itemCategoryOffset = 14;
92100

93101
const int itemNameDataOffset = 14;
94-
int itemDataLength = 160;
102+
int itemDataLength = DataLengthByPatch["5.5"];
95103
const int itemIconDataOffset = 136;
96104

97105
if(_xivLanguage == XivLanguage.Korean)
98106
{
99-
itemDataLength = 160;
107+
itemDataLength = DataLengthByPatch["5.4"];
100108
} else if (_xivLanguage == XivLanguage.Chinese)
101109
{
102-
itemDataLength = 168;
110+
itemDataLength = DataLengthByPatch["5.4"];
103111
}
104112

105113
var ex = new Ex(_gameDirectory, _xivLanguage);
@@ -183,20 +191,21 @@ private async Task<List<XivFurniture>> GetPaintings()
183191

184192
const int itemNameDataOffset = 14;
185193
const int housingIndexOffset = 112;
186-
int itemDataLength = 160;
194+
int itemDataLength = DataLengthByPatch["5.5"];
187195
const int itemIconDataOffset = 136;
188196

189197
var ex = new Ex(_gameDirectory, _xivLanguage);
190198
var pictureDictionary = await ex.ReadExData(XivEx.picture);
191199
var itemDictionary = await ex.ReadExData(XivEx.item);
192200

201+
193202
if (_xivLanguage == XivLanguage.Korean)
194203
{
195-
itemDataLength = 160;
204+
itemDataLength = DataLengthByPatch["5.4"];
196205
}
197206
else if (_xivLanguage == XivLanguage.Chinese)
198207
{
199-
itemDataLength = 168;
208+
itemDataLength = DataLengthByPatch["5.4"];
200209
}
201210

202211

@@ -265,18 +274,20 @@ private async Task<List<XivFurniture>> GetOutdoorFurniture()
265274
const int itemCategoryOffset = 13;
266275

267276
const int itemNameDataOffset = 14;
268-
int itemDataLength = 160;
277+
int itemDataLength = DataLengthByPatch["5.5"];
269278
const int itemIconDataOffset = 136;
270279

271-
if ( _xivLanguage == XivLanguage.Korean)
280+
281+
if (_xivLanguage == XivLanguage.Korean)
272282
{
273-
itemDataLength = 160;
283+
itemDataLength = DataLengthByPatch["5.4"];
274284
}
275285
else if (_xivLanguage == XivLanguage.Chinese)
276286
{
277-
itemDataLength = 168;
287+
itemDataLength = DataLengthByPatch["5.4"];
278288
}
279289

290+
280291
var ex = new Ex(_gameDirectory, _xivLanguage);
281292
var housingDictionary = await ex.ReadExData(XivEx.housingyardobject);
282293
var itemDictionary = await ex.ReadExData(XivEx.item);

0 commit comments

Comments
 (0)