Script Dragon City Eggs

Script Dragon City 1eggs/25gems
ente bisa gunain hosting gratisan buat script ini

dceggs.php


Spoiler:
<?php

require_once "dragoncity.class.php";

$versi="";
if(file_exists(__DIR__."/versi.txt")) $versi=file_get_contents(__DIR__."/versi.txt");

$str = '<html><head><title>DRAGON CITY - EGGS</title></head><body>
<form action="egg.php" method="post">
DC Versi:<br/>
<input name="versi" value="'.$versi.'"/><br/>
ID FB:<br/>
<input name="fbid" /><br/>
User Key:<br/>
<input name="ukey" /><br/>
egg code:<br/>
<input name="egg" size="68"/><br/>
<input type="submit" value="Submit" />
</form>';

if(isset($_POST['fbid']) && isset($_POST['ukey']) && isset($_POST['versi']) && isset($_POST['egg'])){
$dragon = explode(",",$_POST['egg']);
$dra=count($dragon);
if($dra>10) diex($str."<hr/>max 10 dragon each process.");
$dc=new DragonCity($_POST['fbid'],$_POST['ukey'],$_POST['versi']);
if(!$dc->getInfo()) infoError($str);
$str .= $dc->html();
$cost = $dra*25;
if($dc->info['cash']<$cost) diex($str."<hr/>You need ".$cost." gems to process.");
$num=1;
$cmd=array();
$time=time();
$listdragon=array(1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,24,25,26 ​ ,27,28,29,30,31,32,33,34,35,36,37,38,39,40,45,46,47,48,49,50,54,55,56,57,58,59,6 ​ 0,61,62,63,64,65,66,67,68,69,72,73,74,75,76,77,79,80,81,82,83,84,85,86,87,88,89, ​ 90,101,102,103,104,105,106,110,111,112,113,114,115,116,117,118,119,120,121,122,1 ​ 24,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,1 ​ 44,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,2000, ​ 5000,5001,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013, ​ 1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1028,1029,1031, ​ 1032,1033,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052, ​ 1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068, ​ 1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084, ​ 1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100, ​ 1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116, ​ 1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132, ​ 1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148, ​ 1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164, ​ 1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180, ​1182,1183,1184,1187,1190,1196,1197,1194,1195);
for($i=0;$i<$dra;$i++){
if(in_array($dragon[$i],$listdragon)){
$cmd[]=array('number'=>$num,'time'=>$time,'args'=>array(2,(integer)$dragon[$i]),'cmd'=>'buy_offer_pack');
$num++;
}
}
if(count($cmd)<1) diex($str."empty dragon for process.");
$res = $dc->sendCommand($cmd);
if($res===false) diex($str."<hr/>ERROR.");
//$str .= "<hr/>".json_encode($res);
if(!$dc->getInfo()) infoError($str);
diex($str.$dc->html());
}else die($str."</body></html>");

function infoError($str){
die($str."<hr/>Get Info Error.</body></html>");
}

function diex($str){
die($str."</body></html>");
}

?>


dragoncity.class.php

Spoiler:
<?php
class DragonCity {
private $timeout = 120;
private $path = "http://dc-canvas.socialpointgames.com/dragoncity/web/srv/";
private $id = "";
private $ukey = "";
public $info = array();
public $ps = array();
public $ts = 0;

public function __construct($id,$ukey,$ver){
$this->ts = time();
$this->id = $id;
$this->ukey = $ukey;
$this->versi = $ver;
$this->info = array('name'=>"",'cash'=>0,'gold'=>0,'food'=>0,'level'=>1,'xp'=>0,'dragons'=>0,'storeDragon'=>0,'storeItems'=>0,'mondayReward'=>date('d-m-Y H:i:s',$this->ts+172800));
}
public function getInfo(){
if(!$this->sendPost($result,$this->path."get_player_info.php?USERID=".$this->id."&user_key=".$this->ukey."&spdebug=1")) return false;
$result = explode(";",$result);
$result = json_decode($result[1],true);
if(!$result) return false;
if(isset($result['playerInfo']['name'])) $this->info['name'] = $result['playerInfo']['name'];
if(isset($result['playerInfo']['cash'])) $this->info['cash'] = $result['playerInfo']['cash'];
if(isset($result['playerInfo']['gold'])) $this->info['gold'] = $result['playerInfo']['gold'];
if(isset($result['playerInfo']['food'])) $this->info['food'] = $result['playerInfo']['food'];
if(isset($result['playerInfo']['level'])) $this->info['level'] = $result['playerInfo']['level'];
if(isset($result['playerInfo']['xp'])) $this->info['xp'] = $result['playerInfo']['xp'];
if(isset($result['map']['dragons'])) $this->info['dragons'] = count($result['map']['dragons']);
if(isset($result['map']['store']['dragons'])) $this->info['storeDragon'] = count($result['map']['store']['dragons']);
if(isset($result['map']['store']['items'])) $this->info['storeItems'] = count($result['map']['store']['items']);
if(isset($result['timestamp'])) $this->ts = $result['timestamp'];
if(isset($result['privateState'])){
$this->ps = $result['privateState'];
$this->info['mondayReward']=date('d-m-Y H:i:s',$this->ps['timeStampMondayBonus']+172800);
}
unset($result);
return true;
}
public function html(){
$str = "<hr/>name: ".$this->info['name']."<br/>";
$str .= "cash: ".$this->info['cash']."<br/>";
$str .= "gold: ".$this->info['gold']."<br/>";
$str .= "food: ".$this->info['food']."<br/>";
$str .= "level: ".$this->info['level']."<br/>";
$str .= "xp: ".$this->info['xp']."<br/>";
$str .= "dragons: ".$this->info['dragons']."<br/>";
$str .= "storeDragon: ".$this->info['storeDragon']."<br/>";
$str .= "storeItems: ".$this->info['storeItems']."<br/>";
$str .= "mondayReward: ".$this->info['mondayReward']."<br/>";
return $str;
}
public function sendCommand($cmd){
$cmd = json_encode(array('publishActions'=>"0",'commands'=>$cmd,'flashVersion'=>$this->versi,'first_number'=>1,'tries'=>1,'ts'=>time()));
$hash = hash_hmac('sha256',$cmd,'RGhXbiy4xEeDnSNX1oBG');
$cmd=array('data'=>$hash.';'.$cmd,'id'=>$this->id);
if(!$this->sendPost($result,$this->path."packet.php?USERID=".$this->id."&user_key=".$this->ukey."&spdebug=1",$cmd)) return false;
$result = explode(";",$result);
$result = json_decode($result[1],true);
if(!$result) return false;
if(!isset($result['result'])) return false;
if(!$result['result']) return false;
if(isset($result['response'])) return $result['response'];
return array();
}
private function sendPost(&$result,$url,$data=null){
if($data!=null){
$postdata=http_build_query($data);
$opts = array('http' =>
array(
'method' => 'POST',
'timeout' => $this->timeout,
'header' => "Content-type: application/x-www-form-urlencoded\r\n"."Content-Length: ".strlen($postdata)."\r\n",
'content' => $postdata
)
);
}else $opts = array('http'=>array('timeout'=>$this->timeout));
$result=file_get_contents($url,false,stream_context_create($opts));
if(!$result) return false;
return true;
}

}


versi.txt

Spoiler:
0.6.4.3

Related Posts :

1 Response to "Script Dragon City Eggs"