Ejemplo n.º 1
0
        connect::selectDB('webdb');
        $realm = explode("*", $character_realm);
        $result = mysql_query("SELECT price FROM shopitems WHERE entry='" . $entry . "'");
        $row = mysql_fetch_assoc($result);
        $account_id = account::getAccountIDFromCharId($realm[0], $realm[1]);
        $account_name = account::getAccountName($account_id);
        if ($type == 'vote') {
            if (account::hasVP($account_name, $row['price']) == FALSE) {
                die('<b class="red_text">You do not have enough Vote Points</b>');
            }
            account::deductVP($account_id, $row['price']);
        } elseif ($type == 'donate') {
            if (account::hasDP($account_name, $row['price']) == FALSE) {
                die('<b class="red_text">You do not have enough ' . $GLOBALS['donation']['coins_name'] . '</b>');
            }
            account::deductDP($account_id, $row['price']);
        }
        shop::logItem($type, $entry, $realm[0], $account_id, $realm[1], 1);
        $result = mysql_query("SELECT * FROM realms WHERE id='" . $realm[1] . "'");
        $row = mysql_fetch_assoc($result);
        if ($row['sendType'] == 'ra') {
            require '../misc/ra.php';
            require '../classes/character.php';
            sendRa("send items " . character::getCharname($realm[0]) . " \"Your requested item\" \"Thanks for supporting us!\" " . $entry . " ", $row['rank_user'], $row['rank_pass'], $row['host'], $row['ra_port']);
        } elseif ($row['sendType'] == 'soap') {
            require '../misc/soap.php';
            require '../classes/character.php';
            sendSoap("send items " . character::getCharname($realm[0]) . " \"Your requested item\" \"Thanks for supporting us!\" " . $entry . " ", $row['rank_user'], $row['rank_pass'], $row['host'], $row['soap_port']);
        }
    }
}
Ejemplo n.º 2
0
                    // Update quantity incase of errors on the next loop
                    $_SESSION[$cart . 'Cart'][$entry]['quantity'] -= $qty;
                }
                $num = $num - $qty;
            }
            // All $entry have been sent
            unset($_SESSION[$cart . 'Cart'][$entry]);
        }
    }
    // Empty Cart
    unset($_SESSION[$cart . 'Cart']);
}
if ($_POST['action'] == 'checkout') {
    $values = explode('*', $_POST['values']);
    $realm = $values[1];
    $character = character::getCharname($values[0], $realm);
    $accountID = account::getAccountID($_SESSION['cw_user']);
    connect::selectDB('webdb');
    require '../misc/ra.php';
    process_cart('donate', $values[0], $character, $accountID, $realm);
    process_cart('vote', $values[0], $character, $accountID, $realm);
    echo TRUE;
}
if ($_POST['action'] == 'removeItem') {
    if (account::isGM($_SESSION['cw_user']) == FALSE) {
        exit;
    }
    $entry = (int) preg_replace("/[^0-9]/", "", $_POST['entry']);
    $shop = mysql_real_escape_string($_POST['shop']);
    connect::selectDB('webdb');
    mysql_query("DELETE FROM shopitems WHERE entry='" . $entry . "' AND in_shop='" . $shop . "'");
Ejemplo n.º 3
0
            $command = "rename";
            $info = "Character rename";
            break;
        case 'faction':
            $command = "changefaction";
            $info = "Faction change";
            break;
        case 'race':
            $command = "changerace";
            $info = "Race change";
            break;
    }
    connect::selectDB('webdb');
    $getRA = mysql_query("SELECT sendType,host,ra_port,soap_port,rank_user,rank_pass FROM realms WHERE id='" . $realm_id . "'");
    $row = mysql_fetch_assoc($getRA);
    if ($row['sendType'] == 'ra') {
        require '../misc/ra.php';
        sendRa("character " . $command . " " . character::getCharname($guid, $realm_id), $row['rank_user'], $row['rank_pass'], $row['host'], $row['ra_port']);
    } elseif ($row['sendType'] == "soap") {
        require '../misc/soap.php';
        sendSoap("character " . $command . " " . character::getCharname($guid, $realm_id), $row['rank_user'], $row['rank_pass'], $row['host'], $row['soap_port']);
    }
    if ($GLOBALS['service'][$serviceX]['currency'] == 'vp') {
        account::deductVP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service'][$serviceX]['price']);
    }
    if ($GLOBALS['service'][$serviceX]['currency'] == 'dp') {
        account::deductDP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service'][$serviceX]['price']);
    }
    account::logThis("Performed a " . $info . " on " . character::getCharName($guid, $realm_id), $serviceX, $realm_id);
    echo true;
}