TrackManiaControl/core/Callbacks/Structures/ShootMania/OnAFKPropertiesStructure.php

74 lines
1.7 KiB
PHP
Raw Normal View History

<?php
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseResponseStructure;
use ManiaControl\ManiaControl;
/**
* Structure Class for the AFK Properties Callback
*
* @api
* @author ManiaControl Team <mail@maniacontrol.com>
2018-03-27 20:11:40 +02:00
* @copyright 2014-2018 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class OnAFKPropertiesStructure extends BaseResponseStructure {
protected $idleTimeLimit;
protected $spawnTimeLimit;
protected $checkInterval;
protected $forceSpec;
/**
* Construct a new On Hit Structure
*
* @param ManiaControl $maniaControl
* @param array $data
*/
public function __construct(ManiaControl $maniaControl, $data) {
parent::__construct($maniaControl, $data);
$jsonObj = $this->getPlainJsonObject();
$this->idleTimeLimit = $jsonObj->idletimelimit;
$this->spawnTimelimit = $jsonObj->spawntimelimit;
$this->checkInterval = $jsonObj->checkinterval;
$this->forceSpec = $jsonObj->forcespec;
}
/**
* Time after which a player is considered to be AFK (ms)
*
* @api
* @return int
*/
public function getIdleTimeLimit() {
return (int) $this->idleTimeLimit;
}
/**
* Time after spawn before which a player can't be considered to be
*
* @return int
*/
public function getSpawnTimeLimit() {
return (int) $this->spawnTimeLimit;
}
/**
* Time between each AFK check (ms)
*
* @return int
*/
public function getCheckInterval() {
return (int) $this->checkInterval;
}
/**
* Let the library force the AFK player into spectator mode
*
* @return bool
*/
public function getForceSpec() {
return $this->forceSpec;
}
}