Commit 4d60b77
committed
hotfix: ranks module using wrong map leaderboard
* The ranks module was using the `global_[event_]records` SQL views to
compare with the Redis leaderboard to, fetch the rank of a player on a
map. However, when retrieving the rank of a player not in an event
context, it uses the `global_records` SQL view. This view doesn't show
records made on a map made specifically for an event (e.g. the
Benchmark version of a map in the Benchmark 2 event). Thus, when
retrieving the rank of a player not in an event context, but for a
Benchmark version of a map, it was always seeing an empty leaderboard,
because of the SQL view that is used. The fix is simply to not use
these views, but to fetch the records from the `records` SQL table
directly, and grouping by the player.
* Change an `if let` to a `match` expression.
Refs: d64657c, e85754c, 63839791 parent 0a985e3 commit 4d60b77
File tree
4 files changed
+33
-55
lines changed- crates
- game_api
- src/http
- records_lib
- src
4 files changed
+33
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 194 | + | |
| 195 | + | |
198 | 196 | | |
199 | 197 | | |
200 | 198 | | |
201 | 199 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 200 | + | |
| 201 | + | |
205 | 202 | | |
206 | 203 | | |
207 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
305 | 300 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
315 | 308 | | |
316 | 309 | | |
317 | 310 | | |
| |||
327 | 320 | | |
328 | 321 | | |
329 | 322 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
| 323 | + | |
| 324 | + | |
335 | 325 | | |
336 | | - | |
337 | 326 | | |
338 | 327 | | |
339 | 328 | | |
| |||
423 | 412 | | |
424 | 413 | | |
425 | 414 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
| 415 | + | |
435 | 416 | | |
436 | 417 | | |
437 | 418 | | |
| |||
0 commit comments