DC

Kali ini saya akan ngeposting script DC :D

 ini adalah "dragoncity.class.php"
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'] = number_format((double)$result['playerInfo']['cash'],0,',','.'); if(isset($result['playerInfo']['gold'])) $this->info['gold'] = number_format((double)$result['playerInfo']['gold'],0,',','.'); if(isset($result['playerInfo']['food'])) $this->info['food'] = number_format((double)$result['playerInfo']['food'],0,',','.'); if(isset($result['playerInfo']['level'])) $this->info['level'] = $result['playerInfo']['level']; if(isset($result['playerInfo']['xp'])) $this->info['xp'] = number_format((double)$result['playerInfo']['xp'],0,',','.'); 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); if($this->ts-$this->ps['timeStampMondayBonus']>172800) $this->info['mondayReward'] .= " Claim"; } unset($result); return true; } public function html(){ $str = "

name: ".$this->info['name']."
"; $str .= "cash: ".$this->info['cash']."
"; $str .= "gold: ".$this->info['gold']."
"; $str .= "food: ".$this->info['food']."
"; $str .= "level: ".$this->info['level']."
"; $str .= "xp: ".$this->info['xp']."
"; $str .= "dragons: ".$this->info['dragons']."
"; $str .= "storeDragon: ".$this->info['storeDragon']."
"; $str .= "storeItems: ".$this->info['storeItems']."
"; $str .= "mondayReward: ".$this->info['mondayReward']."
"; 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; } public function getLevelDCByXp($xp){ $listlevel=array(0,200,500,1400,2900,4900,9900,19900,34900,59900,94900,144900,244900,394900,694900,1194900,1944900,2944900,4194900,5694900,7444900,9444900,11944900,14944900,18444900,22444900,26944900,31944900,37444900,43444900,49944900,56944900,64444900,72444900,80944900,89944900,99444900,109444900,119944900,130944900,142444900,154444900,166944900,179944900,193444900,207444900,221944900,236944900,252444900,268444900,2016089205); $j=count($listlevel); for($i=0;$i<$j;$i++){ if($listlevel[$i] > $xp) break; } unset($listlevel); return $i; } }
0 Komentar untuk "DC"

Back To Top