Пример #1
8
    if (strtolower($firstArg) == strtolower($secondArg)) {
        return "true";
    }
    return "false";
}
if (!$logged) {
    header("Location: index.php?subtopic=accountmanagement");
}
$player = new Player();
$player->loadByName($_REQUEST['name']);
if ($player->isLoaded()) {
    $account = array('sessionKey' => generateSessionKey());
    $server = array('WorldID' => 1, 'ip' => $_SERVER['SERVER_ADDR'], 'port' => 7171);
    $accountCharacters = "";
    foreach ($account_logged->getPlayersList() as $character) {
        $accountCharacters .= "<character name='" . htmlspecialchars($character->getName()) . "' worldid='" . $server['WorldID'] . "' selected='" . isSelected($player->getName(), $character->getName()) . "' />";
    }
} else {
    header("Location: index.php?subtopic=accountmanagement");
}
?>

<html>
	<head>
		<title>Tibia Flash Client</title>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<meta http-equiv="content-language" content="en" />
		<link rel="shortcut icon" href="https://a248.e.akamai.net/cipsoft.download.akamai.com/118500/tibia/static.tibia.com/images/global/general/favicon.ico" type="image/x-icon" />
		<link rel="icon" href="https://a248.e.akamai.net/cipsoft.download.akamai.com/118500/tibia/static.tibia.com/images/global/general/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="flash-regular-bin/common/style.css" />
		
Пример #2
0
 public function update(Player $object)
 {
     $q = "UPDATE " . self::TABLE . " SET `name`='" . Singleton::create("NullConverter")->fromDOMtoDB($object->getName()) . "', `teamId`='" . Singleton::create("NullConverter")->fromDOMtoDB($object->getTeamId()) . "' WHERE playerId='" . addslashes($object->getPlayerId()) . "'";
     $pk = $object->getPlayerId();
     if ($object->isNew()) {
         if (empty($pk)) {
             $q = "INSERT INTO " . self::TABLE . " (`name`, `teamId`) VALUES ('" . Singleton::create("NullConverter")->fromDOMtoDB($object->getName()) . "', '" . Singleton::create("NullConverter")->fromDOMtoDB($object->getTeamId()) . "')";
         } else {
             $q = "INSERT INTO " . self::TABLE . " (`name`, `teamId`) VALUES ('" . Singleton::create("NullConverter")->fromDOMtoDB($object->getPlayerId()) . "', '" . Singleton::create("NullConverter")->fromDOMtoDB($object->getName()) . "', '" . Singleton::create("NullConverter")->fromDOMtoDB($object->getTeamId()) . "')";
         }
     }
     $this->db->updateQuery($q);
     if (empty($pk)) {
         $pk = $this->db->selectQuery("SELECT playerId from " . self::TABLE . " ORDER BY playerId DESC limit 1")->getSingleton();
     }
     $result = $this->findByPrimaryKey($pk);
     parent::$dbCache->resetEntity("Player");
     parent::$dbCache->setSingle("Player", $pk, $result);
     return $result;
 }
Пример #3
0
 function test_Create_New_Player()
 {
     $rock = new Rock();
     $paper = new Paper();
     $scissors = new Scissors();
     //Arrange;
     $new_Player = new Player('Marika', 25, $rock);
     $name = $new_Player->getName();
     $age = $new_Player->getAge();
     $weapon = $new_Player->getWeapon();
     $new_Player->save();
     //Act;
     $result = [$name, $age, $weapon];
     //Assert;
     $this->assertEquals(['Marika', 25, $rock], $result);
 }
Пример #4
0
 public function load()
 {
     $this->clear();
     // Alfredo Rodriguez (Maryland)
     $player = new Player();
     $player->setFirstName('Alfredo');
     $player->setLastName('Rodriguez');
     $player->setHeight(72);
     $player->setWeight(180);
     $player->setBats('R');
     $player->setThrows('R');
     $player->setHometown('Oak Hill, Va.');
     $player->setCstvId(395839);
     $player->setNcaaId(993788);
     $player->save();
     print_r(sprintf("Created Player: %s (%s)\n", $player->getName(), $player->getId()));
 }
