/** * Override default validation * @see Phreezable::Validate() */ public function Validate() { // example of custom validation // $this->ResetValidationErrors(); // $errors = $this->GetValidationErrors(); // if ($error == true) $this->AddValidationError('FieldName', 'Error Information'); // return !$this->HasValidationErrors(); return parent::Validate(); }
public function SwitchWorld($world_id) { /* POST /hc//index.php/json_gateway?svc=BatchController.call HTTP/1.1 x-newrelic-id: UgMDWFFADQYCUFFUBw== Accept: application/json Content-type: application/json; charset=UTF-8; X-Signature: 51931c0ffc90f6ac0e64e5f6bb1a7bbd X-Timestamp: 1424498999 User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.2.2; Droid4X-MAC Build/JDQ39E) Host: gcand.gree-apps.net Connection: Keep-Alive Accept-Encoding: gzip Content-Length: 545 [{"transaction_time":"1424498999746","platform":"android","session_id":"6283633","start_sequence_num":1,"iphone_udid":"92639d40a61db79e7d8c01479b7638fc","wd_player_id":0,"locale":"en-US","_explicitType":"Session","client_build":"360","game_name":"HCGame","api_version":"1","mac_address":"14:10:9F:D6:7B:33","end_sequence_num":1,"req_id":1,"player_id":101019808535303,"language":"en","game_data_version":"hc_20150218_47131","client_version":"1.9.8"},[{"service":"world.world","method":"switch_world","_explicitType":"Command","params":[101013]}]] [{"transaction_time":"1410114994026","platform":"android","session_id":"51507 ","start_sequence_num":1,"iphone_udid":"8763af18eb4deace1840060a3bd9086b","wd_player_id":0,"locale":"en-US","_explicitType":"Session","client_build":"251","game_name":"HCGame","api_version":"1","mac_address":"c8:aa:21:40:0a:2a","end_sequence_num":1,"req_id":1,"player_id":101013596288193,"language":"en","game_data_version":"hc_20140903_38604","client_version":"1.8.4"},[{"service":"world.world","method":"join_world","_explicitType":"Command","params":[101001]}]] */ $log_seq = 0; $func_args = func_get_args(); $func_log_id = DataLoadLogDAO::startFunction($this->db, $this->data_load_id, __CLASS__, __FUNCTION__, $func_args); echo "Switching to World {$world_id}...\r\n"; $params = array(); $params['game_world_id'] = WorldDAO::getGameIdFromLocalId($this->db, $world_id); $response = $this->de->MakeRequest('SWITCH_WORLD', $params); if (!$response) { return false; } $success = $response['responses'][0]['return_value']['success']; if ($success != 1) { return false; } $this->world_id = $world_id; $this->player_id = $response['metadata']['player']['player_id']; DataLoadLogDAO::completeFunction($this->db, $func_log_id, "Switched to World {$this->world_id} as player {$this->player_id}"); // Authenticate into our new world return $this->Authenticate(); }
<?php require_once "config.php"; require_once "data/world.DAO.php"; $worldDAO = new WorldDAO(); if (isset($_POST["worldName"]) && !empty($_POST["worldName"])) { $worldDAO->insertWorld($_POST["worldName"]); } $worldContainer = $worldDAO->getAllWorlds(); ?> <!DOCTYPE html> <html> <head> <?php include 'partials/header.partial.php'; ?> </head> <body> <?php include 'partials/navbar.partial.php'; ?> <div class="container"> <div class="col-sm-6 col-md-offset-3"> <table class="table table-hover table-bordered"> <thead> <th style="width:10%;text-align: center">WorldID</th> <th style="width: 90%;">WorldName</th> </thead> <?php foreach ($worldContainer as $world) {