titleprefix fix
This commit is contained in:
committed by
Steffen Schröder
parent
49805f06b3
commit
dbdc318bba
@ -170,12 +170,8 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
|
||||
$itemMarginFactorX = 1.3;
|
||||
$itemMarginFactorY = 1.2;
|
||||
|
||||
// Get Title Id
|
||||
$titleId = $this->maniaControl->server->titleId;
|
||||
$titlePrefix = strtoupper(substr($titleId, 0, 2));
|
||||
|
||||
//If game is shootmania lower the icons position by 20
|
||||
if($titlePrefix == 'SM') {
|
||||
if ($this->maniaControl->mapManager->getCurrentMap()->getGame() == 'sm') {
|
||||
$posY -= $shootManiaOffset;
|
||||
}
|
||||
|
||||
|
@ -190,9 +190,7 @@ class CallbackManager {
|
||||
$callbackName = $callback[0];
|
||||
switch($callbackName) {
|
||||
case 'ManiaPlanet.BeginMatch':
|
||||
$titleId = $this->maniaControl->server->titleId;
|
||||
$titlePrefix = strtolower(substr($titleId, 0, 2));
|
||||
if ($titlePrefix == "sm") {
|
||||
if ($this->maniaControl->mapManager->getCurrentMap()->getGame() == 'sm') {
|
||||
$this->triggerCallback($callbackName, $callback);
|
||||
break;
|
||||
}
|
||||
@ -201,9 +199,7 @@ class CallbackManager {
|
||||
$this->triggerCallback($callbackName, $callback);
|
||||
break;
|
||||
case 'ManiaPlanet.EndMatch': //TODO temporary fix
|
||||
$titleId = $this->maniaControl->server->titleId;
|
||||
$titlePrefix = strtolower(substr($titleId, 0, 2));
|
||||
if ($titlePrefix == "sm") {
|
||||
if ($this->maniaControl->mapManager->getCurrentMap()->getGame() == 'sm') {
|
||||
$this->triggerCallback($callbackName, $callback);
|
||||
break;
|
||||
}
|
||||
|
@ -180,9 +180,8 @@ class ManiaExchangeManager {
|
||||
* @return bool
|
||||
*/
|
||||
public function getMapInfo($id, $function) {
|
||||
// Get Title Id
|
||||
$titleId = $this->maniaControl->server->titleId;
|
||||
$titlePrefix = strtolower(substr($titleId, 0, 2));
|
||||
// Get Title Prefix
|
||||
$titlePrefix = $this->maniaControl->mapManager->getCurrentMap()->getGame();
|
||||
|
||||
// compile search URL
|
||||
$url = 'http://api.mania-exchange.com/' . $titlePrefix . '/maps/?ids=' . $id;
|
||||
@ -211,9 +210,8 @@ class ManiaExchangeManager {
|
||||
* @return array|null
|
||||
*/
|
||||
public function getMaplistByMixedUidIdString($string) {
|
||||
// Get Title Id
|
||||
$titleId = $this->maniaControl->server->titleId;
|
||||
$titlePrefix = strtolower(substr($titleId, 0, 2));
|
||||
// Get Title Prefix
|
||||
$titlePrefix = $this->maniaControl->mapManager->getCurrentMap()->getGame();
|
||||
|
||||
// compile search URL
|
||||
$url = 'http://api.mania-exchange.com/' . $titlePrefix . '/maps/?ids=' . $string;
|
||||
@ -269,7 +267,7 @@ class ManiaExchangeManager {
|
||||
|
||||
// Get Title Id
|
||||
$titleId = $this->maniaControl->server->titleId;
|
||||
$titlePrefix = strtolower(substr($titleId, 0, 2));
|
||||
$titlePrefix = $this->maniaControl->mapManager->getCurrentMap()->getGame();
|
||||
|
||||
// compile search URL
|
||||
$url = 'http://' . $titlePrefix . '.mania-exchange.com/tracksearch?api=on';
|
||||
|
@ -50,7 +50,7 @@ class Map {
|
||||
return;
|
||||
}
|
||||
$this->name = FORMATTER::stripDirtyCodes($mpMap->name);
|
||||
$this->rawName = $mpMap->name;
|
||||
$this->rawName = $mpMap->name;
|
||||
$this->uid = $mpMap->uId;
|
||||
$this->fileName = $mpMap->fileName;
|
||||
$this->authorLogin = $mpMap->author;
|
||||
@ -65,6 +65,24 @@ class Map {
|
||||
$this->authorNick = $this->authorLogin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get's the gameType of the Current Map
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGame() {
|
||||
switch($this->environment) {
|
||||
case 'Storm':
|
||||
return "sm";
|
||||
case 'Canyon':
|
||||
case 'Stadium':
|
||||
case 'Valley':
|
||||
return "tm";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a map Update is available
|
||||
*
|
||||
|
Reference in New Issue
Block a user