-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbdapi_models.go
309 lines (278 loc) · 9.73 KB
/
bdapi_models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
// These are copied directly from the bd-api repo. I may make the models importable at some point, but
// for now this will do.
package main
import (
"time"
"github.com/leighmacdonald/steamid/v4/steamid"
"github.com/leighmacdonald/steamweb/v2"
)
type Site string
const (
Skial Site = "skial"
GFL Site = "gfl"
Spaceship Site = "spaceship"
UGC Site = "ugc"
SirPlease Site = "sirplease"
Vidyagaems Site = "vidyagaems"
OWL Site = "owl"
ZMBrasil Site = "zmbrasil"
Dixigame Site = "dixigame"
ScrapTF Site = "scraptf"
Wonderland Site = "wonderland"
LazyPurple Site = "lazypurple"
FirePowered Site = "firepowered"
Harpoon Site = "harpoongaming"
Panda Site = "panda"
NeonHeights Site = "neonheights"
Pancakes Site = "pancakes"
Loos Site = "loos"
PubsTF Site = "pubstf"
ServiLiveCl Site = "servilivecl"
CutiePie Site = "cutiepie"
SGGaming Site = "sggaming"
ApeMode Site = "apemode"
MaxDB Site = "maxdb"
SvdosBrothers Site = "svdosbrothers"
Electric Site = "electric"
GlobalParadise Site = "globalparadise"
SavageServidores Site = "savageservidores"
CSIServers Site = "csiservers"
LBGaming Site = "lbgaming"
FluxTF Site = "fluxtf"
DarkPyro Site = "darkpyro"
OpstOnline Site = "opstonline"
BouncyBall Site = "bouncyball"
FurryPound Site = "furrypound"
RetroServers Site = "retroservers"
SwapShop Site = "swapshop"
ECJ Site = "ecj"
JumpAcademy Site = "jumpacademy"
TF2Ro Site = "tf2ro"
SameTeem Site = "sameteem"
PowerFPS Site = "powerfps"
SevenMau Site = "7mau"
GhostCap Site = "ghostcap"
Spectre Site = "spectre"
DreamFire Site = "dreamfire"
Setti Site = "setti"
GunServer Site = "gunserver"
HellClan Site = "hellclan"
Sneaks Site = "sneaks"
Nide Site = "nide"
AstraMania Site = "astramania"
TF2Maps Site = "tf2maps"
PetrolTF Site = "petroltf"
VaticanCity Site = "vaticancity"
LazyNeer Site = "lazyneer"
TheVille Site = "theville"
Oreon Site = "oreon"
TriggerHappy Site = "triggerhappy"
Defusero Site = "defusero"
Tawerna Site = "tawerna"
TitanTF Site = "titan"
DiscFF Site = "discff"
Otaku Site = "otaku"
AMSGaming Site = "amsgaming"
BaitedCommunity Site = "baitedcommunity"
CedaPug Site = "cedapug"
GameSites Site = "gamesites"
BachuruServas Site = "bachuruservas"
Bierwiese Site = "bierwiese"
AceKill Site = "acekill"
Magyarhns Site = "magyarhns"
GamesTown Site = "gamestown"
ProGamesZet Site = "progameszet"
G44 Site = "g44"
CuteProject Site = "cuteproject"
PhoenixSource Site = "phoenixsource"
SlavonServer Site = "slavonserver"
GetSome Site = "getsome"
Rushy Site = "rushy"
MoeVsMachine Site = "moevsmachine"
Prwh Site = "prwh"
Vortex Site = "vortex"
CasualFun Site = "casualfun"
RandomTF2 Site = "randomtf2"
PlayersRo Site = "playesro"
EOTLGaming Site = "eotlgaming"
BioCrafting Site = "biocrafting"
BigBangGamers Site = "bigbanggamers"
EpicZone Site = "epiczone"
Zubat Site = "zubat"
Lunario Site = "lunario"
)
type EconBanState int
const (
EconBanNone EconBanState = iota
EconBanProbation
EconBanBanned
)
type TimeStamped struct {
UpdatedOn time.Time `json:"-"`
CreatedOn time.Time `json:"created_on"`
}
type PlayerNameRecord struct {
NameID int64 `json:"name_id"`
SteamID steamid.SteamID `json:"steam_id"`
PersonaName string `json:"persona_name"`
CreatedOn time.Time `json:"created_on"`
}
type PlayerAvatarRecord struct {
AvatarID int64 `json:"avatar_id"`
SteamID steamid.SteamID `json:"steam_id"`
AvatarHash string `json:"avatar_hash"`
CreatedOn time.Time `json:"created_on"`
}
type PlayerVanityRecord struct {
VanityID int64 `json:"vanity_id"`
SteamID steamid.SteamID `json:"steam_id"`
Vanity string `json:"vanity"`
CreatedOn time.Time `json:"created_on"`
}
type Player struct {
SteamID steamid.SteamID `json:"steam_id"`
CommunityVisibilityState steamweb.VisibilityState `json:"community_visibility_state"`
ProfileState steamweb.ProfileState `json:"profile_state"`
PersonaName string `json:"persona_name"`
Vanity string `json:"vanity"`
AvatarHash string `json:"avatar_hash"`
PersonaState steamweb.PersonaState `json:"persona_state"`
RealName string `json:"real_name"`
TimeCreated time.Time `json:"time_created"`
LocCountryCode string `json:"loc_country_code"`
LocStateCode string `json:"loc_state_code"`
LocCityID int `json:"loc_city_id"`
CommunityBanned bool `json:"community_banned"`
VacBanned bool `json:"vac_banned"`
LastBannedOn time.Time `json:"last_banned_on"`
GameBans int `json:"game_bans"`
EconomyBanned EconBanState `json:"economy_banned"`
LogsTFCount int `json:"logs_tf_count"`
UGCUpdatedOn time.Time `json:"ugc_updated_on"`
RGLUpdatedOn time.Time `json:"rgl_updated_on"`
ETF2LUpdatedOn time.Time `json:"etf2_l_updated_on"`
LogsTFUpdatedOn time.Time `json:"logs_tf_updated_on"`
TimeStamped
}
type SbBanRecord struct {
BanID int `json:"ban_id"`
SiteName Site `json:"site_name"`
SiteID int `json:"site_id"`
PersonaName string `json:"persona_name"`
SteamID steamid.SteamID `json:"steam_id"`
Reason string `json:"reason"`
Duration time.Duration `json:"duration"`
Permanent bool `json:"permanent"`
TimeStamped
}
type SbSite struct {
SiteID int `json:"site_id"`
Name Site `json:"name"`
TimeStamped
}
// Profile is a high level meta profile of several services.
type Profile struct {
Summary steamweb.PlayerSummary `json:"summary"`
BanState steamweb.PlayerBanState `json:"ban_state"`
Seasons []Season `json:"seasons"`
Friends []steamweb.Friend `json:"friends"`
SourceBans []SbBanRecord `json:"source_bans"`
LogsCount int64 `json:"logs_count"`
}
// Division tries to define a generalized ranked division order.
type Division int
// *Rough* mapping of skill for each division for sorting, 0 being invite.
const (
RGLRankInvite Division = 0
ETF2LPremiership Division = 0
UGCRankPlatinum Division = 1
ETF2LDiv1 Division = 1
RGLRankDiv1 Division = 1
RGLRankDiv2 Division = 1
ETF2LDiv2 Division = 2
RGLRankMain Division = 2
RGLRankAdvanced Division = 2
ETF2LMid Division = 3
UGCRankGold Division = 3
ETF2LLow Division = 4
RGLRankIntermediate Division = 4
ETF2LOpen Division = 5
RGLRankOpen Division = 5
UGCRankSilver Division = 6
RGLRankAmateur Division = 6
UGCRankSteel Division = 7
UGCRankIron Division = 8
RGLRankFreshMeat Division = 9
RGLRankNone Division = 10
UGCRankNone Division = 10
UnknownDivision Division = 20
)
// League represents supported leagues.
type League string
//
// const (
// leagueUGC League = "ugc"
// leagueESEA League = "esea"
// leagueETF2L League = "etf2l"
// leagueRGL League = "rgl"
//)
// Season stores generalized league season data.
type Season struct {
League League `json:"league"`
Division string `json:"division"`
DivisionInt Division `json:"division_int"`
Format string `json:"format"`
TeamName string `json:"team_name"`
}
type CompMap map[steamid.SteamID][]Season
type FriendMap map[string][]steamweb.Friend
type VacBanState steamweb.PlayerBanState
type Summary steamweb.PlayerSummary
type SourcebansMap map[string][]SbBanRecord
type BDSearchResult struct {
ListName string `json:"list_name"`
Match TF2BDPlayer `json:"match"`
}
type FileInfo struct {
Authors []string `json:"authors"`
Description string `json:"description"`
Title string `json:"title"`
UpdateURL string `json:"update_url"`
}
type LastSeen struct {
PlayerName string `json:"player_name,omitempty"`
Time int `json:"time,omitempty"`
}
type TF2BDPlayer struct {
Attributes []string `json:"attributes"`
LastSeen LastSeen `json:"last_seen,omitempty"`
Steamid any `json:"steamid"`
Proof []string `json:"proof"`
}
type TF2BDSchema struct {
Schema string `json:"$schema"` //nolint:tagliatelle
FileInfo FileInfo `json:"file_info"`
Players []TF2BDPlayer `json:"players"`
}
type BDList struct {
BDListID int
BDListName string
URL string
Game string
TrustWeight int
Deleted bool
CreatedOn time.Time
UpdatedOn time.Time
}
type BDListEntry struct {
BDListEntryID int64
BDListID int
SteamID steamid.SteamID
Attributes []string
Proof []string
LastSeen time.Time
LastName string
Deleted bool
CreatedOn time.Time
UpdatedOn time.Time
}