diff --git a/code/web/public_php/login/r2_login.php b/code/web/public_php/login/r2_login.php index 2558a0410..c0f77b527 100755 --- a/code/web/public_php/login/r2_login.php +++ b/code/web/public_php/login/r2_login.php @@ -259,35 +259,28 @@ function checkUserValidity($login, $password, $clientApplication, $cp, &$id, &$r $res = false; } } else { + // // check if the user not already online + // if ($row["State"] != "Offline") { + // $reason = "$login is already online and "; + // // ask the LS to remove the client + // if (disconnectClient($row["ShardId"], $row["UId"], $tempres)) { + // $reason = $reason . "was just disconnected. Now you can retry the identification (error code 54)"; - // // check if the user not already online - // if ($row["State"] != "Offline") - // { - // $reason = "$login is already online and "; - // // ask the LS to remove the client - // if (disconnectClient ($row["ShardId"], $row["UId"], $tempres)) - // { - // $reason = $reason."was just disconnected. Now you can retry the identification (error code 54)"; - // - // $query = "update shard set NbPlayers=NbPlayers-1 where ShardId=".$row["ShardId"]; - // $result = mysqli_query ($link, $query) or die ("Can't execute the query: '$query' errno:".mysqli_errno($link).": ".mysqli_error($link)); - // - // $query = "update user set ShardId=-1, State='Offline' where UId=".$row["UId"]; - // $result = mysqli_query ($link, $query) or die ("Can't execute the query: '$query' errno:".mysqli_errno($link).": ".mysqli_error($link)); - // } - // else - // { - // $reason = $reason."can't be disconnected: $tempres (error code 55)"; - // } - // $res = false; - // } - // else - // { + // $query = "update shard set NbPlayers=NbPlayers-1 where ShardId=" . $row["ShardId"]; + // $result = mysqli_query($link, $query) or die("Can't execute the query: '$query' errno:" . mysqli_errno($link) . ": " . mysqli_error($link)); + + // $query = "update user set ShardId=-1, State='Offline' where UId=" . $row["UId"]; + // $result = mysqli_query($link, $query) or die("Can't execute the query: '$query' errno:" . mysqli_errno($link) . ": " . mysqli_error($link)); + // } else { + // $reason = $reason . "can't be disconnected: $tempres (error code 55)"; + // } + // $res = false; + // } else { $id = $row["UId"]; $priv = $row["Privilege"]; $extended = $row["ExtendedPrivilege"]; $res = true; -// } + // } } } } else {