readded team plugins with proper names
added empty files for replacing old files
This commit is contained in:
1196
application/plugins/Dedimania/Dedimania.php
Normal file
1196
application/plugins/Dedimania/Dedimania.php
Normal file
File diff suppressed because it is too large
Load Diff
95
application/plugins/Dedimania/DedimaniaData.php
Normal file
95
application/plugins/Dedimania/DedimaniaData.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
namespace Dedimania;
|
||||
|
||||
use ManiaControl\ManiaControl;
|
||||
use Maniaplanet\DedicatedServer\Structures\Version;
|
||||
|
||||
/**
|
||||
* ManiaControl Dedimania Plugin DataStructure
|
||||
*
|
||||
* @author kremsy and steeffeen
|
||||
* @copyright ManiaControl Copyright © 2014 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class DedimaniaData {
|
||||
public $game;
|
||||
public $path;
|
||||
public $packmask;
|
||||
public $serverVersion;
|
||||
public $serverBuild;
|
||||
public $tool;
|
||||
public $version;
|
||||
public $login;
|
||||
public $code;
|
||||
public $sessionId = '';
|
||||
public $records = array();
|
||||
public $players = array();
|
||||
public $directoryAccessChecked = false;
|
||||
public $serverMaxRank = 30;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
$array = array();
|
||||
foreach(get_object_vars($this) as $key => $value) {
|
||||
if ($key == 'records' || $key == 'sessionId' || $key == 'directoryAccessChecked' || $key == 'serverMaxRank' || $key == 'players') {
|
||||
continue;
|
||||
}
|
||||
$array[ucfirst($key)] = $value;
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
public function getRecordCount() {
|
||||
return count($this->records);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Max Rank for a certain Player
|
||||
*
|
||||
* @param $login
|
||||
* @return int
|
||||
*/
|
||||
public function getPlayerMaxRank($login) {
|
||||
$maxRank = $this->serverMaxRank;
|
||||
foreach($this->players as $player) {
|
||||
/** @var DedimaniaPlayer $player */
|
||||
if ($player->login === $login) {
|
||||
if ($player->maxRank > $maxRank) {
|
||||
$maxRank = $player->maxRank;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $maxRank;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a Player to the Players array
|
||||
*
|
||||
* @param DedimaniaPlayer $player
|
||||
*/
|
||||
public function addPlayer(DedimaniaPlayer $player) {
|
||||
/** @var DedimaniaPlayer $player */
|
||||
$this->players[$player->login] = $player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a Dedimania Player by its login
|
||||
*
|
||||
* @param string $player
|
||||
*/
|
||||
public function removePlayer($login) {
|
||||
unset($this->players[$login]);
|
||||
}
|
||||
}
|
38
application/plugins/Dedimania/DedimaniaPlayer.php
Normal file
38
application/plugins/Dedimania/DedimaniaPlayer.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace Dedimania;
|
||||
|
||||
/**
|
||||
* ManiaControl Dedimania-Plugin Player DataStructure
|
||||
*
|
||||
* @author kremsy and steeffeen
|
||||
* @copyright ManiaControl Copyright © 2014 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class DedimaniaPlayer {
|
||||
public $login = '';
|
||||
public $maxRank = -1;
|
||||
public $banned = false;
|
||||
public $optionsEnabled = false;
|
||||
public $options = '';
|
||||
|
||||
public function __construct($player) {
|
||||
if (!$player) return;
|
||||
|
||||
$this->login = $player['Login'];
|
||||
$this->maxRank = $player['MaxRank'];
|
||||
$this->banned = $player['Banned'];
|
||||
$this->optionsEnabled = $player['OptionsEnabled'];
|
||||
$this->options = $player['Options'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Player by its login and maxRank
|
||||
*
|
||||
* @param $login
|
||||
* @param $maxRank
|
||||
*/
|
||||
public function constructNewPlayer($login, $maxRank) {
|
||||
$this->login = $login;
|
||||
$this->maxRank = $maxRank;
|
||||
}
|
||||
}
|
61
application/plugins/Dedimania/RecordData.php
Normal file
61
application/plugins/Dedimania/RecordData.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace Dedimania;
|
||||
|
||||
/**
|
||||
* ManiaControl Dedimania-Plugin Record DataStructure
|
||||
*
|
||||
* @author kremsy and steeffeen
|
||||
* @copyright ManiaControl Copyright © 2014 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
use ManiaControl\Formatter;
|
||||
|
||||
class RecordData {
|
||||
public $nullRecord = false;
|
||||
public $login = '';
|
||||
public $nickName = '';
|
||||
public $best = -1;
|
||||
public $rank = -1;
|
||||
public $maxRank = -1;
|
||||
public $checkpoints = '';
|
||||
public $newRecord = false;
|
||||
public $vReplay = '';
|
||||
public $top1GReplay = '';
|
||||
|
||||
/**
|
||||
* Construct a Record by a given Record Array
|
||||
*
|
||||
* @param $record
|
||||
*/
|
||||
public function __construct($record) {
|
||||
if (!$record) {
|
||||
$this->nullRecord = true;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->login = $record['Login'];
|
||||
$this->nickName = Formatter::stripDirtyCodes($record['NickName']);
|
||||
$this->best = $record['Best'];
|
||||
$this->rank = $record['Rank'];
|
||||
$this->maxRank = $record['MaxRank'];
|
||||
$this->checkpoints = $record['Checks'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new Record via it's properties
|
||||
*
|
||||
* @param $login
|
||||
* @param $nickName
|
||||
* @param $best
|
||||
* @param $checkpoints
|
||||
* @param bool $newRecord
|
||||
*/
|
||||
public function constructNewRecord($login, $nickName, $best, $checkpoints, $newRecord = false) {
|
||||
$this->nullRecord = false;
|
||||
$this->login = $login;
|
||||
$this->nickName = $nickName;
|
||||
$this->best = $best;
|
||||
$this->checkpoints = $checkpoints;
|
||||
$this->newRecord = $newRecord;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user