コード例 #1
0
    $world = 13;
    echo "No Command Line Argument Found.  Using Default World [{$world}]\r\n";
}
/*
=======================================================
============== Authenticate the Phone =================
=======================================================
*/
$won = new WarOfNations();
$won->setDataLoadId(DataLoadDAO::initNewLoad($won->db, 'WORLD_MAP', 0, "World {$world}"));
DataLoadDAO::startLoad($won->db, $won->data_load_id);
$won->Authenticate();
// Check if we're in the correct world
if ($won->auth->world_id != $world) {
    // Switch world if not
    if ($won->SwitchWorld($world) === false) {
        // If we didn't switch successfully, join a new world
        $won->JoinNewWorld($world);
    }
}
// If we're still not in the right world, quit
if ($won->auth->world_id != $world) {
    DataLoadDAO::loadFailed($won->db, $won->data_load_id);
    die("ERROR: Not Authenticated to World {$world}");
}
/*
=======================================================
===================== Do Stuff ========================
=======================================================
*/
$start = microtime(true);
コード例 #2
0
<?php

require_once dirname(__FILE__) . '/../classes/WarOfNations2.class.php';
require_once dirname(__FILE__) . '/../classes/data/DataLoad.class.php';
if (count($argv) == 2) {
    $world = $argv[1];
    echo "Got Command Line Argument for World [{$world}]\r\n";
} else {
    $world = 13;
    echo "No Command Line Argument Found.  Using Default World [{$world}]\r\n";
}
$won = new WarOfNations();
$won->setDataLoadId(DataLoadDAO::initNewLoad($won->db, 'SWITCH_WORLD', 0, "World {$world}"));
DataLoadDAO::startLoad($won->db, $won->data_load_id);
$won->SwitchWorld($world);
DataLoadDAO::loadComplete($won->db, $won->data_load_id);