-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
104 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; achievement_defs : Stub.Achievement.t list | ||
{ result : Stub.Community.Response.t | ||
; achievement_defs : Stub.Community.Achievement.t list | ||
} | ||
|
||
let to_json r = | ||
`Assoc | ||
[ "result", Stub.Response.to_json r.result | ||
; "achievementDefs", `List (List.map Stub.Achievement.to_json r.achievement_defs) | ||
[ "result", Stub.Community.Response.to_json r.result | ||
; "achievementDefs", `List (List.map Stub.Community.Achievement.to_json r.achievement_defs) | ||
] | ||
;; | ||
|
||
let from_json json = | ||
let open Yojson.Basic.Util in | ||
{ result = json |> member "result" |> Stub.Response.from_json | ||
; achievement_defs = json |> member "achievementDefs" |> to_list |> List.map Stub.Achievement.from_json | ||
{ result = json |> member "result" |> Stub.Community.Response.from_json | ||
; achievement_defs = json |> member "achievementDefs" |> to_list |> List.map Stub.Community.Achievement.from_json | ||
} | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; matches : Stub.Advertisement.t list | ||
; avatars : Stub.Avatar.t list | ||
{ result : Stub.Community.Response.t | ||
; matches : Stub.Community.Advertisement.t list | ||
; avatars : Stub.Community.Avatar.t list | ||
} | ||
|
||
let to_json r = | ||
`Assoc | ||
[ "result", Stub.Response.to_json r.result | ||
; "avatars", `List (List.map Stub.Avatar.to_json r.avatars) | ||
; "matches", `List (List.map Stub.Advertisement.to_json r.matches) | ||
[ "result", Stub.Community.Response.to_json r.result | ||
; "avatars", `List (List.map Stub.Community.Avatar.to_json r.avatars) | ||
; "matches", `List (List.map Stub.Community.Advertisement.to_json r.matches) | ||
] | ||
;; | ||
|
||
let from_json json = | ||
let open Yojson.Basic.Util in | ||
{ result = json |> member "result" |> Stub.Response.from_json | ||
; matches = json |> member "matches" |> to_list |> List.map Stub.Advertisement.from_json | ||
; avatars = json |> member "avatars" |> to_list |> List.map Stub.Avatar.from_json | ||
{ result = json |> member "result" |> Stub.Community.Response.from_json | ||
; matches = json |> member "matches" |> to_list |> List.map Stub.Community.Advertisement.from_json | ||
; avatars = json |> member "avatars" |> to_list |> List.map Stub.Community.Avatar.from_json | ||
} | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; avatar_stats_for_profile : Stub.Avatar_stat.t list | ||
{ result : Stub.Community.Response.t | ||
; avatar_stats_for_profile : Stub.Community.Avatar_stat.t list | ||
} | ||
|
||
let to_json r = | ||
`Assoc | ||
[ "result", Stub.Response.to_json r.result | ||
; "avatarStatsForProfile", `List (List.map Stub.Avatar_stat.to_json r.avatar_stats_for_profile) | ||
[ "result", Stub.Community.Response.to_json r.result | ||
; "avatarStatsForProfile", `List (List.map Stub.Community.Avatar_stat.to_json r.avatar_stats_for_profile) | ||
] | ||
;; | ||
|
||
let from_json json = | ||
let open Yojson.Basic.Util in | ||
{ result = Yojson.Basic.Util.(json |> member "result" |> Stub.Response.from_json) | ||
{ result = Yojson.Basic.Util.(json |> member "result" |> Stub.Community.Response.from_json) | ||
; avatar_stats_for_profile = | ||
json |> member "avatarStatsForProfile" |> to_list |> List.map Stub.Avatar_stat.from_json | ||
json |> member "avatarStatsForProfile" |> to_list |> List.map Stub.Community.Avatar_stat.from_json | ||
} | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; clans : Stub.Clan.t list | ||
{ result : Stub.Community.Response.t | ||
; clans : Stub.Community.Clan.t list | ||
} | ||
|
||
let to_json r = | ||
`Assoc [ "result", Stub.Response.to_json r.result; "clans", `List (List.map Stub.Clan.to_json r.clans) ] | ||
`Assoc | ||
[ "result", Stub.Community.Response.to_json r.result | ||
; "clans", `List (List.map Stub.Community.Clan.to_json r.clans) | ||
] | ||
;; | ||
|
||
let from_json json = | ||
let open Yojson.Basic.Util in | ||
{ result = json |> member "result" |> Stub.Response.from_json | ||
; clans = json |> member "clans" |> to_list |> List.map Stub.Clan.from_json | ||
{ result = json |> member "result" |> Stub.Community.Response.from_json | ||
; clans = json |> member "clans" |> to_list |> List.map Stub.Community.Clan.from_json | ||
} | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; clan : Stub.Clan_info.t | ||
{ result : Stub.Community.Response.t | ||
; clan : Stub.Community.Clan_info.t | ||
} | ||
|
||
let to_json r = `Assoc [ "result", Stub.Response.to_json r.result; "clan", Stub.Clan_info.to_json r.clan ] | ||
let to_json r = | ||
`Assoc [ "result", Stub.Community.Response.to_json r.result; "clan", Stub.Community.Clan_info.to_json r.clan ] | ||
;; | ||
|
||
let from_json json = | ||
let open Yojson.Basic.Util in | ||
{ result = json |> member "result" |> Stub.Response.from_json | ||
; clan = json |> member "clan" |> Stub.Clan_info.from_json | ||
{ result = json |> member "result" |> Stub.Community.Response.from_json | ||
; clan = json |> member "clan" |> Stub.Community.Clan_info.from_json | ||
} | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; communityEvents : Stub.Community_event.t list | ||
{ result : Stub.Community.Response.t | ||
; communityEvents : Stub.Community.Community_event.t list | ||
} | ||
|
||
let to_json r = | ||
`Assoc | ||
[ "result", Stub.Response.to_json r.result | ||
; "communityEvents", `List (List.map Stub.Community_event.to_json r.communityEvents) | ||
[ "result", Stub.Community.Response.to_json r.result | ||
; "communityEvents", `List (List.map Stub.Community.Community_event.to_json r.communityEvents) | ||
] | ||
;; | ||
|
||
let from_json json = | ||
let open Yojson.Basic.Util in | ||
{ result = json |> member "result" |> Stub.Response.from_json | ||
; communityEvents = json |> member "communityEvents" |> to_list |> List.map Stub.Community_event.from_json | ||
{ result = json |> member "result" |> Stub.Community.Response.from_json | ||
; communityEvents = | ||
json |> member "communityEvents" |> to_list |> List.map Stub.Community.Community_event.from_json | ||
} | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; item_instances_by_profile_id : (string * Stub.Inventory.t list) list | ||
{ result : Stub.Community.Response.t | ||
; item_instances_by_profile_id : (string * Stub.Community.Inventory.t list) list | ||
} | ||
|
||
let to_json r = | ||
`Assoc | ||
[ "result", Stub.Response.to_json r.result | ||
[ "result", Stub.Community.Response.to_json r.result | ||
; ( "itemInstancesByProfileID" | ||
, `List | ||
(List.map | ||
(fun (profile_id, items) -> `Assoc [ profile_id, `List (List.map Stub.Inventory.to_json items) ]) | ||
(fun (profile_id, items) -> | ||
`Assoc [ profile_id, `List (List.map Stub.Community.Inventory.to_json items) ]) | ||
r.item_instances_by_profile_id) ) | ||
] | ||
;; | ||
|
||
let from_json json = | ||
let open Yojson.Basic.Util in | ||
{ result = json |> member "result" |> Stub.Response.from_json | ||
{ result = json |> member "result" |> Stub.Community.Response.from_json | ||
; item_instances_by_profile_id = | ||
json | ||
|> member "itemInstancesByProfileID" | ||
|> to_list | ||
|> List.map (fun json -> | ||
match json with | ||
| `Assoc [ (profile_id, `List items) ] -> profile_id, List.map Stub.Inventory.from_json items | ||
| `Assoc [ (profile_id, `List items) ] -> profile_id, List.map Stub.Community.Inventory.from_json items | ||
| _ -> failwith "JSON structure mismatch") | ||
} | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; leaderboards : Stub.Leaderboard.t list | ||
; match_types : Stub.Match_type.t list | ||
; races : Stub.Race.t list | ||
; leaderboard_regions : Stub.Leaderboard_region.t list | ||
{ result : Stub.Community.Response.t | ||
; leaderboards : Stub.Community.Leaderboard.t list | ||
; match_types : Stub.Community.Match_type.t list | ||
; races : Stub.Community.Race.t list | ||
; leaderboard_regions : Stub.Community.Leaderboard_region.t list | ||
(*; factions : string list (* Theres no docs for this so i have to disable it for now. It's been empty for every | ||
game. *) *) | ||
} | ||
|
||
let to_json r = | ||
`Assoc | ||
[ "result", Stub.Response.to_json r.result | ||
; "leaderboards", `List (List.map Stub.Leaderboard.to_json r.leaderboards) | ||
; "matchTypes", `List (List.map Stub.Match_type.to_json r.match_types) | ||
; "races", `List (List.map Stub.Race.to_json r.races) | ||
; "leaderboardRegions", `List (List.map Stub.Leaderboard_region.to_json r.leaderboard_regions) | ||
[ "result", Stub.Community.Response.to_json r.result | ||
; "leaderboards", `List (List.map Stub.Community.Leaderboard.to_json r.leaderboards) | ||
; "matchTypes", `List (List.map Stub.Community.Match_type.to_json r.match_types) | ||
; "races", `List (List.map Stub.Community.Race.to_json r.races) | ||
; "leaderboardRegions", `List (List.map Stub.Community.Leaderboard_region.to_json r.leaderboard_regions) | ||
] | ||
;; | ||
|
||
let from_json json = | ||
{ result = Yojson.Basic.Util.(json |> member "result" |> Stub.Response.from_json) | ||
{ result = Yojson.Basic.Util.(json |> member "result" |> Stub.Community.Response.from_json) | ||
; leaderboards = | ||
Yojson.Basic.Util.(json |> member "leaderboards" |> to_list |> List.map Stub.Leaderboard.from_json) | ||
; match_types = Yojson.Basic.Util.(json |> member "matchTypes" |> to_list |> List.map Stub.Match_type.from_json) | ||
; races = Yojson.Basic.Util.(json |> member "races" |> to_list |> List.map Stub.Race.from_json) | ||
Yojson.Basic.Util.(json |> member "leaderboards" |> to_list |> List.map Stub.Community.Leaderboard.from_json) | ||
; match_types = | ||
Yojson.Basic.Util.(json |> member "matchTypes" |> to_list |> List.map Stub.Community.Match_type.from_json) | ||
; races = Yojson.Basic.Util.(json |> member "races" |> to_list |> List.map Stub.Community.Race.from_json) | ||
; leaderboard_regions = | ||
Yojson.Basic.Util.( | ||
json |> member "leaderboardRegions" |> to_list |> List.map Stub.Leaderboard_region.from_json) | ||
json |> member "leaderboardRegions" |> to_list |> List.map Stub.Community.Leaderboard_region.from_json) | ||
} | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
type t = | ||
{ result : Stub.Response.t | ||
; stat_groups : Stub.Stat_group.t list | ||
; leaderboard_stats : Stub.Leaderboard_stat.t list | ||
{ result : Stub.Community.Response.t | ||
; stat_groups : Stub.Community.Stat_group.t list | ||
; leaderboard_stats : Stub.Community.Leaderboard_stat.t list | ||
; rank_total : int | ||
} | ||
|
||
let to_json l = | ||
`Assoc | ||
[ "result", Stub.Response.to_json l.result | ||
; "statGroups", `List (List.map Stub.Stat_group.to_json l.stat_groups) | ||
; "leaderboardStats", `List (List.map Stub.Leaderboard_stat.to_json l.leaderboard_stats) | ||
[ "result", Stub.Community.Response.to_json l.result | ||
; "statGroups", `List (List.map Stub.Community.Stat_group.to_json l.stat_groups) | ||
; "leaderboardStats", `List (List.map Stub.Community.Leaderboard_stat.to_json l.leaderboard_stats) | ||
; "rankTotal", `Int l.rank_total | ||
] | ||
;; | ||
|
||
let from_json json = | ||
let open Yojson.Basic.Util in | ||
{ result = json |> member "result" |> Stub.Response.from_json | ||
; stat_groups = json |> member "statGroups" |> to_list |> List.map Stub.Stat_group.from_json | ||
; leaderboard_stats = json |> member "leaderboardStats" |> to_list |> List.map Stub.Leaderboard_stat.from_json | ||
{ result = json |> member "result" |> Stub.Community.Response.from_json | ||
; stat_groups = json |> member "statGroups" |> to_list |> List.map Stub.Community.Stat_group.from_json | ||
; leaderboard_stats = | ||
json |> member "leaderboardStats" |> to_list |> List.map Stub.Community.Leaderboard_stat.from_json | ||
; rank_total = json |> member "rankTotal" |> to_int | ||
} | ||
;; |
Oops, something went wrong.