Exemplo 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']);
        }
    }
}
Exemplo n.º 2
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;
}