Permalink
Browse files

Update index.php

  • Loading branch information...
FinlayDaG33k committed Mar 7, 2017
1 parent c424767 commit 963e9edb3fa715e97ca3192285830205e5a8f5d9
Showing with 7 additions and 2 deletions.
  1. +7 −2 index.php
@@ -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;
}
@@ -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{

0 comments on commit 963e9ed

Please sign in to comment.