Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
el3ab-Player
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
el3ab-Player
Commits
488a5d70
Commit
488a5d70
authored
May 26, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: correct time_control + result enum values for matches table
Co-Authored-By:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
a43f91fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
game.php
api/game.php
+11
-2
No files found.
api/game.php
View file @
488a5d70
...
@@ -47,12 +47,21 @@ switch ($action) {
...
@@ -47,12 +47,21 @@ switch ($action) {
$userRes
=
supabase_auth
(
'user'
,
[],
$token
,
'GET'
);
$userRes
=
supabase_auth
(
'user'
,
[],
$token
,
'GET'
);
$userId
=
$userRes
[
'data'
][
'id'
]
??
null
;
$userId
=
$userRes
[
'data'
][
'id'
]
??
null
;
$tcMap
=
[
'60_0'
=>
'bullet_1_0'
,
'60_1'
=>
'bullet_1_1'
,
'120_1'
=>
'bullet_2_1'
,
'180_0'
=>
'blitz_3_0'
,
'180_2'
=>
'blitz_3_2'
,
'300_0'
=>
'blitz_5_0'
,
'300_3'
=>
'blitz_5_3'
,
'600_0'
=>
'rapid_10_0'
,
'600_5'
=>
'rapid_10_5'
,
'900_10'
=>
'rapid_15_10'
,
'1800_0'
=>
'rapid_30_0'
,
];
$tcKey
=
$timeControl
.
'_'
.
$increment
;
$tcEnum
=
$tcMap
[
$tcKey
]
??
'custom'
;
$matchData
=
[
$matchData
=
[
'match_type'
=>
'bot'
,
'match_type'
=>
'bot'
,
'bot_id'
=>
$botId
,
'bot_id'
=>
$botId
,
'bot_difficulty'
=>
$botId
,
'bot_difficulty'
=>
$botId
,
'status'
=>
'in_progress'
,
'status'
=>
'in_progress'
,
'time_control'
=>
$t
imeControl
<=
180
?
'bullet'
:
(
$timeControl
<=
600
?
'blitz'
:
'rapid'
)
,
'time_control'
=>
$t
cEnum
,
'initial_time_ms'
=>
$timeControl
*
1000
,
'initial_time_ms'
=>
$timeControl
*
1000
,
'increment_ms'
=>
$increment
*
1000
,
'increment_ms'
=>
$increment
*
1000
,
'white_time_remaining_ms'
=>
$timeControl
*
1000
,
'white_time_remaining_ms'
=>
$timeControl
*
1000
,
...
@@ -146,7 +155,7 @@ switch ($action) {
...
@@ -146,7 +155,7 @@ switch ($action) {
$finalFen
=
$input
[
'final_fen'
]
??
''
;
$finalFen
=
$input
[
'final_fen'
]
??
''
;
$moves
=
$input
[
'moves'
]
??
null
;
$moves
=
$input
[
'moves'
]
??
null
;
$resultMap
=
[
'win'
=>
'white_win
'
,
'loss'
=>
'black_win
'
,
'draw'
=>
'draw'
];
$resultMap
=
[
'win'
=>
'white_win
s'
,
'loss'
=>
'black_wins
'
,
'draw'
=>
'draw'
];
if
(
$gameId
&&
!
str_starts_with
(
$gameId
,
'game_'
))
{
if
(
$gameId
&&
!
str_starts_with
(
$gameId
,
'game_'
))
{
$update
=
[
$update
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment