Skip to content

Commit 9c3af58

Browse files
committed
Finish 1.9.0
2 parents ff84179 + 3be1f81 commit 9c3af58

22 files changed

+644
-56
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#
22

3+
## [1.9.0](https://github.com/EliotVU/Unreal-Library/releases/tag/1.9.0)
4+
5+
* ad530643 Support for Tom Clancy's Rainbow Six: Vegas
6+
* ad530643 Support for Tom Clancy's Rainbow Six: Vegas 2
7+
* 2979a15b Support for early UE3 packages including:
8+
* RoboHordes
9+
* e1879b89 Support for deserialization and decompilation for Gigantic's UJsonNodeRoot and UMoJsonObject #102
10+
* Fixed minor issues with early UE3 games affecting:
11+
* Tom Clancy's EndWar
12+
313
## [1.8.1](https://github.com/EliotVU/Unreal-Library/releases/tag/1.8.1)
414

515
* Fixed and improved support for Template/UComponent objects (UE3)

src/Branch/PackageObjectLegacyVersion.cs

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public enum PackageObjectLegacyVersion
5757
AddedCppTextToUStruct = 120,
5858
FontPagesDisplaced = 122,
5959

60-
// FIXME: Version
60+
// FIXME: Version 138? Cheating with 160 to avoid issues with DNF and Spellborn
61+
AddedFuncMapToUState = 160,
62+
63+
// FIXME: Version 138? Cheating with 160 to avoid issues with DNF and Spellborn
6164
MovedFriendlyNameToUFunction = 160,
6265

6366
// The estimated version changes that came after the latest known UE2 build.
@@ -73,9 +76,6 @@ public enum PackageObjectLegacyVersion
7376
/// </summary>
7477
IsLocalAddedToDelegateFunctionToken = 181,
7578

76-
// FIXME: Version, added somewhere between 186 ... 230
77-
AddedStateStackToUStateFrame = 187,
78-
7979
// FIXME: Version 128-178
8080
AddedDelegateSourceToUDelegateProperty = 185,
8181

@@ -85,16 +85,31 @@ public enum PackageObjectLegacyVersion
8585
// FIXME: Version
8686
RangeConstTokenDeprecated = UE3,
8787

88-
// FIXME: Version
88+
// FIXME: Version 118?
8989
FastSerializeStructs = UE3,
9090

9191
// FIXME: Version
9292
EnumTagNameAddedToBytePropertyTag = UE3,
9393

94+
// FIXME: Version
95+
DisplacedHideCategories = UE3,
96+
97+
/// <summary>
98+
/// FIXME: Version
99+
/// No version check in RoboHordes (200)
100+
///
101+
/// Deprecated with <seealso cref="ComponentMapDeprecated"/>
102+
/// </summary>
103+
AddedComponentMapToExports = UE3,
104+
105+
// Added somewhere between 186 ... 230
106+
// 189 according to RoboHordes
107+
AddedStateStackToUStateFrame = 189,
108+
94109
ObjectFlagsSizeExpandedTo64Bits = 195,
95110

96-
// FIXME: Version, def not <= 178, found in GoW but no version check, so this approximation should do :)
97-
TemplateDataAddedToUComponent = 200,
111+
// FIXME: Version, def not <= 178, not found in RoboHordes (198,200), but found in GoW without a version check, so this approximation should do :)
112+
TemplateDataAddedToUComponent = 201,
98113

99114
// 208 according to EndWar
100115
PackageImportsDeprecated = 208,
@@ -105,22 +120,29 @@ public enum PackageObjectLegacyVersion
105120
// 219 according to EndWar
106121
DisplacedScriptPropertiesWithClassDefaultObject = 219,
107122

108-
// FIXME: Version
109-
AddedFuncMapToUState = 220,
123+
ArchetypeAddedToExports = 220,
110124

