From f3b953607d1cdf341a874861d9e74521318b1718 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 25 Oct 2016 22:20:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=BE=D1=87=D0=B5=D1=80=D0=B5=D0=B4=D0=B8=20=D0=BF=D1=83?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/models/profile/ChangeUsernameForm.php | 2 +- common/components/Mojang/Api.php | 2 +- console/controllers/AccountQueueController.php | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/models/profile/ChangeUsernameForm.php b/api/models/profile/ChangeUsernameForm.php index c72b59b..b35d2be 100644 --- a/api/models/profile/ChangeUsernameForm.php +++ b/api/models/profile/ChangeUsernameForm.php @@ -78,7 +78,7 @@ class ChangeUsernameForm extends ApiForm { public function createEventTask($accountId, $newNickname, $oldNickname) { $model = new UsernameChanged; $model->accountId = $accountId; - $model-> oldUsername = $oldNickname; + $model->oldUsername = $oldNickname; $model->newUsername = $newNickname; $message = Amqp::getInstance()->prepareMessage($model, [ diff --git a/common/components/Mojang/Api.php b/common/components/Mojang/Api.php index 24bf8d2..960a6bf 100644 --- a/common/components/Mojang/Api.php +++ b/common/components/Mojang/Api.php @@ -14,7 +14,7 @@ class Api { * * @return UsernameToUUIDResponse * @throws MojangApiException - * @throws NoContentException + * @throws NoContentException|\GuzzleHttp\Exception\RequestException * @url http://wiki.vg/Mojang_API#Username_-.3E_UUID_at_time */ public function usernameToUUID($username, $atTime = null) { diff --git a/console/controllers/AccountQueueController.php b/console/controllers/AccountQueueController.php index 2ebd25a..72e7bcb 100644 --- a/console/controllers/AccountQueueController.php +++ b/console/controllers/AccountQueueController.php @@ -7,6 +7,7 @@ use common\components\RabbitMQ\Component as RabbitMQComponent; use common\models\amqp\UsernameChanged; use common\models\MojangUsername; use console\controllers\base\AmqpController; +use GuzzleHttp\Exception\RequestException; class AccountQueueController extends AmqpController { @@ -41,6 +42,8 @@ class AccountQueueController extends AmqpController { $response = $mojangApi->usernameToUUID($body->newUsername); } catch (NoContentException $e) { $response = false; + } catch (RequestException $e) { + return true; } /** @var MojangUsername|null $mojangUsername */