This commit is contained in:
2026-10-03 14:33:08 +04:00
parent 6a73d760c4
commit 93a9442e1c
67 changed files with 941 additions and 698 deletions
@@ -6,7 +6,7 @@ use App\Exceptions\DuplicateGameAccountException;
use App\Exceptions\InviteCodeException;
use App\Http\Controllers\Controller;
use App\Http\Requests\RegisterGameAccountRequest;
use App\Services\AzerothCoreAccountRegistrar;
use App\Services\VMangosAccountRegistrar;
use App\Services\InviteCodeService;
use Illuminate\Http\JsonResponse;
use OpenApi\Attributes as OA;
@@ -17,18 +17,18 @@ class LauncherRegistrationController extends Controller
#[OA\Post(
path: '/api/launcher/register',
summary: 'Зарегистрировать игровой аккаунт',
description: 'Создаёт игровой аккаунт AzerothCore. Инвайт-код обязателен, если на сервере включена регистрация по приглашениям.',
description: 'Создаёт аккаунт сайта и vMaNGOS со случайным игровым паролем. Для входа в игру лаунчер выдаёт билет. Инвайт-код обязателен, если включена регистрация по приглашениям.',
tags: ['Launcher Auth'],
requestBody: new OA\RequestBody(
required: true,
content: new OA\JsonContent(
required: ['username', 'email', 'password', 'password_confirmation', 'terms'],
properties: [
new OA\Property(property: 'username', type: 'string', minLength: 3, maxLength: 32, pattern: '^[A-Za-z0-9]+$', example: 'Player'),
new OA\Property(property: 'username', type: 'string', minLength: 3, maxLength: 16, pattern: '^[A-Za-z0-9]+$', example: 'Player'),
new OA\Property(property: 'email', type: 'string', format: 'email', maxLength: 255, example: 'player@example.com'),
new OA\Property(property: 'invite_code', type: 'string', minLength: 6, maxLength: 32, nullable: true, example: 'ABCD-EFGH-IJKL'),
new OA\Property(property: 'password', type: 'string', minLength: 8, maxLength: 32, example: 'Secret123'),
new OA\Property(property: 'password_confirmation', type: 'string', minLength: 8, maxLength: 32, example: 'Secret123'),
new OA\Property(property: 'password', type: 'string', minLength: 8, maxLength: 16, example: 'Secret123'),
new OA\Property(property: 'password_confirmation', type: 'string', minLength: 8, maxLength: 16, example: 'Secret123'),
new OA\Property(property: 'terms', type: 'boolean', example: true, description: 'Согласие с правилами сервера и пользовательским соглашением'),
],
),
@@ -82,7 +82,7 @@ class LauncherRegistrationController extends Controller
)]
public function store(
RegisterGameAccountRequest $request,
AzerothCoreAccountRegistrar $registrar,
VMangosAccountRegistrar $registrar,
InviteCodeService $inviteCodes,
): JsonResponse {
try {