Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 773bbd1

Browse files
author
Paul Balaji
authored
Add some sort of logging to the code generator (#1227)
1 parent d82940d commit 773bbd1

File tree

118 files changed

+1337
-576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1337
-576
lines changed

test-project/Assets/Config/GdkToolsConfiguration.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"SchemaSourceDirs": [
33
"Assets/.schema"
44
],
5+
"VerboseLogging": false,
6+
"CodegenLogOutputDir": "logs/",
57
"CodegenOutputDir": "Assets/Generated/Source",
68
"DescriptorOutputDir": "Temp/schema",
79
"DevAuthTokenDir": "Resources",
810
"DevAuthTokenLifetimeDays": 30,
9-
"SaveDevAuthTokenToFile": false
11+
"SaveDevAuthTokenToFile": false,
12+
"SerializationOverrides": []
1013
}

test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentComponentDiffDeserializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public uint GetComponentId()
1818

1919
public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
2020
{
21-
if (op.Update.SchemaData.Value.GetFields().GetUniqueFieldIdCount() > 0)
21+
if (op.Update.SchemaData.Value.GetFields().GetUniqueFieldIdCount() + op.Update.SchemaData.Value.GetClearedFieldCount() > 0)
2222
{
2323
var update = global::Improbable.DependentSchema.DependentComponent.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);
2424
diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);

test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentMetaclass.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public class ComponentMetaclass : IComponentMetaclass
2828
public Type EcsViewManager { get; } = typeof(global::Improbable.DependentSchema.DependentComponent.EcsViewManager);
2929
public Type DynamicInvokable { get; } = typeof(global::Improbable.DependentSchema.DependentComponent.DependentComponentDynamic);
3030

31-
public ICommandMetaclass[] Commands { get; } = new ICommandMetaclass[]
32-
{
31+
public ICommandMetaclass[] Commands { get; } = new ICommandMetaclass[]
32+
{
3333
};
3434
}
3535
}

