Fixed texture URLs.
This commit is contained in:
parent
9687753926
commit
941bfe75f6
2 changed files with 4 additions and 3 deletions
|
@ -57,7 +57,7 @@ $router->setDefaultErrorHandler(function($response, $request, $code, $text) use
|
||||||
(new RpcRoutes($users, $accountLinks, $authorisations, $verifications, $config['rpc_secret'], $config['clients_url']))->register($router);
|
(new RpcRoutes($users, $accountLinks, $authorisations, $verifications, $config['rpc_secret'], $config['clients_url']))->register($router);
|
||||||
(new HomeRoutes(new Servers($db), $templating, $authInfo, $config['login_url']))->register($router);
|
(new HomeRoutes(new Servers($db), $templating, $authInfo, $config['login_url']))->register($router);
|
||||||
(new ClientsRoutes($templating, $accountLinks, $authorisations, $verifications, $csrfp, $authInfo))->register($router);
|
(new ClientsRoutes($templating, $accountLinks, $authorisations, $verifications, $csrfp, $authInfo))->register($router);
|
||||||
(new SkinsRoutes($templating, $accountLinks, new Skins($db), new Capes($db), $csrfp, $authInfo))->register($router);
|
(new SkinsRoutes($templating, $accountLinks, new Skins($db), new Capes($db), $csrfp, $authInfo, $config['skins_base_url']))->register($router);
|
||||||
(new WhitelistRoutes(new Whitelist($db), $csrfp, $authInfo))->register($router);
|
(new WhitelistRoutes(new Whitelist($db), $csrfp, $authInfo))->register($router);
|
||||||
|
|
||||||
MojangInterop::registerRoutes($router);
|
MojangInterop::registerRoutes($router);
|
||||||
|
|
|
@ -23,7 +23,8 @@ class SkinsRoutes {
|
||||||
private Skins $skins,
|
private Skins $skins,
|
||||||
private Capes $capes,
|
private Capes $capes,
|
||||||
private CSRFP $csrfp,
|
private CSRFP $csrfp,
|
||||||
private object $authInfo
|
private object $authInfo,
|
||||||
|
private string $baseUrl
|
||||||
) {
|
) {
|
||||||
if(!is_dir(self::TEXTURES_PATH))
|
if(!is_dir(self::TEXTURES_PATH))
|
||||||
throw new RuntimeException('Textures directory does not exist.');
|
throw new RuntimeException('Textures directory does not exist.');
|
||||||
|
@ -53,7 +54,7 @@ class SkinsRoutes {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRemotePath(string $hash, bool $includeDomain): string {
|
public function getRemotePath(string $hash, bool $includeDomain): string {
|
||||||
return ($includeDomain ? 'https://mc.edgii.net' : '') . self::TEXTURES_DIR . '/' . $hash . '.png';
|
return ($includeDomain ? $this->baseUrl : '') . self::TEXTURES_DIR . '/' . $hash . '.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteLocalFileMaybe(string $hash): void {
|
public function deleteLocalFileMaybe(string $hash): void {
|
||||||
|
|
Loading…
Reference in a new issue