Skip to content

Commit

Permalink
Update index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
FinlayDaG33k committed Mar 7, 2017
1 parent c424767 commit 963e9ed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.php
Expand Up @@ -3,14 +3,18 @@ function update($data){
//echo count($data);
for($i = 0;$i < count($data['buildings']);$i++){
//echo $i . "<br />";
$data['buildings'][$i]['isUnderConstruction'] = false;

$data['buildings'][$i]['isUnderConstruction'] = 0;
$data['buildings'][$i]['constructionCounter'] = 0;
$data['buildings'][$i]['constructionPercentage'] = 0;
$data['buildings'][$i]['constructionProgress'] = null;
$data['buildings'][$i]['constructionTotal'] = 0;
$data['buildings'][$i]['constructionCounter'] = 0;
if($data['buildings'][$i]['acceptsWorkers'] > 0){
$data['buildings'][$i]['jobsAvailable'] = $data['buildings'][$i]['acceptsWorkers'];
}

}

return $data;
}

Expand All @@ -19,6 +23,7 @@ function update($data){
$mcz = json_decode(base64_decode(file_get_contents($_FILES['mcz']['tmp_name'])),1);
//echo json_encode($mcz['buildings'][259]);
//echo json_encode(update($mcz['buildings'][261])) . "<br /><br /><br />";
//echo json_encode($mcz);
//echo json_encode(update($mcz));
echo base64_encode(json_encode(update($mcz)));
}else{
Expand Down

0 comments on commit 963e9ed

Please sign in to comment.