test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentProviders.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public partial class DependentComponent
1313
{
1414
internal static class ReferenceTypeProviders
1515
{
16-
public static class AProvider
16+
public static class AProvider
1717
{
1818
private static readonly Dictionary<uint, global::Improbable.TestSchema.ExhaustiveRepeatedData> Storage = new Dictionary<uint, global::Improbable.TestSchema.ExhaustiveRepeatedData>();
1919
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, global::Unity.Entities.World>();
@@ -66,10 +66,10 @@ public static void CleanDataInWorld(global::Unity.Entities.World world)
6666
}
6767
}
6868

69-
private static uint GetNextHandle()
69+
private static uint GetNextHandle()
7070
{
7171
nextHandle++;
72-
72+
7373
while (Storage.ContainsKey(nextHandle))
7474
{
7575
nextHandle++;
@@ -80,7 +80,7 @@ private static uint GetNextHandle()
8080
}
8181

8282

83-
public static class CProvider
83+
public static class CProvider
8484
{
8585
private static readonly Dictionary<uint, global::Improbable.TestSchema.SomeEnum?> Storage = new Dictionary<uint, global::Improbable.TestSchema.SomeEnum?>();
8686
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, global::Unity.Entities.World>();
@@ -133,10 +133,10 @@ public static void CleanDataInWorld(global::Unity.Entities.World world)
133133
}
134134
}
135135

136-
private static uint GetNextHandle()
136+
private static uint GetNextHandle()
137137
{
138138
nextHandle++;
139-
139+
140140
while (Storage.ContainsKey(nextHandle))
141141
{
142142
nextHandle++;
@@ -147,7 +147,7 @@ private static uint GetNextHandle()
147147
}
148148

149149

150-
public static class DProvider
150+
public static class DProvider
151151
{
152152
private static readonly Dictionary<uint, global::System.Collections.Generic.List<global::Improbable.TestSchema.SomeType>> Storage = new Dictionary<uint, global::System.Collections.Generic.List<global::Improbable.TestSchema.SomeType>>();
153153
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, global::Unity.Entities.World>();
@@ -200,10 +200,10 @@ public static void CleanDataInWorld(global::Unity.Entities.World world)
200200
}
201201
}
202202

203-
private static uint GetNextHandle()
203+
private static uint GetNextHandle()
204204
{
205205
nextHandle++;
206-
206+
207207
while (Storage.ContainsKey(nextHandle))
208208
{
209209
nextHandle++;
@@ -214,7 +214,7 @@ private static uint GetNextHandle()
214214
}
215215

216216

217-
public static class EProvider
217+
public static class EProvider
218218
{
219219
private static readonly Dictionary<uint, global::System.Collections.Generic.Dictionary<global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType>> Storage = new Dictionary<uint, global::System.Collections.Generic.Dictionary<global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType>>();
220220
private static readonly Dictionary<uint, global::Unity.Entities.World> WorldMapping = new Dictionary<uint, global::Unity.Entities.World>();
@@ -267,10 +267,10 @@ public static void CleanDataInWorld(global::Unity.Entities.World world)
267267
}
268268
}
269269

270-
private static uint GetNextHandle()
270+
private static uint GetNextHandle()
271271
{
272272
nextHandle++;
273-
273+
274274
while (Storage.ContainsKey(nextHandle))
275275
{
276276
nextHandle++;

test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentViewStorage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public void ApplyDiff(ViewDiff viewDiff)
9090

9191
public void ApplyUpdate(long entityId, in Update update)
9292
{
93-
if (!componentData.TryGetValue(entityId, out var data))
93+
if (!componentData.TryGetValue(entityId, out var data))
9494
{
9595
return;
9696
}
97-
97+
9898

9999
if (update.A.HasValue)
100100
{

test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentComponentDiffDeserializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public uint GetComponentId()
1818

1919
public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
2020
{
21-
if (op.Update.SchemaData.Value.GetFields().GetUniqueFieldIdCount() > 0)
21+
if (op.Update.SchemaData.Value.GetFields().GetUniqueFieldIdCount() + op.Update.SchemaData.Value.GetClearedFieldCount() > 0)
2222
{
2323
var update = global::Improbable.DependentSchema.DependentDataComponent.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);
2424
diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);

test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentMetaclass.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,20 @@ public class ComponentMetaclass : IComponentMetaclass
2828
public Type EcsViewManager { get; } = typeof(global::Improbable.DependentSchema.DependentDataComponent.EcsViewManager);
2929
public Type DynamicInvokable { get; } = typeof(global::Improbable.DependentSchema.DependentDataComponent.DependentDataComponentDynamic);
3030

31-
public ICommandMetaclass[] Commands { get; } = new ICommandMetaclass[]
32-
{
31+
public ICommandMetaclass[] Commands { get; } = new ICommandMetaclass[]
32+
{
3333
new BarCommandMetaclass(),
3434
};
3535
}
36-
3736

38-
public class BarCommandMetaclass : ICommandMetaclass
37+
public class BarCommandMetaclass : ICommandMetaclass
3938
{
4039
public uint CommandIndex => 1;
4140
public string Name => "BarCommand";
4241

4342
public Type DiffDeserializer { get; } = typeof(global::Improbable.DependentSchema.DependentDataComponent.BarCommandDiffCommandDeserializer);
4443
public Type Serializer { get; } = typeof(global::Improbable.DependentSchema.DependentDataComponent.BarCommandCommandSerializer);
45-
44+
4645
public Type MetaDataStorage { get; } = typeof(global::Improbable.DependentSchema.DependentDataComponent.BarCommandCommandMetaDataStorage);
4746
public Type SendStorage { get; } = typeof(global::Improbable.DependentSchema.DependentDataComponent.BarCommandCommandsToSendStorage);
4847
public Type DiffStorage { get; } = typeof(global::Improbable.DependentSchema.DependentDataComponent.DiffBarCommandCommandStorage);

0 commit comments

Comments
 (0)