mirror of
https://github.com/elyby/chrly.git
synced 2025-01-03 18:51:49 +05:30
Перенесены изменения с фронта
This commit is contained in:
parent
796a2fcde8
commit
b5da8f652c
10
app.php
10
app.php
@ -50,6 +50,14 @@ $app->get('/textures/{nickname}', function($nickname) use ($app) {
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$capePath = __DIR__ . '/cloaks/' . $nickname . '.png';
|
||||||
|
if (file_exists($capePath)) {
|
||||||
|
$textures['CAPE'] = [
|
||||||
|
'url' => '/cloaks/' . mb_convert_case($nickname, MB_CASE_LOWER) . '.png',
|
||||||
|
'hash' => md5_file($capePath),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
if ($skin && $skin->isSlim) {
|
if ($skin && $skin->isSlim) {
|
||||||
$textures['SKIN']['metadata']['model'] = 'slim';
|
$textures['SKIN']['metadata']['model'] = 'slim';
|
||||||
}
|
}
|
||||||
@ -79,7 +87,7 @@ $app->post('/system/setSkin', function() use ($app) {
|
|||||||
$skin->isSlim = (bool) $request->getPost('isSlim', 'int');
|
$skin->isSlim = (bool) $request->getPost('isSlim', 'int');
|
||||||
$skin->url = $request->getPost('url', 'string');
|
$skin->url = $request->getPost('url', 'string');
|
||||||
|
|
||||||
return $app->view->setContent($skin->save() ? 'OK' : 'ERROR');
|
return $app->response->setContent($skin->save() ? 'OK' : 'ERROR');
|
||||||
});
|
});
|
||||||
|
|
||||||
$app->notFound(function () use ($app) {
|
$app->notFound(function () use ($app) {
|
||||||
|
Loading…
Reference in New Issue
Block a user