-
Notifications
You must be signed in to change notification settings - Fork 3
/
game.php
65 lines (57 loc) · 1.94 KB
/
game.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
Class TritonGame {
var $client;
var $id;
// PHP 4 style constructor for backwards-compatibility.
function TritonGame($client, $game_id){
$this::__construct($client, $game_id);
}
function __construct($client, $game_id)
{
$this->client = $client;
$this->id = $game_id;
}
function order($type, $order){
return $this->client->gameRequest($type, $this->id, array('order'=>$order));
}
function GetFullUniverse(){
return $this->order("order", "full_universe_report");
}
function GetIntel(){
return $this->client->gameRequest("intel_data",$this->id);
}
function GetUnreadCount(){
return $this->client->gameRequest("fetch_unread_count",$this->id);
}
function GetPlayerAchievements(){
return $this->client->gameRequest("fetch_player_achievements",$this->id);
}
/**
* $msg_type - 'game_diplomacy' or 'game_event'
*/
function GetMessages($msg_type, $count, $offset = 0){
$options = array("count"=>$count,"offset"=>$offset,"group"=>$msg_type);
return $this->client->gameRequest("fetch_game_messages",$this->id,$options);
}
function GetDiplomacyMessages($count, $offset = 0){
return $this->GetMessages('game_diplomacy',$count, $offset);
}
function GetEventMessages($count, $offset = 0){
return $this->GetMessages('game_event',$count, $offset);
}
function BuyEconomy($star, $price){
return $this->order("batched_orders", "upgrade_economy,{$star},{$price}");
}
//function BuyIndustry($star, $price){
// return $this->order("batched_orders", "upgrade_industry,{$star},{$price}");
//}
//function BuyScience($star, $price){
// return $this->order("batched_orders", "upgrade_science,{$star},{$price}");
//}
/**
* Admin Orders
*/
function TogglePause(){
return $this->order("order", "toggle_pause_game");
}
}