DCXP
DCXP
DCXP
PHP
if(isset($_POST['fbid'])){
$playerinfo=ambilplayerinfo($_POST['fbid'],$_POST['ukey']);
$data='=====================
';
$data.=ambilnama($playerinfo);
$data.='=======SEBELUM======
';
$data.=infodcfreegold($playerinfo);
$data.='=======SESUDAH======
';
$data.=dcfreexp($_POST['fbid'],$_POST['ukey'],$_POST['jumlah'],$playerinfo);
$data.='=====================';
echo $data;
}
function ambilkodedc($kode,$playerinfo){
foreach ($playerinfo['map']['items'] as $dat => $isi) {
if ($isi[0]==$kode){
return $dat;
}
}
}
function ambilplayerinfo($id,$ukey){
$result=sendPost("http://dc-
canvas.socialpointgames.com/dragoncity/web/srv/get_player_info.php?USERID=".
$id."&user_key=".$ukey."&spdebug=1",null);
$result = explode(";",$result);
$result = json_decode($result[1],true);
return $result;
}
function sendPost($url,$data=null){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: 127.0.0.1",
"X-Client-IP: 127.0.0.1",
"Client-IP: 127.0.0.1",
"HTTP_X_FORWARDED_FOR: 127.0.0.1",
"X-Forwarded-For: 127.0.0.1"));
for($i=1;$i<=$jum;$i++){
$cmd[]=array('number'=>1,'time'=>time(),'args'=>array($kodetavern),'cmd'=>'FinishBu
ilding');
$cmd[]=array('number'=>1,'time'=>time(),'args'=>array($kodetavern),'cmd'=>'FinishBu
ilding');
$cmd[]=array('number'=>1,'time'=>time(),'args'=>array($kodetavern),'cmd'=>'FinishBu
ilding');
$cmd[]=array('number'=>1,'time'=>time(),'args'=>array($kodetavern),'cmd'=>'FinishBu
ilding');
}
return $cmd;
}
function dcfreexp($id,$ukey,$jum,$playerinfo){
$kodetavern=ambilkodedc(18,$playerinfo);
$result=array();
$cmd=array();
$i=1;
$num=1;
if($jum==10){
$cmd=DCCmdXp($kodetavern,10);
$result=kirimperintah($id,$ukey,$cmd,$num);
}elseif($jum==20){
$cmd=DCCmdXp($kodetavern,20);
$result=kirimperintah($id,$ukey,$cmd,$num);
//$num=$num+count($cmd);
//$result=kirimperintah($id,$ukey,$cmd,$num);
}elseif($jum==45){
$cmd=DCCmdXp($kodetavern,20);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$cmd=DCCmdXp($kodetavern,10);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
}elseif($jum==1){
$cmd=DCCmdXp($kodetavern,20);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
}elseif($jum==2){
$cmd=DCCmdXp($kodetavern,20);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
}elseif($jum==3){
$cmd=DCCmdXp($kodetavern,20);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
}elseif($jum==4){
$cmd=DCCmdXp($kodetavern,20);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
$result=kirimperintah($id,$ukey,$cmd,$num);
$num=$num+count($cmd);
}
$ret='';
if($result['result']==true){
$data=ambilplayerinfo($id,$ukey);
$ret.=infodcfreegold($data);
}else{
$ret.='ERROR : bad user_key
';
}
return $ret;
}
?>