mirror of
https://github.com/elyby/accounts.git
synced 2024-12-25 06:39:46 +05:30
27 lines
779 B
PHP
27 lines
779 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace api\modules\mojang;
|
|
|
|
use yii\base\BootstrapInterface;
|
|
|
|
class Module extends \yii\base\Module implements BootstrapInterface {
|
|
|
|
public $id = 'mojang';
|
|
|
|
public $defaultRoute = 'api';
|
|
|
|
/**
|
|
* @param \yii\base\Application $app
|
|
*/
|
|
public function bootstrap($app): void {
|
|
$legacyHost = $app->params['authserverHost'];
|
|
$app->getUrlManager()->addRules([
|
|
"//{$legacyHost}/mojang/api/users/profiles/minecraft/<username>" => "{$this->id}/api/uuid-by-username",
|
|
"//{$legacyHost}/mojang/api/user/profiles/<uuid>/names" => "{$this->id}/api/usernames-by-uuid",
|
|
"POST //{$legacyHost}/mojang/api/profiles/minecraft" => "{$this->id}/api/uuids-by-usernames",
|
|
]);
|
|
}
|
|
|
|
}
|