TrackManiaControl/application/plugins/Dedimania/DedimaniaData.php

48 lines
1.0 KiB
PHP
Raw Normal View History

2014-02-14 19:22:11 +01:00
<?php
/**
* Created by PhpStorm.
* User: Lukas
* Date: 14.02.14
* Time: 17:16
*/
namespace Dedimania;
2014-02-15 01:03:25 +01:00
use ManiaControl\ManiaControl;
use Maniaplanet\DedicatedServer\Structures\Version;
2014-02-14 19:22:11 +01:00
/**
* Dedimania Structure
*
* @author kremsy & steeffeen
*/
class DedimaniaData {
2014-02-15 01:03:25 +01:00
public $game;
public $path;
public $packmask;
public $serverVersion;
public $serverBuild;
public $tool;
public $version;
public $login;
public $code;
public function __construct($serverLogin, $dedimaniaCode, $path, $packmask, Version $serverVersion) {
$this->game = "TM2";
$this->login = $serverLogin;
$this->code = $dedimaniaCode;
$this->version = ManiaControl::VERSION;
$this->tool = "ManiaControl";
$this->path = $path;
$this->packmask = $packmask;
$this->serverVersion = $serverVersion->version;
$this->serverBuild = $serverVersion->build;
}
2014-02-14 19:22:11 +01:00
2014-02-15 01:03:25 +01:00
public function toArray() {
$array = array();
foreach(get_object_vars($this) as $key => $value)
$array[ucfirst($key)] = $value;
return $array;
2014-02-14 19:22:11 +01:00
}
}