Skip to content

Commit 306aaca

Browse files
JohannesLootkirre-bylund
authored andcommitted
Added correct serialization for default classes and heroes
1 parent 9b51575 commit 306aaca

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

Runtime/Game/Requests/ClassRequests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public class LootLockerListClassTypesResponse : LootLockerResponse
4848
public class LootLockerClassTypes
4949
{
5050
public int id { get; set; }
51+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
52+
[JsonProperty("default")]
53+
#else
54+
[Json(Name = "default")]
55+
#endif
5156
public bool is_default { get; set; }
5257
public string name { get; set; }
5358
public LootLockerStorage[] storage { get; set; }
@@ -63,13 +68,23 @@ public class LootLockerLoadouts
6368

6469
public class LootLockerCreateClassRequest
6570
{
71+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
72+
[JsonProperty("default")]
73+
#else
74+
[Json(Name = "default")]
75+
#endif
6676
public bool is_default { get; set; }
6777
public string name { get; set; }
6878
public string character_type_id { get; set; }
6979
}
7080

7181
public class LootLockerUpdateClassRequest
7282
{
83+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
84+
[JsonProperty("default")]
85+
#else
86+
[Json(Name = "default")]
87+
#endif
7388
public bool is_default { get; set; }
7489
public string name { get; set; }
7590
}
@@ -107,6 +122,11 @@ public class LootLockerClass
107122
public string type { get; set; }
108123
public string name { get; set; }
109124
public string ulid { get; set; }
125+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
126+
[JsonProperty("default")]
127+
#else
128+
[Json(Name = "default")]
129+
#endif
110130
public bool is_default { get; set; }
111131
}
112132

Runtime/Game/Requests/HeroRequest.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
using System;
22
using LootLocker.Requests;
3+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
4+
using Newtonsoft.Json;
5+
#else
6+
using LLlibs.ZeroDepJson;
7+
#endif
38

49
namespace LootLocker.Requests
510
{
@@ -46,6 +51,11 @@ public class LootLockerPlayerHero
4651
public int instance_id { get; set; }
4752
public string hero_name { get; set; }
4853
public string character_name { get; set; }
54+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
55+
[JsonProperty("default")]
56+
#else
57+
[Json(Name = "default")]
58+
#endif
4959
public bool is_default { get; set; }
5060
public LootLockerCommonAsset asset { get; set; }
5161
}
@@ -54,6 +64,11 @@ public class LootLockerCreateHeroRequest
5464
{
5565
public int hero_id { get; set; }
5666
public string name { get; set; }
67+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
68+
[JsonProperty("default")]
69+
#else
70+
[Json(Name = "default")]
71+
#endif
5772
public bool is_default { get; set; }
5873
}
5974

@@ -62,12 +77,22 @@ public class LootLockerCreateHeroWithVariationRequest
6277
public int hero_id { get; set; }
6378
public string name { get; set; }
6479
public int asset_variation_id { get; set; }
80+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
81+
[JsonProperty("default")]
82+
#else
83+
[Json(Name = "default")]
84+
#endif
6585
public bool is_default { get; set; }
6686
}
6787

6888
public class LootLockerUpdateHeroRequest
6989
{
7090
public string name { get; set; }
91+
#if LOOTLOCKER_USE_NEWTONSOFTJSON
92+
[JsonProperty("default")]
93+
#else
94+
[Json(Name = "default")]
95+
#endif
7196
public bool is_default { get; set; }
7297
}
7398

0 commit comments

Comments
 (0)