Пример #5
0
 public function addPlayer(Player $player)
 {
     if (count($this->players) >= $this->maxPlayers) {
         if ($player->hasPermission("sg.perks.join-full")) {
             // Players who have the correct permissions can join even when arenas are full.
             $m = count($this->players);
             $kick = array_keys($this->players)[rand(0, $m - 1)];
             $this->kickPlayer($this->players[$kick]["obj"], "Making space for " . $player->getName());
         } else {
             return false;
         }
     }
     $this->players[$player->getName()]["obj"] = $player;
     $this->players[$player->getName()]["pos"] = new Vector3($player->getX(), $player->getY(), $player->getZ());
     $this->players[$player->getName()]["level"] = $player->getLevel();
     $this->players[$player->getName()]["inventory"] = $player->getInventory();
     return true;
 }
Пример #6
0
 public function promote(Player $player)
 {
     $mods = $this->getMods();
     $members = $this->getMembers();
     foreach ($mods as $key => $mod) {
         if ($mod === $player->getName()) {
             unset($mods[$key]);
             array_push($members, $mod);
             $this->mods = implode(",", $mods);
             $this->members = implode(",", $members);
             $this->storeFac();
             return;
         }
     }
     foreach ($this->members as $key => $member) {
         if ($member === $player) {
             unset($members[$key]);
             $this->members = implode(",", $members);
             $this->storeFac();
             return;
         }
     }
 }
         if ($player->isLoaded()) {
             $player_account = $player->getAccount();
             if ($account_logged->getId() == $player_account->getId()) {
                 if ($_POST['changecommentsave'] == 1) {
                     $player->set("hide_char", $new_hideacc);
                     $player->set("comment", $new_comment);
                     $player->save();
                     $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url(' . $layout_name . '/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Character Information Changed</div>        <span class="CaptionVerticalRight" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url(' . $layout_name . '/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>The character information has been changed.</td></tr>          </table>        </div>  </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url(' . $layout_name . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="' . $layout_name . '/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
                 } else {
                     $main_content .= 'Here you can see and edit the information about your character.<br/>If you do not want to specify a certain field, just leave it blank.<br/><br/><form action="?subtopic=accountmanagement&action=changecomment" method="post" ><div class="TableContainer" >  <table class="Table5" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url(' . $layout_name . '/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Edit Character Information</div>        <span class="CaptionVerticalRight" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url(' . $layout_name . '/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url(' . $layout_name . '/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/content/table-shadow-rm.gif);" >  <div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr><td class="LabelV" >Name:</td><td style="width:80%;" >' . htmlspecialchars($player_name) . '</td></tr><tr><td class="LabelV" >Hide Account:</td><td>';
                     if ($player->getCustomField("hide_char") == 1) {
                         $main_content .= '<input type="checkbox" name="accountvisible"  value="1" checked="checked">';
                     } else {
                         $main_content .= '<input type="checkbox" name="accountvisible"  value="1" >';
                     }
                     $main_content .= ' check to hide your account information</td></tr>    </table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/content/table-shadow-bm.gif);" >    <div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/content/table-shadow-bl.gif);" ></div>    <div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url(' . $layout_name . '/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url(' . $layout_name . '/images/content/table-shadow-rm.gif);" >  <div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr><td class="LabelV" ><span >Comment:</span></td><td style="width:80%;" ><textarea name="comment" rows="10" cols="50" wrap="virtual" >' . $player->getCustomField("comment") . '</textarea><br>[max. length: 2000 chars, 50 lines (ENTERs)]</td></tr>    </table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url(' . $layout_name . '/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url(' . $layout_name . '/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url(' . $layout_name . '/images/content/table-shadow-br.gif);" ></div></div></div></td></tr></td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="name" value="' . htmlspecialchars($player->getName()) . '"><input type="hidden" name="changecommentsave" value="1"><div class="BigButton" style="background-image:url(' . $layout_name . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="' . $layout_name . '/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url(' . $layout_name . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="' . $layout_name . '/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
                 }
             } else {
                 $main_content .= "Error. Character <b>" . htmlspecialchars($player_name) . "</b> is not on your account.";
             }
         } else {
             $main_content .= "Error. Character with this name doesn't exist.";
         }
     } else {
         $main_content .= "Error. Name contain illegal characters.";
     }
 }
 //### DELETE character from account ###
 if ($action == "deletecharacter") {
     $player_name = trim($_POST['delete_name']);
     $password_verify = trim($_POST['delete_password']);
 public function RegisterPlayer(Player $player)
 {
     $data = new Config($this->data . "users/" . strtolower($player->getName() . ".yml"), Config::YAML);
     $data->set("XP", "0");
     $data->save();
 }
Пример #9
0
 $player = new Player();
 $player->find($name);
 if ($player->isLoaded()) {
     $number_of_rows = 0;
     $account = $player->getAccount();
     $skull = '';
     if ($player->getSkull() == 4) {
         $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>";
     } else {
         if ($player->getSkull() == 5) {
             $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>";
         }
     }
     $main_content .= '<table border="0" cellspacing="1" cellpadding="4" width="100%"><tr bgcolor="' . $config['site']['vdarkborder'] . '"><td colspan="2" style="font-weight:bold;color:white">Character Information</td></tr>';
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td width="20%">Name:</td><td style="font-weight:bold;color:' . ($player->isOnline() ? 'green' : 'red') . '">' . htmlspecialchars($player->getName()) . ' ' . $skull . ' <img src="' . $config['site']['flag_images_url'] . $account->getFlag() . $config['site']['flag_images_extension'] . '" title="Country: ' . $account->getFlag() . '" alt="' . $account->getFlag() . '" />';
     if ($player->isBanned() || $account->isBanned()) {
         $main_content .= '<span style="color:red">[BANNED]</span>';
     }
     if ($player->isNamelocked()) {
         $main_content .= '<span style="color:red">[NAMELOCKED]</span>';
     }
     $main_content .= '<br /><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player->getLookType() . '&addons=' . $player->getLookAddons() . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet() . '" alt="" /></td></tr>';
     if (in_array($player->getGroup(), $config['site']['groups_support'])) {
         $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
         $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Group:</td><td>' . htmlspecialchars(Website::getGroupName($player->getGroup())) . '</td></tr>';
     }
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Sex:</td><td>' . htmlspecialchars($player->getSex() == 0 ? 'female' : 'male') . '</td></tr>';
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Profession:</td><td>' . htmlspecialchars(Website::getVocationName($player->getVocation())) . '</td></tr>';
Пример #10
0
<?php

if (!empty($_POST)) {
    require_once 'database.php';
    require_once 'Player.php';
    $data = filter_input_array(INPUT_POST);
    try {
        $player = new Player($db, $data['playerId']);
        $player->recordSpin($data);
    } catch (Exception $ex) {
        die(json_encode(['error' => $ex->getMessage()]));
    }
    echo json_encode(['PlayerID' => $player->getId(), 'Name' => $player->getName(), 'Credits' => $player->getCredits(), 'LifetimeSpins' => $player->getLifetimeSpins(), 'LifetimeAverageReturn' => $player->getLifetimeAverageReturn()]);
}
Пример #11
0
<?php

require_once './lib/player.php';
require_once './lib/connectionDB.php';
session_start();
//Creamos un objeto de bd (Crea la conexión).
$connec = new ConnectionDB();
/*Cada vez que incluyamos este código, se validará si hay una sesión iniciada.
 	Si no hay sesión iniciada nos redirige al formulario inicial de registro de jugador.*/
if (!isset($_SESSION['player']) && isset($_POST['login'])) {
    if (isset($_POST['name']) && isset($_POST['lastname']) && isset($_POST['age'])) {
        if ($connec->checkConnection() === 'ok') {
            $player = new Player($_POST['name'], $_POST['lastname'], $_POST['age']);
            $_SESSION['player'] = $player;
            $connec->checkPlayer($player->getName(), $player->getLastName(), $player->getAge());
        } else {
            //$_SESSION['errorDB'] = "error";
            $_SESSION['errorDB'] = $connec;
            header('location: index.php');
        }
    } else {
        //Si los datos del formulario no están completos volvemos al formulario inicial de login.
        header('location: index.php');
    }
}
//Esto sucede cuando venimos del formulario de modificación de datos del usuario.
if (isset($_POST['newdata'])) {
    if (isset($_POST['newname']) && isset($_POST['newlastname']) && isset($_POST['newage'])) {
        //Extraemos el jugador de la sesión y seteamos los nuevos datos.
        $player = $_SESSION['player'];
        //Actualizamos la bd con los nuevos datos del jugador.
 public function importPitchers($real = false, $year = 0)
 {
     if ($real) {
         $file = "./web/utilities/bw-pitching.csv";
     } else {
         $file = "./web/utilities/bw-pitching-test.csv";
     }
     $row = 0;
     if (($handle = fopen($file, "r")) !== FALSE) {
         while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
             if ($row) {
                 if ($data[0] >= $year) {
                     $player = utf8_encode($data[2]);
                     $slug = $this->CI->slugify->simple($player);
                     $player = $this->CI->_player->findOneBySlug($slug);
                     $team = utf8_encode($data[1]);
                     $slug = $this->CI->slugify->simple($team);
                     $team = $this->CI->_team->findOneBySlug($slug);
                     $year = $data[0];
                     if ($team) {
                         if ($player) {
                             $season = $this->CI->_season->findOneBySourceAndPlayerAndYear('Boydsworld', $player, $year);
                             $official = $this->CI->_season->findOneBySourceAndPlayerAndYear('Smallball', $player, $year);
                         }
                         if (!$season) {
                             $season = new Season();
                         }
                         $num = count($data);
                         for ($c = 0; $c < $num; $c++) {
                             $method = 'set' . ucwords($this->pitcher[$c]);
                             if (method_exists($season, $method)) {
                                 $season->{$method}($data[$c]);
                                 if ($official) {
                                     $official->{$method}($data[$c]);
                                 }
                             }
                         }
                         //print_r($season);
                         $season->setPlayer(utf8_encode($season->getPlayer()));
                         $season->setLevel('College');
                         $season->setLeague('NCAA');
                         $season->setDivision('D1');
                         /* Save Player */
                         if (!$player) {
                             $player = new Player();
                             $name = $season->getPlayer();
                             $name = explode(' ', $name);
                             if (isset($name[count($name) - 1])) {
                                 $player->setLastName(utf8_encode($name[count($name) - 1]));
                             }
                             $name = array_splice($name, 0, count($name) - 1);
                             $name = implode(' ', $name);
                             if (isset($name)) {
                                 $player->setFirstName(utf8_encode($name));
                             }
                             print_r("Adding Player: " . $team->getName() . ", " . $player->getName() . ", " . $season->getYear() . "\n");
                             $player->save();
                         } else {
                             print_r("Existing Player: " . $team->getName() . ", " . $player->getName() . ", " . $season->getYear() . "\n");
                         }
                         $season->setPlayer($player);
                         $season->setTeam($team);
                         $season->setSource('Boydsworld');
                         $season->save();
                         if (!$official) {
                             $official = clone $season;
                             $official->setSource('Smallball');
                         }
                         $official->setPlayer($player);
                         $official->setTeam($team);
                         $official->save();
                         $teamOfficial = $this->CI->_season->findOneOfficialByTeamAndYear($team, $season->getYear());
                         if ($teamOfficial) {
                             $teamOfficial->addPlayer($player);
                             $teamOfficial->save();
                         }
                     }
                     // end team
                 }
                 // end year
             }
             //row
             $row++;
         }
         fclose($handle);
     }
 }
Пример #13
0
<?php

if (!defined('INITIALIZED')) {
    exit;
}
$player = new Player();
$player->find($_GET['name']);
if ($player->isLoaded()) {
    if (!file_exists('cache/signatures/' . $player->getID()) || filemtime('cache/signatures/' . $player->getID()) === false || filemtime('cache/signatures/' . $player->getID()) + 30 < time()) {
        $image = imagecreatefrompng('./images/signatures/signature.png');
        $color = imagecolorallocate($image, 255, 255, 255);
        imagettftext($image, 12, 0, 20, 32, $color, './images/signatures/font.ttf', 'Name:');
        imagettftext($image, 12, 0, 70, 32, $color, './images/signatures/font.ttf', $player->getName());
        imagettftext($image, 12, 0, 20, 52, $color, './images/signatures/font.ttf', 'Level:');
        imagettftext($image, 12, 0, 70, 52, $color, './images/signatures/font.ttf', $player->getLevel() . ' ' . Website::getVocationName($player->getVocation()));
        if ($player->getRank()) {
            imagettftext($image, 12, 0, 20, 75, $color, './images/signatures/font.ttf', 'Guild:');
            imagettftext($image, 12, 0, 70, 75, $color, './images/signatures/font.ttf', $player->getRank()->getName() . ' of the ' . $player->getRank()->getGuild()->getName());
        }
        imagettftext($image, 12, 0, 20, 95, $color, './images/signatures/font.ttf', 'Last Login:'******'./images/signatures/font.ttf', $player->getLastLogin() > 0 ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.');
        imagepng($image, 'cache/signatures/' . $player->getID());
        imagedestroy($image);
    }
    header("Content-type: image/png");
    echo file_get_contents('cache/signatures/' . $player->getID());
}
exit;
Пример #14
0
<!-- PHP Handler -->
<?php 
if (!defined('INITIALIZED')) {
    exit;
}
$player = new Player();
$player->loadByName(htmlspecialchars($_REQUEST['name']));
if ($player->isLoaded()) {
    $account = array('sessionKey' => Website::generateSessionKey());
    $server = array('WorldID' => 1, 'ip' => $_SERVER['SERVER_ADDR'], 'port' => 7172);
    $accountCharacters = "";
    $selected_character = "";
    foreach ($account_logged->getPlayersList() as $character) {
        if (strtolower($player->getName()) == strtolower($character->getName())) {
            $selected_character = "<character name='" . htmlspecialchars($character->getName()) . "' worldid='" . $server['WorldID'] . "' selected='true' />";
        } else {
            $accountCharacters .= "<character name='" . htmlspecialchars($character->getName()) . "' worldid='" . $server['WorldID'] . "' selected='false' />";
        }
    }
    $accountCharacters .= $selected_character;
    $SQL->query("UPDATE `accounts` SET `authToken` = '" . $account['sessionKey'] . "' WHERE `name` = '" . $account_logged->getName() . "'");
}
?>

<html>
	<head>
		<title><?php 
echo htmlspecialchars($config['server']['serverName']);
?>
 Flash Client</title>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
Пример #15
0
            $check_name_in_database = new Player();
            $check_name_in_database->find($newchar_name);
            if ($check_name_in_database->isLoaded()) {
                $newchar_errors[] = 'This name is already used. Please choose another name!';
            }
            $charToEdit = new Player($_REQUEST['player_id']);
            if (!$charToEdit->isLoaded()) {
                $newchar_errors[] = 'This player does not exist.';
            }
            if ($charToEdit->isOnline()) {
                $newchar_errors[] = 'This player is ONLINE. Logout first.';
            } elseif ($account_logged->getID() != $charToEdit->getAccountID()) {
                $newchar_errors[] = 'This player is not on your account.';
            }
            if (empty($newchar_errors)) {
                echo 'Name of character <b>' . htmlspecialchars($charToEdit->getName()) . '</b> changed to <b>' . htmlspecialchars($newchar_name) . '</b>';
                $charToEdit->setName($newchar_name);
                $charToEdit->save();
                $account_logged->setCustomField('premium_points', $account_logged->getCustomField('premium_points') - $changeNameCost);
            } else {
                echo 'Some errors occured:<br />';
                foreach ($newchar_errors as $e) {
                    echo '<li>' . $e . '</li>';
                }
                echo '<br /><a href="?subtopic=changename"><b>BACK</b></a>';
            }
        }
    } else {
        echo 'You don\'t have premium points. You need ' . $changeNameCost . '.';
    }
} else {
Пример #16
0
 $player = new Player();
 $player->find($name);
 if ($player->isLoaded()) {
     $number_of_rows = 0;
     $account = $player->getAccount();
     $skull = '';
     if ($player->getSkull() == 4) {
         $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>";
     } else {
         if ($player->getSkull() == 5) {
             $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>";
         }
     }
     $main_content .= '<table border="0" cellspacing="1" cellpadding="4" width="100%"><tr bgcolor="' . $config['site']['vdarkborder'] . '"><td colspan="2" style="font-weight:bold;color:white">Character Information</td></tr>';
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td width="20%">Name:</td><td>' . htmlspecialchars($player->getName()) . ' ' . $skull . '';
     if ($player->isBanned() || $account->isBanned()) {
         $main_content .= '<span style="color:red">[BANNED]</span>';
     }
     if ($player->isNamelocked()) {
         $main_content .= '<span style="color:red">[NAMELOCKED]</span>';
     }
     $main_content .= '<br /></td></tr>';
     if (in_array($player->getGroup(), $config['site']['groups_support'])) {
         $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
         $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Group:</td><td>' . htmlspecialchars(Website::getGroupName($player->getGroup())) . '</td></tr>';
     }
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Sex:</td><td>' . htmlspecialchars($player->getSex() == 0 ? 'female' : 'male') . '</td></tr>';
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Profession:</td><td>' . htmlspecialchars(Website::getVocationName($player->getVocation())) . '</td></tr>';
Пример #17
0
     if (!$check_name_in_database->isLoaded()) {
     }
 }
 if (isset($buy_offer['id'])) {
     //item exist in database
     if ($user_guild_points >= $buy_offer['points']) {
         if (check_name($buy_name)) {
             $buy_player = new Player();
             $buy_player->find($buy_name);
             if ($buy_player->isLoaded()) {
                 $buy_player_account = $buy_player->getAccount();
                 if ($_SESSION['viewed_confirmation_page'] == 'yes' && $_POST['buy_confirmed'] == 'yes') {
                     if ($buy_offer['type'] == 'pacc') {
                         $player_premdays = $buy_player_account->getCustomField('premdays');
                         $player_lastlogin = $buy_player_account->getCustomField('lastday');
                         $save_transaction = 'INSERT INTO ' . $SQL->tableName('z_shopguild_history_pacc') . ' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, ' . $SQL->quote($buy_player->getName()) . ', ' . $SQL->quote($buy_player_account->getId()) . ', ' . $SQL->quote($buy_from) . ', ' . $SQL->quote($account_logged->getId()) . ', ' . $SQL->quote($buy_offer['points']) . ', ' . $SQL->quote($buy_offer['days']) . ', \'realized\', ' . $SQL->quote(time()) . ', ' . $SQL->quote(time()) . ');';
                         $SQL->query($save_transaction);
                         $buy_player_account->setCustomField('premdays', $player_premdays + $buy_offer['days']);
                         $account_logged->setCustomField('guild_points', $user_guild_points - $buy_offer['points']);
                         $user_guild_points = $user_guild_points - $buy_offer['points'];
                         $main_content .= '<h2>VIP account added!</h2><b>' . $buy_offer['days'] . ' days</b> of VIP account added to the account of player <b>' . $buy_player->getName() . '</b> for <b>' . $buy_offer['points'] . ' guild points</b> from your account.<br />Now you have <b>' . $user_guild_points . ' guild points</b>.<br><br><a href="index.php?subtopic=shopguild">Go to Shop Site</a><br>';
                     } elseif ($buy_offer['type'] == 'unban') {
                         $my_acc_id = $account_logged->getCustomField('id');
                         $datadata = $SQL->query('SELECT * FROM ' . $SQL->tableName('bans') . ' WHERE value = ' . $my_acc_id . ';')->fetch();
                         if ($datadata['value'] == $my_acc_id) {
                             if ($SQL->query('DELETE FROM bans WHERE value= ' . $my_acc_id . ' LIMIT 1;')) {
                             } else {
                                 $SQL->query('DELETE FROM bans WHERE account= ' . $my_acc_id . ' LIMIT 1;');
                             }
                             $account_logged->setCustomField('guild_points', $user_guild_points - $buy_offer['points']);
                             $user_guild_points = $user_guild_points - $buy_offer['points'];
Пример #18
0
 function testPlayer_Construct()
 {
     $testPlayer = new Player('thisname', 'thisage', 'thisimage', 'thisemail');
     $this->assertEquals('thisname', $testPlayer->getName());
 }
Пример #19
0
        // Show all the cards for Joe
        echo '<h2>' . $PlayerJoe->getName() . '</h2>';
        echo $PlayerJoe->render();
        echo '<br/>';

        ?>

    </div>

    <div class="right_block">

        <?php

        // Show all the cards for Sue
        echo '<h2>' . $PlayerSue->getName() . '</h2>';
        echo $PlayerSue->render();
        echo '<br/>';

        ?>

    </div>
</div>

<div class="clearfix"> <!-- adding some space -->
</div>

<footer>
    <p>
        <?php
Пример #20
0
     $player = new Player();
     $player->find($player_n);
     $player_from_account = FALSE;
     if (strlen($new_nick) <= 30) {
         if ($player->isLoaded()) {
             $account_players = $account_logged->getPlayersList();
             if (count($account_players)) {
                 foreach ($account_players as $acc_player) {
                     if ($acc_player->getId() == $player->getId()) {
                         $player_from_account = TRUE;
                     }
                 }
                 if ($player_from_account) {
                     $player->setGuildNick($new_nick);
                     $player->save();
                     $main_content .= 'Guild nick of player <b>' . htmlspecialchars($player->getName()) . '</b> changed to <b>' . htmlspecialchars($new_nick) . '</b>.';
                     $addtolink = '&action=show&guild=' . $player->getRank()->getGuildId();
                 } else {
                     $main_content .= 'This player is not from your account.';
                 }
             } else {
                 $main_content .= 'This player is not from your account.';
             }
         } else {
             $main_content .= 'Unknow error occured.';
         }
     } else {
         $main_content .= 'Too long guild nick. Max. 30 chars, your: ' . strlen($new_nick);
     }
 } else {
     $main_content .= 'You are not logged.';
Пример #21
0
                $errormessage .= 'Please <a href="?subtopic=shopsystem">select item</a> first.';
            } else {
                if (!check_name($buy_from)) {
                    $errormessage .= 'Invalid nick ("from player") format. Please <a href="?subtopic=shopsystem&action=select_player&buy_id=' . $buy_id . '">select other name</a> or contact with administrator.';
                } else {
                    $buy_offer = getItemByID($buy_id);
                    if (isset($buy_offer['id'])) {
                        if ($user_premium_points >= $buy_offer['points']) {
                            if (check_name($buy_name)) {
                                $buy_player = new Player();
                                $buy_player->find($buy_name);
                                if ($buy_player->isLoaded()) {
                                    $buy_player_account = $buy_player->getAccount();
                                    if ($_SESSION['viewed_confirmation_page'] == 'yes' && $_POST['buy_confirmed'] == 'yes') {
                                        if ($buy_offer['type'] == 'item') {
                                            $sql = 'INSERT INTO ' . $SQL->tableName('z_ots_comunication') . ' (' . $SQL->fieldName('id') . ',' . $SQL->fieldName('name') . ',' . $SQL->fieldName('type') . ',' . $SQL->fieldName('action') . ',' . $SQL->fieldName('param1') . ',' . $SQL->fieldName('param2') . ',' . $SQL->fieldName('param3') . ',' . $SQL->fieldName('param4') . ',' . $SQL->fieldName('param5') . ',' . $SQL->fieldName('param6') . ',' . $SQL->fieldName('param7') . ',' . $SQL->fieldName('delete_it') . ') VALUES (NULL, ' . $SQL->quote($buy_player->getName()) . ', ' . $SQL->quote('login') . ', ' . $SQL->quote('give_item') . ', ' . $SQL->quote($buy_offer['item_id']) . ', ' . $SQL->quote($buy_offer['item_count']) . ', ' . $SQL->quote('') . ', ' . $SQL->quote('') . ', ' . $SQL->quote('item') . ', ' . $SQL->quote($buy_offer['name']) . ', ' . $SQL->quote($buy_offer['id']) . ', ' . $SQL->quote(1) . ');';
                                            $SQL->query($sql);
                                            $save_transaction = 'INSERT INTO ' . $SQL->tableName('z_shop_history_item') . ' (' . $SQL->fieldName('id') . ',' . $SQL->fieldName('to_name') . ',' . $SQL->fieldName('to_account') . ',' . $SQL->fieldName('from_nick') . ',' . $SQL->fieldName('from_account') . ',' . $SQL->fieldName('price') . ',' . $SQL->fieldName('offer_id') . ',' . $SQL->fieldName('trans_state') . ',' . $SQL->fieldName('trans_start') . ',' . $SQL->fieldName('trans_real') . ') VALUES (' . $SQL->lastInsertId() . ', ' . $SQL->quote($buy_player->getName()) . ', ' . $SQL->quote($buy_player_account->getId()) . ', ' . $SQL->quote($buy_from) . ',  ' . $SQL->quote($account_logged->getId()) . ', ' . $SQL->quote($buy_offer['points']) . ', ' . $SQL->quote($buy_offer['name']) . ', ' . $SQL->quote('wait') . ', ' . $SQL->quote(time()) . ', ' . $SQL->quote(0) . ');';
                                            $SQL->query($save_transaction);
                                            $account_logged->setCustomField('premium_points', $user_premium_points - $buy_offer['points']);
                                            $user_premium_points = $user_premium_points - $buy_offer['points'];
                                            $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4>
<TR><TD BGCOLOR="' . $config['site']['vdarkborder'] . '" ALIGN=left CLASS=white><B>Item added!</B></TD></TR>
<TR><TD BGCOLOR="' . $config['site']['lightborder'] . '" ALIGN=left><b>' . htmlspecialchars($buy_offer['name']) . '</b> added to player <b>' . htmlspecialchars($buy_player->getName()) . '</b> items (he will get this items after relog) for <b>' . $buy_offer['points'] . ' premium points</b> from your account.<br />Now you have <b>' . $user_premium_points . ' premium points</b>.<br /><a href="?subtopic=shopsystem">GO TO MAIN SHOP SITE</a></TD></TR>
</table>';
                                        } elseif ($buy_offer['type'] == 'mount') {
                                            $account_id = $buy_player->getCustomField('id');
                                            $on = $SQL->query('SELECT * FROM ' . $SQL->tableName('players_online') . ' WHERE ' . $SQL->fieldName('player_id') . ' = ' . $account_id . ';')->fetch();
                                            if ($on == false) {
                                                $SQL->query('INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (' . $account_id . ', ' . $SQL->quote($buy_offer['item_id']) . ', 1);');
                                                $account_logged->setCustomField('premium_points', $user_premium_points - $buy_offer['points']);
Пример #22
0
                             $serverSaveHour--;
                         }
                         $timeInfo['tm_hour'] = $serverSaveHour;
                         $timeInfo['tm_min'] = 55;
                         $timeInfo['tm_sec'] = 0;
                         $difference = mktime($timeInfo['tm_hour'], $timeInfo['tm_min'], $timeInfo['tm_sec'], (int) $timeInfo['tm_mon'] + 1, $timeInfo['tm_mday'], (int) $timeInfo['tm_year'] + 1900) - $timeNow;
                         if ($difference < 0) {
                             $difference += 86400;
                         }
                         $auctionEnd = time() + $difference + ($auctionDaysDefault - 1) * 86400;
                     }
                 }
                 $house->setBidEnd($auctionEnd);
             }
             $house->save();
             $main_content .= $goodInfoStart . 'Your offer is now highest on auction. Current price for house is <b>' . $house->getLastBid() . ' gold</b>, your maximum price is <b>' . $house->getBid() . ' gold</b>. Character <b>' . htmlspecialchars($bidder->getName()) . '</b> from your account will get house, if you win.' . $goodInfoEnd;
             // udalo sie przebic, wiec nie pokazuje formularza
             $bidded = true;
         } else {
             if ($bid >= $house->getLastBid()) {
                 $house->setLastBid($bid);
                 $house->save();
             }
             $main_content .= $badInfoStart . 'Your offer of ' . $bid . ' gold is too low.' . $badInfoEnd;
         }
     } else {
         $main_content .= $badInfoStart . 'Character <b>' . htmlspecialchars($bidder->getName()) . '</b> does not have enough money on bank account. Please login again <b>in game</b> to update your bank balance.' . $badInfoEnd;
     }
 } else {
     $main_content .= 'Selected player is not on your account?! Hax?';
 }
Пример #23
0
 public function addPlayer(Player $player)
 {
     $this->players[$player->getName()] = $player;
 }
Пример #24
0
 $player = new Player();
 $player->find($name);
 if ($player->isLoaded()) {
     $number_of_rows = 0;
     $account = $player->getAccount();
     $skull = '';
     if ($player->getSkull() == 4) {
         $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>";
     } else {
         if ($player->getSkull() == 5) {
             $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>";
         }
     }
     $main_content .= '<table border="0" cellspacing="1" cellpadding="4" width="100%"><tr bgcolor="' . $config['site']['vdarkborder'] . '"><td colspan="2" style="font-weight:bold;color:white">Character Information</td></tr>';
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td width="20%">Name:</td><td style="font-weight:bold;color:' . ($player->isOnline() ? 'green' : 'red') . '">' . htmlspecialchars($player->getName()) . ' ' . $skull . ' <img src="' . $config['site']['flag_images_url'] . $account->getFlag() . $config['site']['flag_images_extension'] . '" title="Country: ' . $account->getFlag() . '" alt="' . $account->getFlag() . '" />';
     if ($player->isBanned() || $account->isBanned()) {
         $main_content .= '<span style="color:red">[BANNED]</span>';
     }
     if ($player->isNamelocked()) {
         $main_content .= '<span style="color:red">[NAMELOCKED]</span>';
     }
     $main_content .= '<br /><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player->getLookType() . '&addons=' . $player->getLookAddons() . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet() . '" alt="" /></td></tr>';
     if (in_array($player->getGroup(), $config['site']['groups_support'])) {
         $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
         $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Group:</td><td>' . htmlspecialchars(Website::getGroupName($player->getGroup())) . '</td></tr>';
     }
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Sex:</td><td>' . htmlspecialchars($player->getSex() == 0 ? 'female' : 'male') . '</td></tr>';
     $bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
     $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Profession:</td><td>' . htmlspecialchars(Website::getVocationName($player->getVocation())) . '</td></tr>';