111125
/// <summary>
112-
/// And ComponentMap
126+
/// FIXME: Version
127+
/// No version check in all of RoboHordes (200), EndWar (223), and R6Vegas (241)
113128
/// </summary>
114-
ArchetypeAddedToExports = 220,
115-
116-
PropertyFlagsSizeExpandedTo64Bits = 220,
129+
PropertyFlagsSizeExpandedTo64Bits = UE3,
117130

118131
// 222 according to EndWar
119132
AddedInterfacesFeature = 222,
120133

134+
// 223 according to EndWar
135+
RefactoredPropertyTags = 223,
136+
121137
// 227 according to the GoW client
122138
FixedVerticesToArrayFromPoly = 227,
123139

140+
/// <summary>
141+
/// FIXME: Version
142+
/// Not attested with EndWar (223) and R6Vegas (241)
143+
/// </summary>
144+
AddedStructFlagsToScriptStruct = 242,
145+
124146
ExportFlagsAddedToExports = 247,
125147
ComponentClassBridgeMapDeprecated = 248,
126148
SerialSizeConditionRemoved = 249,
@@ -258,6 +280,6 @@ public enum PackageObjectLegacyVersion
258280
AddedNativeClassNameToUClass = 813,
259281

260282
AddedATITCToUTexture2D = 857,
261-
AddedETCToUTexture2D = 864
283+
AddedETCToUTexture2D = 864,
262284
}
263285
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
using System;
2+
using System.Linq;
3+
using System.Text;
4+
using UELib.Core;
5+
using UELib.UnrealScript;
6+
7+
namespace UELib.Branch.UE3.GIGANTIC.Core.Classes
8+
{
9+
public class UJsonNodeRoot : UObject
10+
{
11+
public UMap<string, UMoJsonObject> JsonObjects;
12+
13+
public UJsonNodeRoot()
14+
{
15+
ShouldDeserializeOnDemand = true;
16+
}
17+
18+
protected override void Deserialize()
19+
{
20+
base.Deserialize();
21+
22+
int c = _Buffer.ReadInt32();
23+
_Buffer.Record(nameof(c), c);
24+
25+
JsonObjects = new UMap<string, UMoJsonObject>(c);
26+
for (int i = 0; i < c; ++i)
27+
{
28+
_Buffer.Read(out string key);
29+
_Buffer.Record(nameof(key), key);
30+
31+
// In the engine 'ReadObject<UMoJsonObject>' is overriden here to serialize as a string / value
32+
var jsonObject = new UMoJsonObject();
33+
jsonObject.Deserialize(_Buffer);
34+
_Buffer.Record(nameof(jsonObject), jsonObject);
35+
36+
JsonObjects.Add(key, jsonObject);
37+
}
38+
39+
//_Buffer.Record(nameof(JsonObjects), JsonObjects);
40+
}
41+
42+
public override string Decompile()
43+
{
44+
if (ShouldDeserializeOnDemand && JsonObjects == null)
45+
{
46+
BeginDeserializing();
47+
}
48+
49+
if (JsonObjects == null)
50+
{
51+
return base.Decompile();
52+
}
53+
54+
var str = new StringBuilder(JsonObjects.Count * 16);
55+
56+
str.Append(UDecompilingState.Tabs);
57+
str.Append("[");
58+
str.Append(Environment.NewLine);
59+
UDecompilingState.AddTab();
60+
61+
foreach (var pair in JsonObjects)
62+
{
63+
str.Append(UDecompilingState.Tabs);
64+
str.Append(PropertyDisplay.FormatLiteral(pair.Key));
65+
str.Append(":");
66+
str.Append(" ");
67+
68+
string value = pair.Value.Decompile();
69+
70+
if (pair.Value == JsonObjects.Last().Value)
71+
{
72+
continue;
73+
}
74+
75+
str.Append(value);
76+
str.Append(",");
77+
str.Append(Environment.NewLine);
78+
}
79+
80+
UDecompilingState.RemoveTab();
81+
str.Append(Environment.NewLine);
82+
str.Append(UDecompilingState.Tabs);
83+
str.Append("]");
84+
85+
return str.ToString();
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)