From b5da8f652cf0f2e78e0afea720170808cf29b597 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 27 Jul 2016 00:19:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=81=20=D1=84=D1=80=D0=BE=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app.php b/app.php index cb14912..a785381 100644 --- a/app.php +++ b/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) { $textures['SKIN']['metadata']['model'] = 'slim'; } @@ -79,7 +87,7 @@ $app->post('/system/setSkin', function() use ($app) { $skin->isSlim = (bool) $request->getPost('isSlim', 'int'); $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) {