From 6f7fcf9e44c14ff5c1e67a6c5e2ed499872ce076 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 21 Nov 2017 20:11:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=B3=D0=B3=D0=B8=D1=80=D1=83?= =?UTF-8?q?=D0=B5=D0=BC=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8E=20=D0=BE=20=D1=82=D0=B8=D0=BF=D0=B5=20=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D0=BC=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D1=82=D0=BE=D0=BA=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BD=D0=B0=20=D1=81=D0=B5=D1=80=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/modules/session/models/JoinForm.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/modules/session/models/JoinForm.php b/api/modules/session/models/JoinForm.php index c3ec952..f53d7f5 100644 --- a/api/modules/session/models/JoinForm.php +++ b/api/modules/session/models/JoinForm.php @@ -96,10 +96,11 @@ class JoinForm extends Model { /** @var MinecraftAccessKey|null $accessModel */ $accessModel = MinecraftAccessKey::findOne($accessToken); if ($accessModel !== null) { + Yii::$app->statsd->inc('sessionserver.authentication.legacy_minecraft_protocol'); /** @var MinecraftAccessKey|\api\components\OAuth2\Entities\AccessTokenEntity $accessModel */ if ($accessModel->isExpired()) { Session::error("User with access_token = '{$accessToken}' failed join by expired access_token."); - Yii::$app->statsd->inc('sessionserver.join.fail_token_expired'); + Yii::$app->statsd->inc('sessionserver.authentication.legacy_minecraft_protocol_token_expired'); throw new ForbiddenOperationException('Expired access_token.'); } @@ -117,9 +118,10 @@ class JoinForm extends Model { throw new ForbiddenOperationException('Invalid access_token.'); } + Yii::$app->statsd->inc('sessionserver.authentication.oauth2'); if (!Yii::$app->user->can(P::MINECRAFT_SERVER_SESSION)) { Session::error("User with access_token = '{$accessToken}' doesn't have enough scopes to make join."); - Yii::$app->statsd->inc('sessionserver.join.fail_not_enough_scopes'); + Yii::$app->statsd->inc('sessionserver.authentication.oauth2_not_enough_scopes'); throw new ForbiddenOperationException('The token does not have required scope.'); }