Ejemplo n.º 1
0
//setup the maps data class
$MD = new MapsData();
//setup the map points data class
$MP = new MapPoints();
//start logging
$logs->add('TELEPORTER', 'Starting log session. Teleporting player: ' . $charName . ', to point: ' . $pointId . ', selected realm: ' . $RealmId . '.', 'pending');
//connect to the database
if ($chars->setRealm($RealmId)) {
    ################################################
    ####   check if the character is valid    ######
    //get some character data
    $charData = $chars->getCharacterData(false, $charName, array('guid', 'level'));
    //find the map key by pointId
    $mapKey = $MD->ResolveMapByPoint($pointId);
    //get the map data
    $mapData = $MD->get($mapKey);
    if (!$chars->isMyCharacter(false, $charName)) {
        $ERRORS->Add('The selected character does not belong to this account.');
        //update the log
        $logs->update(false, 'The selected character belongs to another account.', 'error');
    } else {
        if ($mapData['reqLevel'] > $charData['level']) {
            $ERRORS->Add('The selected character does not meet the level requirement. The location requires a minimum of atleast ' . $charData['level'] . ' level.');
            //update the log
            $logs->update(false, 'The selected character does not meet the level requirement. The location requires a minimum of atleast ' . $charData['level'] . ' level.', 'error');
        } else {
            //get the coords
            if ($coords = $MP->get($pointId)) {
                //if the character is Online use SOAP to teleport using commands
                if ($chars->isCharacterOnline($charData['guid'])) {
                    //try teleporting using soap
Ejemplo n.º 2
0
<?php

if (!defined('init_ajax')) {
    header('HTTP/1.0 404 not found');
    exit;
}
$key = isset($_GET['key']) ? $_GET['key'] : false;
//setup the maps data class
$MD = new MapsData();
//get the map data
$data = $MD->get($key);
//free memory
unset($MD);
//print the doc type
echo '<?xml version="1.0" encoding="UTF-8"?>';
//check if that key is valid
if (!$data) {
    echo '<error>The map key is invalid.</error>';
} else {
    echo '
	<info>
		<name>', $data['name'], '</name>
		<minLevel>', $data['minLevel'], '</minLevel>
		<maxLevel>', $data['maxLevel'], '</maxLevel>
		<type>', $data['type'], '</type>
		<zone>', $data['mapId'], '</zone>
		<points count="', count($data['points']), '">';
    //check if we got some points
    if (count($data['points']) > 0) {
        foreach ($data['points'] as $point) {
            echo '<point styleTop="', $point['top'], '" styleLeft="', $point['left'], '" pointId="', $point['pointId'], '"></point>';