Exemplo n.º 1
0
}
if (!($r = $db_login->query("SELECT * FROM Login WHERE LoginID = '{$playerID}'")) || !$r->nextRow()) {
    echo "DELETE PLAYER {$playerID}: No such Login\r\n";
    exit(1);
}
echo "DELETE PLAYER {$playerID}: Delete Login ";
if (!$db_login->query("DELETE FROM Login WHERE loginID = '{$playerID}' ")) {
    echo "FAILURE\r\n";
    exit(1);
}
echo "SUCCESS\r\n";
if (!($db_game = new Db($config->DB_HOST, $config->DB_USER, $config->DB_PWD, $config->DB_NAME))) {
    echo "DELETE PLAYER {$playerID}: Failed to connect to game db.\r\n";
    exit(1);
}
if ($tag = tribe_getTagOfPlayerID($playerID, $db_game)) {
    echo "DELETE PLAYER {$playerID}: Leave Player ";
    if (tribe_processLeave($playerID, $tag, $db_game, 1) != 2) {
        echo "FAILURE\r\n";
    } else {
        echo "SUCCESS\r\n";
    }
}
echo "DELETE PLAYER {$playerID}: Delete Player ";
if (!$db_game->query("DELETE FROM Player WHERE playerID = '{$playerID}' ")) {
    echo "FAILURE\r\n";
} else {
    echo "SUCCESS\r\n";
}
echo "DELETE PLAYER {$playerID}: Delete Cave_takeover";
if (!$db_game->query("DELETE FROM Cave_takeover WHERE playerID = '{$playerID}' ")) {
Exemplo n.º 2
0
}
$sqlSelect->closeCursor();
echo "DELETE PLAYER {$playerID}: Delete Login ";
$sqlDelete = $db_login->prepare("DELETE FROM Login WHERE loginID = :playerID");
$sqlDelete->bindValue('playerID', $playerID, PDO::PARAM_INT);
if (!$sqlDelete->execute()) {
    echo "FAILURE\n";
    exit(1);
}
echo "SUCCESS\n";
if (!($db_game = DbConnect())) {
    echo "DELETE PLAYER {$playerID}: Failed to connect to game db.\n";
    exit(1);
}
$db = $db_game;
if ($tag = tribe_getTagOfPlayerID($playerID)) {
    echo "DELETE PLAYER {$playerID}: Leave Player ";
    if (tribe_processLeave($playerID, $tag, 1) != 2) {
        echo "FAILURE\n";
    } else {
        echo "SUCCESS\n";
    }
}
echo "DELETE PLAYER {$playerID}: Delete Player ";
$sql = $db_game->prepare("DELETE FROM " . PLAYER_TABLE . " WHERE playerID = :playerID");
$sql->bindValue('playerID', $playerID, PDO::PARAM_INT);
if (!$sql->execute()) {
    echo "FAILURE\n";
} else {
    echo "SUCCESS\n";
}