fix: harden troop processing race conditions (#98) (#138)

This commit is contained in:
Emerson Freitas
2026-03-17 15:13:14 -03:00
committed by GitHub
parent bf9e48d5cf
commit a7bdac8392
4 changed files with 62 additions and 22 deletions
+10
View File
@@ -5684,6 +5684,16 @@ References: User ID/Message ID, Mode
return mysqli_query($this->dblink,$q);
}
function claimA2b($id, $ckey) {
$id = (int)$id;
list($ckey) = $this->escape_input($ckey);
$q = "DELETE FROM " . TB_PREFIX . "a2b WHERE id = $id AND ckey = '".$ckey."' LIMIT 1";
mysqli_query($this->dblink, $q);
return (mysqli_affected_rows($this->dblink) === 1);
}
// no need to cache this method
function getA2b($ckey) {
list($ckey) = $this->escape_input($ckey);