Добавлена логика HasJoined для сервера авторизации Minecraft

Исправлена ошибка в JoinForm
Добавлено базовое API для общения с сервером системы скинов
This commit is contained in:
ErickSkrauch
2016-09-06 12:56:39 +03:00
parent 198e440b8d
commit 68ce8b3fb6
17 changed files with 444 additions and 4 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace api\modules\session\models\protocols;
use yii\validators\RequiredValidator;
abstract class BaseHasJoined implements HasJoinedInterface {
private $username;
private $serverId;
public function __construct(string $username, string $serverId) {
$this->username = $username;
$this->serverId = $serverId;
}
public function getUsername() : string {
return $this->username;
}
public function getServerId() : string {
return $this->serverId;
}
public function validate() : bool {
$validator = new RequiredValidator();
return $validator->validate($this->username)
&& $validator->validate($this->serverId);
}
}