|
@@ -27,115 +27,30 @@
|
|
|
*/
|
|
*/
|
|
|
class Player extends Entity{
|
|
class Player extends Entity{
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Player ID.
|
|
|
|
|
- */
|
|
|
|
|
- public $id;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var Server Player server.
|
|
|
|
|
- */
|
|
|
|
|
- public $server;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var string Player country (XX).
|
|
|
|
|
- */
|
|
|
|
|
- public $country;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var string Player language (xx).
|
|
|
|
|
- */
|
|
|
|
|
- public $language;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Player level.
|
|
|
|
|
- */
|
|
|
|
|
- public $level;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var string Player name.
|
|
|
|
|
- */
|
|
|
|
|
- public $name;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Total experience.
|
|
|
|
|
- */
|
|
|
|
|
- public $experience;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var Unit Representative Unit.
|
|
|
|
|
- */
|
|
|
|
|
- public $rep;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Timestamp of player registration.
|
|
|
|
|
- */
|
|
|
|
|
- public $joined = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in arena.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_arena = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in world arena.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_world_arena = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in special league.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_special_league = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in guild war.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_gw = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in guild siege.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_siege = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in World Boss.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_wboss = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in TOA normal.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_toan = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in TOA HARD.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_toah = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int Top rank in TOA HELL.
|
|
|
|
|
- */
|
|
|
|
|
- public $top_rank_toal = 0;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \Unit[] Units in Arena defense.
|
|
|
|
|
- */
|
|
|
|
|
- public $defense = [];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \Unit[][] Units in Guild War defense.
|
|
|
|
|
- */
|
|
|
|
|
- public $gw_defense = [[], []];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \Unit[][] Units in Siege Battle defense.
|
|
|
|
|
- */
|
|
|
|
|
- public $siege_defense = [];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var int[] Currency.
|
|
|
|
|
- */
|
|
|
|
|
- public $currency = [
|
|
|
|
|
|
|
+ private $id;
|
|
|
|
|
+ private $server;
|
|
|
|
|
+ private $country;
|
|
|
|
|
+ private $language;
|
|
|
|
|
+ private $level;
|
|
|
|
|
+ private $name;
|
|
|
|
|
+ private $experience;
|
|
|
|
|
+ private $rep = null;
|
|
|
|
|
+ private $rep_id = null;
|
|
|
|
|
+ private $joined = 0;
|
|
|
|
|
+ private $top_rank_arena = 0;
|
|
|
|
|
+ private $top_rank_world_arena = 0;
|
|
|
|
|
+ private $top_rank_special_league = 0;
|
|
|
|
|
+ private $top_rank_gw = 0;
|
|
|
|
|
+ private $top_rank_siege = 0;
|
|
|
|
|
+ private $top_rank_wboss = 0;
|
|
|
|
|
+ private $top_rank_toan = 0;
|
|
|
|
|
+ private $top_rank_toah = 0;
|
|
|
|
|
+ private $top_rank_toal = 0;
|
|
|
|
|
+ private $flag_defense = false;
|
|
|
|
|
+ private $arena_defense = [];
|
|
|
|
|
+ private $gw_defense = [[], []];
|
|
|
|
|
+ private $siege_defense = [];
|
|
|
|
|
+ private $currency = [
|
|
|
"mana" => 0,
|
|
"mana" => 0,
|
|
|
"crystal" => 0,
|
|
"crystal" => 0,
|
|
|
"energy" => 0,
|
|
"energy" => 0,
|
|
@@ -152,41 +67,17 @@
|
|
|
"ancient_stone" => 0,
|
|
"ancient_stone" => 0,
|
|
|
"costume_point" => 0,
|
|
"costume_point" => 0,
|
|
|
];
|
|
];
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \Building[] List of Buildings.
|
|
|
|
|
- */
|
|
|
|
|
- public $building = [];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \Decoration[] List of Decorations.
|
|
|
|
|
- */
|
|
|
|
|
- public $decoration = [];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \item[] List of Scrolls in item.
|
|
|
|
|
- */
|
|
|
|
|
- public $item_scroll = [];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \item[] List of rune crafting items in item.
|
|
|
|
|
- */
|
|
|
|
|
- public $item_craft_rune = [];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \item[] List of rune crafting items in item.
|
|
|
|
|
- */
|
|
|
|
|
- public $item_craft = [];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \item[] List of rune crafting items in item.
|
|
|
|
|
- */
|
|
|
|
|
- public $item_essence = [];
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @var \Record[] Player record runs.
|
|
|
|
|
- */
|
|
|
|
|
- public $record = [];
|
|
|
|
|
|
|
+ private $flag_building = false;
|
|
|
|
|
+ private $building = [];
|
|
|
|
|
+ private $decoration = [];
|
|
|
|
|
+ private $flag_item = false;
|
|
|
|
|
+ private $item_scroll = [];
|
|
|
|
|
+ private $item_craft_rune = [];
|
|
|
|
|
+ private $item_craft = [];
|
|
|
|
|
+ private $item_essence = [];
|
|
|
|
|
+ private $flag_record = false;
|
|
|
|
|
+ private $record = [];
|
|
|
|
|
+ private $public = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -197,11 +88,9 @@
|
|
|
*
|
|
*
|
|
|
* @param int $id Monster identifier.
|
|
* @param int $id Monster identifier.
|
|
|
* @param bool $complete If false, query only monster and k_monster.
|
|
* @param bool $complete If false, query only monster and k_monster.
|
|
|
- * @global resource Database connection.
|
|
|
|
|
*/
|
|
*/
|
|
|
public function __construct($id, $complete = true){
|
|
public function __construct($id, $complete = true){
|
|
|
- global $db;
|
|
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT
|
|
SELECT
|
|
|
id,
|
|
id,
|
|
|
server,
|
|
server,
|
|
@@ -234,7 +123,8 @@
|
|
|
top_rank_wboss,
|
|
top_rank_wboss,
|
|
|
top_rank_toan,
|
|
top_rank_toan,
|
|
|
top_rank_toah,
|
|
top_rank_toah,
|
|
|
- top_rank_toal
|
|
|
|
|
|
|
+ top_rank_toal,
|
|
|
|
|
+ public
|
|
|
FROM player
|
|
FROM player
|
|
|
WHERE id = :id;
|
|
WHERE id = :id;
|
|
|
");
|
|
");
|
|
@@ -249,7 +139,7 @@
|
|
|
$this->level = $r["level"];
|
|
$this->level = $r["level"];
|
|
|
$this->experience = $r["experience"];
|
|
$this->experience = $r["experience"];
|
|
|
if (strlen($r["rep"]) > 0){
|
|
if (strlen($r["rep"]) > 0){
|
|
|
- $this->rep = new Unit($r["rep"]);
|
|
|
|
|
|
|
+ $this->rep_id = $r["rep"];
|
|
|
}
|
|
}
|
|
|
$this->currency["mana"] = $r["mana"];
|
|
$this->currency["mana"] = $r["mana"];
|
|
|
$this->currency["crystal"] = $r["crystal"];
|
|
$this->currency["crystal"] = $r["crystal"];
|
|
@@ -265,7 +155,8 @@
|
|
|
$this->currency["event_coin"] = $r["event_coin"];
|
|
$this->currency["event_coin"] = $r["event_coin"];
|
|
|
$this->currency["social_point"] = $r["social_point"];
|
|
$this->currency["social_point"] = $r["social_point"];
|
|
|
$this->currency["costume_point"] = $r["costume_point"];
|
|
$this->currency["costume_point"] = $r["costume_point"];
|
|
|
- $this->joined = $r["joined"];
|
|
|
|
|
|
|
+ $this->joined = new Datetime();
|
|
|
|
|
+ $this->joined->setTimestamp($r["joined"]);
|
|
|
$this->top_rank_arena = $r["top_rank_arena"];
|
|
$this->top_rank_arena = $r["top_rank_arena"];
|
|
|
$this->top_rank_world_arena = $r["top_rank_world_arena"];
|
|
$this->top_rank_world_arena = $r["top_rank_world_arena"];
|
|
|
$this->top_rank_special_league = $r["top_rank_special_league"];
|
|
$this->top_rank_special_league = $r["top_rank_special_league"];
|
|
@@ -275,8 +166,14 @@
|
|
|
$this->top_rank_toan = $r["top_rank_toan"];
|
|
$this->top_rank_toan = $r["top_rank_toan"];
|
|
|
$this->top_rank_toah = $r["top_rank_toah"];
|
|
$this->top_rank_toah = $r["top_rank_toah"];
|
|
|
$this->top_rank_toal = $r["top_rank_toal"];
|
|
$this->top_rank_toal = $r["top_rank_toal"];
|
|
|
|
|
+ if (strlen($r["public"]) == 1){
|
|
|
|
|
+ $this->public = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private function load_defenses(){
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT unit
|
|
SELECT unit
|
|
|
FROM defense
|
|
FROM defense
|
|
|
WHERE
|
|
WHERE
|
|
@@ -288,9 +185,9 @@
|
|
|
$statement->bindValue(':area_type', AREA_TYPE_ID::ARENA, SQLITE3_INTEGER);
|
|
$statement->bindValue(':area_type', AREA_TYPE_ID::ARENA, SQLITE3_INTEGER);
|
|
|
$q = $statement->execute();
|
|
$q = $statement->execute();
|
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
|
- array_push($this->defense, new Unit($r["unit"], false));
|
|
|
|
|
|
|
+ array_push($this->arena_defense, new Unit($r["unit"], false));
|
|
|
}
|
|
}
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT
|
|
SELECT
|
|
|
unit,
|
|
unit,
|
|
|
position
|
|
position
|
|
@@ -312,7 +209,11 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// TODO: Siege defenses
|
|
// TODO: Siege defenses
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $this->flag_defense = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private function load_buildings(){
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT
|
|
SELECT
|
|
|
building.id AS id,
|
|
building.id AS id,
|
|
|
min(building.buildable) AS min
|
|
min(building.buildable) AS min
|
|
@@ -321,7 +222,7 @@
|
|
|
buildable
|
|
buildable
|
|
|
WHERE
|
|
WHERE
|
|
|
player = :player AND
|
|
player = :player AND
|
|
|
- building.buildable = buildable.id
|
|
|
|
|
|
|
+ building.buildable = buildable.id
|
|
|
GROUP BY building.buildable;
|
|
GROUP BY building.buildable;
|
|
|
");
|
|
");
|
|
|
$statement->bindValue(':player', $this->id, SQLITE3_TEXT);
|
|
$statement->bindValue(':player', $this->id, SQLITE3_TEXT);
|
|
@@ -329,7 +230,7 @@
|
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
|
array_push($this->building, new Building($r["id"]));
|
|
array_push($this->building, new Building($r["id"]));
|
|
|
}
|
|
}
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT id
|
|
SELECT id
|
|
|
FROM decoration
|
|
FROM decoration
|
|
|
WHERE player = :player;
|
|
WHERE player = :player;
|
|
@@ -339,7 +240,11 @@
|
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
|
array_push($this->decoration, new Decoration($r["id"]));
|
|
array_push($this->decoration, new Decoration($r["id"]));
|
|
|
}
|
|
}
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $this->flag_building = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private function load_items(){
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT
|
|
SELECT
|
|
|
id,
|
|
id,
|
|
|
type
|
|
type
|
|
@@ -357,7 +262,7 @@
|
|
|
array_push($this->item_scroll, new item($r["id"], $r["type"]));
|
|
array_push($this->item_scroll, new item($r["id"], $r["type"]));
|
|
|
}
|
|
}
|
|
|
// Rune crafting items are marked as generic crafting.
|
|
// Rune crafting items are marked as generic crafting.
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT
|
|
SELECT
|
|
|
id,
|
|
id,
|
|
|
type
|
|
type
|
|
@@ -374,7 +279,7 @@
|
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
|
array_push($this->item_craft_rune, new item($r["id"], $r["type"]));
|
|
array_push($this->item_craft_rune, new item($r["id"], $r["type"]));
|
|
|
}
|
|
}
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT
|
|
SELECT
|
|
|
id,
|
|
id,
|
|
|
type
|
|
type
|
|
@@ -391,7 +296,7 @@
|
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
|
array_push($this->item_craft, new item($r["id"], $r["type"]));
|
|
array_push($this->item_craft, new item($r["id"], $r["type"]));
|
|
|
}
|
|
}
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT
|
|
SELECT
|
|
|
item.id AS id,
|
|
item.id AS id,
|
|
|
item.type AS type
|
|
item.type AS type
|
|
@@ -422,7 +327,11 @@
|
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
|
array_push($this->item_essence, new item($r["id"], $r["type"]));
|
|
array_push($this->item_essence, new item($r["id"], $r["type"]));
|
|
|
}
|
|
}
|
|
|
- $statement = $db->prepare("
|
|
|
|
|
|
|
+ $this->flag_item = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private function load_records(){
|
|
|
|
|
+ $statement = get_context()->get_db()->prepare("
|
|
|
SELECT
|
|
SELECT
|
|
|
player,
|
|
player,
|
|
|
area_type,
|
|
area_type,
|
|
@@ -448,7 +357,7 @@
|
|
|
WHEN (area_type = 2 AND area = 4001) THEN 15 -- Hall of Wind
|
|
WHEN (area_type = 2 AND area = 4001) THEN 15 -- Hall of Wind
|
|
|
WHEN (area_type = 2 AND area = 7001) THEN 16 -- Hall of Light
|
|
WHEN (area_type = 2 AND area = 7001) THEN 16 -- Hall of Light
|
|
|
WHEN (area_type = 2 AND area = 1001) THEN 17 -- Hall of Dark
|
|
WHEN (area_type = 2 AND area = 1001) THEN 17 -- Hall of Dark
|
|
|
- ELSE area
|
|
|
|
|
|
|
+ ELSE area
|
|
|
END ASC
|
|
END ASC
|
|
|
");
|
|
");
|
|
|
$statement->bindValue(':player', $this->id, SQLITE3_TEXT);
|
|
$statement->bindValue(':player', $this->id, SQLITE3_TEXT);
|
|
@@ -456,7 +365,323 @@
|
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
|
array_push($this->record, new Record($r["player"], $r["area_type"], $r["area"]));
|
|
array_push($this->record, new Record($r["player"], $r["area_type"], $r["area"]));
|
|
|
}
|
|
}
|
|
|
|
|
+ $this->flag_record = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the player identifier
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Plyaer ID.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_id(){
|
|
|
|
|
+ return $this->id;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the player server.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return Server The player's account server.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_server(){
|
|
|
|
|
+ return $this->server;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the player's country.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return string Two digit country code.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_country(){
|
|
|
|
|
+ return $this->country;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the player's language.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return string Two digit language code.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_language(){
|
|
|
|
|
+ return $this->language;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the player's level,
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Player's level
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_level(){
|
|
|
|
|
+ return $this->level;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the player's name
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return string The playe's name.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_name(){
|
|
|
|
|
+ return $this->name;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the total experience earned by the user.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return number Total experience.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_experience(){
|
|
|
|
|
+ return $this->experience;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the player's representative unit.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return Unit Player's representative
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_rep(){
|
|
|
|
|
+ if ($this->rep_id != null && $this->rep == null){
|
|
|
|
|
+ $this->rep = new Unit($this->rep_id);
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->rep;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Gets the date the user joined the game.
|
|
|
|
|
+ *
|
|
|
|
|
+ * If $format is supplied, a string in the desired format will be returned. If not, the raw
|
|
|
|
|
+ * DateTime object will e returned.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param string $format A date format (optional).
|
|
|
|
|
+ * @return DateTime | string The raw date, or a formatted version.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_joined($format = null){
|
|
|
|
|
+ if (null == $format){
|
|
|
|
|
+ return $this->joined;
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ return $this->joined->format($format);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in the Arena.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_arena(){
|
|
|
|
|
+ return $this->top_rank_arena;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in the WorldArena.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_world_arena(){
|
|
|
|
|
+ return $this->top_rank_world_arena;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in the Arena.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_special_league(){
|
|
|
|
|
+ return $this->top_rank_special_league;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in Guild War.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_gw(){
|
|
|
|
|
+ return $this->top_rank_gw;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in Siege battle.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_siege(){
|
|
|
|
|
+ return $this->top_rank_siege;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in the World Boss.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_wboss(){
|
|
|
|
|
+ return $this->top_rank_wboss;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in the Trial of Ascension (normal difficulty).
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_toan(){
|
|
|
|
|
+ return $this->top_rank_toan;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in the Trial of Ascension (hard difficulty).
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_toah(){
|
|
|
|
|
+ return $this->top_rank_toah;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the user's top rank in the Trial of Ascension (hell difficulty).
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int Top rank.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_top_rank_toal(){
|
|
|
|
|
+ return $this->top_rank_toal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the Arena defense units.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \Unit[] Units in the arena defense.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_arena_defense(){
|
|
|
|
|
+ if (!$this->flag_defense){
|
|
|
|
|
+ $this->load_defenses();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->arena_defense;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the Guild War defenses.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return Unit[][]: Units in Guild War defense, grouped by team.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_gw_defense(){
|
|
|
|
|
+ if (!$this->flag_defense){
|
|
|
|
|
+ $this->load_defenses();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->gw_defense;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the Guild War defenses.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return Unit[][]: Units in Siege Battle defense, grouped by team.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_siege_defense(){
|
|
|
|
|
+ if (!$this->flag_defense){
|
|
|
|
|
+ $this->load_defenses();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->siege_defense;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves various currencies.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return int[] Array with the keys: mana, crystal, energy, energy_max, arena_energy,
|
|
|
|
|
+ * darkportal_energy, dimension_energy, honor_point, guild_point, honor_medal, honor_mark,
|
|
|
|
|
+ * event_coin, social_point, ancient_stone, costume_point,
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_currencies(){
|
|
|
|
|
+ return $this->currency;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of buildings owned by the user.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \Building[] Buildings owned.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_buildings(){
|
|
|
|
|
+ if (!$this->flag_building){
|
|
|
|
|
+ $this->load_buildings();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->building;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of decorations owned by the user.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \Decoration[] Owned decorations.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_decorations(){
|
|
|
|
|
+ if (!$this->flag_building){
|
|
|
|
|
+ $this->load_buildings();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->decoration;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of owned scrolls.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \Item[] Scrolls.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_scrolls(){
|
|
|
|
|
+ if (!$this->flag_item){
|
|
|
|
|
+ $this->load_items();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->item_scroll;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of rune crafting mateials.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \Item[] Rune craft materials.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_rune_craft_materials(){
|
|
|
|
|
+ if (!$this->flag_item){
|
|
|
|
|
+ $this->load_items();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->item_craft_rune;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of crafting materials.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \Item[] Crafting materials
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_craft_materials(){
|
|
|
|
|
+ if (!$this->flag_item){
|
|
|
|
|
+ $this->load_items();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->item_craft;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of essences owned by the player.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \Item[] Essences.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_essences(){
|
|
|
|
|
+ if (!$this->flag_item){
|
|
|
|
|
+ $this->load_items();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->item_essence;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Retrieves the list of the player's records in the logbook.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \Record[] List of records.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function get_records(){
|
|
|
|
|
+ if (!$this->flag_record){
|
|
|
|
|
+ $this->load_records();
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->record;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Checks if the player profile is public.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return bool True for public profile, false otherwise.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function is_public(){
|
|
|
|
|
+ return $this->public;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
?>
|
|
?>
|