This repository has been archived by the owner on May 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Test.cs
103 lines (85 loc) · 3.7 KB
/
Test.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
using ao_id_extractor.Extractors;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace ao_id_extractor
{
public class Test
{
readonly string GAMEDATA_FOLDER = "D:\\AlbionOnline\\game\\Albion-Online_Data\\StreamingAssets\\GameData";
readonly string CLUSTER_FOLDER = "D:\\AlbionOnline\\game\\Albion-Online_Data\\StreamingAssets\\GameData\\cluster";
private void ExtractXML()
{
string filePath = Path.Combine(Directory.GetCurrentDirectory(), "xmlFiles");
if (!Directory.Exists(Path.GetDirectoryName(filePath)))
{
DirectoryInfo di = Directory.CreateDirectory(Path.GetDirectoryName(filePath));
}
string[] fileList = { "spells", "mobs", "items", "spellanimmappings", "assetvfx", "sockets", "audio", "buildings",
"emotes", "gamedata", "loot", "characters", "guildlogos", "resources", "world", "achievements",
"avatars", "missions", "factions", "agents", "accessrights", "territorytypes", "worldsettings",
"chatsettings", "treasures", "worldbosses", "resourcedistpresets", "resourceprefabmappings",
"expeditioncategories", "expeditions", "expeditionagents", "arena", "randomspawnbehaviors",
"itemroles", "orbtypes", "matchtypes", "tokens", "gvgseasons" };
foreach (string s in fileList)
{
string GDbinFilePath = Path.Combine(GAMEDATA_FOLDER, s + ".bin");
string CLbinFilePath = Path.Combine(CLUSTER_FOLDER, s + ".bin");
string pathToUse = "";
if (File.Exists(GDbinFilePath))
pathToUse = GDbinFilePath;
else
pathToUse = CLbinFilePath;
string xmlFilePath = Path.Combine(filePath, s + ".xml");
string data = BinaryDecrypter.DecryptBinaryFile(pathToUse);
File.Delete(xmlFilePath);
StreamWriter sw = File.CreateText(xmlFilePath);
sw.Write(data);
sw.Close();
}
}
private h0 InitAOClass()
{
h0 h = new h0();
h.ap(Path.Combine(Directory.GetCurrentDirectory(), "xmlFiles"), Path.Combine(Directory.GetCurrentDirectory(), "xmlFiles"));
h.bv();
var itemListObj = h.aq();
int count = 0;
ca item = itemListObj.ir(count);
List<ca> itemList = new List<ca>();
while (item != null)
{
itemList.Add(item);
count++;
item = itemListObj.ir(count);
}
List<string> itemUIDS = new List<string>();
foreach (ca c in itemList)
{
itemUIDS.Add(c.d);
}
ItemExtractor itemExtractor = new ItemExtractor(Directory.GetCurrentDirectory(), ExportType.Json);
List<IDContainer> list = itemExtractor.PureExtract(false);
List<string> nameListExtractor = new List<string>();
foreach (IDContainer cont in list)
{
nameListExtractor.Add(cont.UniqueName);
}
for (int id = 0; id < list.Count; id++)
{
string dllVal = itemUIDS[id];
string extrVal = nameListExtractor[id];
if (dllVal != extrVal)
break;
}
return h;
}
public Test()
{
ExtractXML();
h0 myH0 = InitAOClass();
}
}
}