Пример #1
0
 public function collect($playerID)
 {
     //collecting there free life yay!
     Validate::player($playerID);
     if ($_POST['payload'] == 'true') {
         $_POST['payload'] = Util::hashPost($_POST);
     }
     if (!$_POST || !$_POST['payload']) {
         throw new NInjaException("Error in request");
     }
     //clean it up since it seems speaces are getting added
     //TODO make it so I don't have to do this.
     $data = str_replace(' ', '+', $_POST['payload']);
     $playerModel = new PlayerModel();
     $return = $playerModel->collectLife($playerID, $data);
     $return['status'] = 'ok';
     $this->printJson($return);
 }