本文整理汇总了PHP中server::getRealmId方法的典型用法代码示例。如果您正苦于以下问题:PHP server::getRealmId方法的具体用法?PHP server::getRealmId怎么用?PHP server::getRealmId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server
的用法示例。
在下文中一共展示了server::getRealmId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: revive
public static function revive($guid, $char_db)
{
$guid = (int) $guid;
$rid = server::getRealmId($char_db);
connect::connectToRealmDB($rid);
if (character::isOnline($guid) == TRUE) {
echo '<b class="red_text">Please log out your character before proceeding.';
} else {
if ($GLOBALS['service']['revive']['currency'] == 'vp') {
if (account::hasVP($_SESSION['cw_user'], $GLOBALS['service']['unstuck']['price']) == FALSE) {
die('<b class="red_text">Not enough Vote Points!</b>');
} else {
account::deductVP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service']['revive']['price']);
}
}
if ($GLOBALS['service']['revive']['currency'] == 'dp') {
if (account::hasDP($_SESSION['cw_user'], $GLOBALS['service']['unstuck']['price']) == FALSE) {
die('<b class="red_text">Not enough ' . $GLOBALS['donation']['coins_name'] . '</b>');
} else {
account::deductDP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service']['revive']['price']);
}
}
mysql_query("DELETE FROM character_aura WHERE guid = '" . $guid . "' AND spell = '20584' OR guid = '" . $guid . "' AND spell = '8326'");
account::logThis("Performed a revive on " . character::getCharName($guid, $rid), 'Revive', $rid);
return TRUE;
}
}
示例2: mysql_query
</table>
</form>
<?php
}
if (isset($_POST['ir_step3'])) {
$guid = (int) $_POST['ir_char'];
$instance = (int) $_POST['ir_instance'];
if ($GLOBALS['service'][$service]['currency'] == "vp") {
if (account::hasVP($_SESSION['cw_user'], $GLOBALS['service'][$service]['price']) == FALSE) {
echo '<span class="alert">You do not have enough Vote Points!';
} else {
connect::selectDB($_POST['ir_realm']);
mysql_query("DELETE FROM instance WHERE id='" . $instance . "'");
account::deductVP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service'][$service]['price']);
echo '<span class="approved">The instance lock was removed!</span>';
}
} elseif ($GLOBALS['service'][$service]['currency'] == "dp") {
if (account::hasDP($_SESSION['cw_user'], $GLOBALS['service'][$service]['price']) == FALSE) {
echo '<span class="alert">You do not have enough ' . $GLOBALS['donation']['coins_name'];
} else {
connect::selectDB($_POST['ir_realm']);
mysql_query("DELETE FROM instance WHERE id='" . $instance . "'");
account::deductDP(account::getAccountID($_SESSION['cw_user']), $GLOBALS['service'][$service]['price']);
echo '<span class="approved">The instance lock was removed!</span>';
account::logThis("Performed an Instance reset on " . character::getCharName($guid, server::getRealmId($_POST['ir_realm'])), "instancereset", server::getRealmId($_POST['ir_realm']));
}
}
}
?>
<br/>
<a href="?p=instancereset">Start over</a>
示例3: mysql_real_escape_string
<td align="left" width="90%"><b><?php
echo $v;
?>
</b><br/>
</td>
</tr>
</table>
</div>
<?php
}
}
if ($_POST['action'] == 'teleport') {
$character = mysql_real_escape_string($_POST['character']);
$char_db = mysql_real_escape_string($_POST['char_db']);
$location = mysql_real_escape_string($_POST['location']);
$realm_id = server::getRealmId($_POST['char_db']);
connect::connectToRealmDB($realm_id);
$result = mysql_query("SELECT race,account,level,online FROM characters WHERE guid='" . $character . "'");
if (mysql_num_rows($result) == 0) {
die("<span class='alert'>The character does not exist on that account!</span>");
} else {
$row = mysql_fetch_assoc($result);
if ($row['online'] == 1) {
die("Please log out before teleporting.");
}
$acct = $row['account'];
$race = $row['race'];
$level = $row['level'];
if ($GLOBALS['service']['teleport']['currency'] == "vp" && $GLOBALS['service']['teleport']['price'] > 0) {
if (account::hasVP($_SESSION['cw_user'], $GLOBALS['service']['teleport']['price']) == FALSE) {
die("Insufficent Vote Points!");