Started serializing bunches

This commit is contained in:
AeonLucid
2022-01-10 04:38:06 +01:00
parent 49e6e0f6f8
commit f3b0a31761
36 changed files with 2013 additions and 54 deletions
@@ -1,6 +1,6 @@
namespace Prospect.Unreal.Core;
public enum EEngineNetworkVersionHistory
public enum EEngineNetworkVersionHistory : uint
{
HISTORY_INITIAL = 1,
HISTORY_REPLAY_BACKWARDS_COMPAT = 2, // Bump version to get rid of older replays before backwards compat was turned on officially
+7 -7
View File
@@ -4,11 +4,11 @@ namespace Prospect.Unreal.Core;
public class FUrl
{
public string Protocol { get; init; } = "unreal";
public IPAddress Host { get; init; } = IPAddress.Any;
public int Port { get; init; } = 7777;
public string Map { get; init; } = "GearStart";
public string RedirectUrl { get; init; } = string.Empty;
public List<string> Options { get; init; } = new List<string>();
public string Portal { get; init; } = string.Empty;
public string Protocol { get; set; } = "unreal";
public IPAddress Host { get; set; } = IPAddress.Any;
public int Port { get; set; } = 7777;
public string Map { get; set; } = "GearStart";
public string RedirectUrl { get; set; } = string.Empty;
public List<string> Options { get; set; } = new List<string>();
public string Portal { get; set; } = string.Empty;
}
+36
View File
@@ -0,0 +1,36 @@
namespace Prospect.Unreal.Core.Names;
public class FName
{
public FName()
{
NameIndex = -1; // ?
Number = -1; // ?
Str = "None";
}
public FName(string str)
{
NameIndex = -1;
Number = -1;
Str = str;
}
public FName(string str, int number)
{
NameIndex = -1;
Number = number;
Str = str;
}
public Int32 NameIndex { get; set; }
public Int32 Number { get; set; }
public string Str { get; set; }
public override string ToString()
{
return Str;
}
}
@@ -0,0 +1,202 @@
namespace Prospect.Unreal.Core.Names
{
public enum UnrealNameKey
{
None = 0,
// Class property types (name indices are significant for serialization).
ByteProperty = 1,
IntProperty = 2,
BoolProperty = 3,
FloatProperty = 4,
ObjectProperty = 5, // ClassProperty shares the same tag
NameProperty = 6,
DelegateProperty = 7,
DoubleProperty = 8,
ArrayProperty = 9,
StructProperty = 10,
VectorProperty = 11,
RotatorProperty = 12,
StrProperty = 13,
TextProperty = 14,
InterfaceProperty = 15,
MulticastDelegateProperty = 16,
//Available = 17,
LazyObjectProperty = 18,
SoftObjectProperty = 19, // SoftClassProperty shares the same tag
UInt64Property = 20,
UInt32Property = 21,
UInt16Property = 22,
Int64Property = 23,
Int16Property = 25,
Int8Property = 26,
//Available = 27,
MapProperty = 28,
SetProperty = 29,
// Special packages.
Core = 30,
Engine = 31,
Editor = 32,
CoreUObject = 33,
// More class properties
EnumProperty = 34,
// Special types.
Cylinder = 50,
BoxSphereBounds = 51,
Sphere = 52,
Box = 53,
Vector2D = 54,
IntRect = 55,
IntPoint = 56,
Vector4 = 57,
Name = 58,
Vector = 59,
Rotator = 60,
SHVector = 61,
Color = 62,
Plane = 63,
Matrix = 64,
LinearColor = 65,
AdvanceFrame = 66,
Pointer = 67,
Double = 68,
Quat = 69,
Self = 70,
Transform = 71,
// Object class names.
Object = 100,
Camera = 101,
Actor = 102,
ObjectRedirector = 103,
ObjectArchetype = 104,
Class = 105,
ScriptStruct = 106,
Function = 107,
// Misc.
State = 200,
TRUE = 201,
FALSE = 202,
Enum = 203,
Default = 204,
Skip = 205,
Input = 206,
Package = 207,
Groups = 208,
Interface = 209,
Components = 210,
Global = 211,
Super = 212,
Outer = 213,
Map = 214,
Role = 215,
RemoteRole = 216,
PersistentLevel = 217,
TheWorld = 218,
PackageMetaData = 219,
InitialState = 220,
Game = 221,
SelectionColor = 222,
UI = 223,
ExecuteUbergraph = 224,
DeviceID = 225,
RootStat = 226,
MoveActor = 227,
All = 230,
MeshEmitterVertexColor = 231,
TextureOffsetParameter = 232,
TextureScaleParameter = 233,
ImpactVel = 234,
SlideVel = 235,
TextureOffset1Parameter = 236,
MeshEmitterDynamicParameter = 237,
ExpressionInput = 238,
Untitled = 239,
Timer = 240,
Team = 241,
Low = 242,
High = 243,
NetworkGUID = 244,
GameThread = 245,
RenderThread = 246,
OtherChildren = 247,
Location = 248,
Rotation = 249,
BSP = 250,
EditorSettings = 251,
AudioThread = 252,
ID = 253,
UserDefinedEnum = 254,
Control = 255,
Voice = 256,
Zlib = 257,
Gzip = 258,
// Online
DGram = 280,
Stream = 281,
GameNetDriver = 282,
PendingNetDriver = 283,
BeaconNetDriver = 284,
FlushNetDormancy = 285,
DemoNetDriver = 286,
GameSession = 287,
PartySession = 288,
GamePort = 289,
BeaconPort = 290,
MeshPort = 291,
MeshNetDriver = 292,
// Texture settings.
Linear = 300,
Point = 301,
Aniso = 302,
LightMapResolution = 303,
// Sound.
// = 310,
UnGrouped = 311,
VoiceChat = 312,
// Optimized replication.
Playing = 320,
Spectating = 322,
Inactive = 325,
// Log messages.
PerfWarning = 350,
Info = 351,
Init = 352,
Exit = 353,
Cmd = 354,
Warning = 355,
Error = 356,
// File format backwards-compatibility.
FontCharacter = 400,
InitChild2StartBone = 401,
SoundCueLocalized = 402,
SoundCue = 403,
RawDistributionFloat = 404,
RawDistributionVector = 405,
InterpCurveFloat = 406,
InterpCurveVector2D = 407,
InterpCurveVector = 408,
InterpCurveTwoVectors = 409,
InterpCurveQuat = 410,
AI = 450,
NavMesh = 451,
PerformanceCapture = 500,
// Special config names - not required to be consistent for network replication
EditorLayout = 600,
EditorKeyBindings = 601,
GameUserSettings = 602
}
}
@@ -0,0 +1,231 @@
namespace Prospect.Unreal.Core.Names
{
public static class UnrealNames
{
public const int MaxNetworkedHardcodedName = 410;
static UnrealNames()
{
// ReSharper disable once UseObjectOrCollectionInitializer
var names = new Dictionary<int, string>();
// Special zero value, meaning no name.
names.Add(0, "None");
// Class property types (name indices are significant for serialization).
names.Add(1, "ByteProperty");
names.Add(2, "IntProperty");
names.Add(3, "BoolProperty");
names.Add(4, "FloatProperty");
names.Add(5, "ObjectProperty"); // ClassProperty shares the same tag
names.Add(6, "NameProperty");
names.Add(7, "DelegateProperty");
names.Add(8, "DoubleProperty");
names.Add(9, "ArrayProperty");
names.Add(10, "StructProperty");
names.Add(11, "VectorProperty");
names.Add(12, "RotatorProperty");
names.Add(13, "StrProperty");
names.Add(14, "TextProperty");
names.Add(15, "InterfaceProperty");
names.Add(16, "MulticastDelegateProperty");
//Names.Add(17, "Available");
names.Add(18, "LazyObjectProperty");
names.Add(19, "SoftObjectProperty"); // SoftClassProperty shares the same tag
names.Add(20, "UInt64Property");
names.Add(21, "UInt32Property");
names.Add(22, "UInt16Property");
names.Add(23, "Int64Property");
names.Add(25, "Int16Property");
names.Add(26, "Int8Property");
//Names.Add(27, "Available");
names.Add(28, "MapProperty");
names.Add(29, "SetProperty");
// Special packages.
names.Add(30, "Core");
names.Add(31, "Engine");
names.Add(32, "Editor");
names.Add(33, "CoreUObject");
// More class properties
names.Add(34, "EnumProperty");
// Special types.
names.Add(50, "Cylinder");
names.Add(51, "BoxSphereBounds");
names.Add(52, "Sphere");
names.Add(53, "Box");
names.Add(54, "Vector2D");
names.Add(55, "IntRect");
names.Add(56, "IntPoint");
names.Add(57, "Vector4");
names.Add(58, "Name");
names.Add(59, "Vector");
names.Add(60, "Rotator");
names.Add(61, "SHVector");
names.Add(62, "Color");
names.Add(63, "Plane");
names.Add(64, "Matrix");
names.Add(65, "LinearColor");
names.Add(66, "AdvanceFrame");
names.Add(67, "Pointer");
names.Add(68, "Double");
names.Add(69, "Quat");
names.Add(70, "Self");
names.Add(71, "Transform");
// Object class names.
names.Add(100, "Object");
names.Add(101, "Camera");
names.Add(102, "Actor");
names.Add(103, "ObjectRedirector");
names.Add(104, "ObjectArchetype");
names.Add(105, "Class");
names.Add(106, "ScriptStruct");
names.Add(107, "Function");
names.Add(108, "Pawn");
// Misc.
names.Add(200, "State");
names.Add(201, "TRUE");
names.Add(202, "FALSE");
names.Add(203, "Enum");
names.Add(204, "Default");
names.Add(205, "Skip");
names.Add(206, "Input");
names.Add(207, "Package");
names.Add(208, "Groups");
names.Add(209, "Interface");
names.Add(210, "Components");
names.Add(211, "Global");
names.Add(212, "Super");
names.Add(213, "Outer");
names.Add(214, "Map");
names.Add(215, "Role");
names.Add(216, "RemoteRole");
names.Add(217, "PersistentLevel");
names.Add(218, "TheWorld");
names.Add(219, "PackageMetaData");
names.Add(220, "InitialState");
names.Add(221, "Game");
names.Add(222, "SelectionColor");
names.Add(223, "UI");
names.Add(224, "ExecuteUbergraph");
names.Add(225, "DeviceID");
names.Add(226, "RootStat");
names.Add(227, "MoveActor");
names.Add(230, "All");
names.Add(231, "MeshEmitterVertexColor");
names.Add(232, "TextureOffsetParameter");
names.Add(233, "TextureScaleParameter");
names.Add(234, "ImpactVel");
names.Add(235, "SlideVel");
names.Add(236, "TextureOffset1Parameter");
names.Add(237, "MeshEmitterDynamicParameter");
names.Add(238, "ExpressionInput");
names.Add(239, "Untitled");
names.Add(240, "Timer");
names.Add(241, "Team");
names.Add(242, "Low");
names.Add(243, "High");
names.Add(244, "NetworkGUID");
names.Add(245, "GameThread");
names.Add(246, "RenderThread");
names.Add(247, "OtherChildren");
names.Add(248, "Location");
names.Add(249, "Rotation");
names.Add(250, "BSP");
names.Add(251, "EditorSettings");
names.Add(252, "AudioThread");
names.Add(253, "ID");
names.Add(254, "UserDefinedEnum");
names.Add(255, "Control");
names.Add(256, "Voice");
names.Add(257, " Zlib");
names.Add(258, " Gzip");
names.Add(259, " LZ4");
names.Add(260, " Mobile");
// Online
names.Add(280, "DGram");
names.Add(281, "Stream");
names.Add(282, "GameNetDriver");
names.Add(283, "PendingNetDriver");
names.Add(284, "BeaconNetDriver");
names.Add(285, "FlushNetDormancy");
names.Add(286, "DemoNetDriver");
names.Add(287, "GameSession");
names.Add(288, "PartySession");
names.Add(289, "GamePort");
names.Add(290, "BeaconPort");
names.Add(291, "MeshPort");
names.Add(292, "MeshNetDriver");
names.Add(293, "LiveStreamVoice");
names.Add(294, "LiveStreamAnimation");
// Texture settings.
names.Add(300, "Linear");
names.Add(301, "Point");
names.Add(302, "Aniso");
names.Add(303, "LightMapResolution");
// Sound.
//Names.Add(310, "");
names.Add(311, "UnGrouped");
names.Add(312, "VoiceChat");
// Optimized replication.
names.Add(320, "Playing");
names.Add(322, "Spectating");
names.Add(325, "Inactive");
// Log messages.
names.Add(350, "PerfWarning");
names.Add(351, "Info");
names.Add(352, "Init");
names.Add(353, "Exit");
names.Add(354, "Cmd");
names.Add(355, "Warning");
names.Add(356, "Error");
// File format backwards-compatibility.
names.Add(400, "FontCharacter");
names.Add(401, "InitChild2StartBone");
names.Add(402, "SoundCueLocalized");
names.Add(403, "SoundCue");
names.Add(404, "RawDistributionFloat");
names.Add(405, "RawDistributionVector");
names.Add(406, "InterpCurveFloat");
names.Add(407, "InterpCurveVector2D");
names.Add(408, "InterpCurveVector");
names.Add(409, "InterpCurveTwoVectors");
names.Add(410, "InterpCurveQuat");
names.Add(450, "AI");
names.Add(451, "NavMesh");
names.Add(500, "PerformanceCapture");
// Special config names - not required to be consistent for network replication
names.Add(600, "EditorLayout");
names.Add(601, "EditorKeyBindings");
names.Add(602, "GameUserSettings");
names.Add(700, "Filename");
names.Add(701, "Lerp");
names.Add(702, "Root");
// Save.
Names = names;
FNames = Names.ToDictionary(x => (UnrealNameKey) x.Key, y => new FName(y.Value, y.Key));
MaxHardcodedNameIndex = Names.Last().Key + 1;
}
public static IReadOnlyDictionary<int, string> Names { get; }
public static IReadOnlyDictionary<UnrealNameKey, FName> FNames { get; }
public static int MaxHardcodedNameIndex { get; }
}
}