🔐 AuthServer API - MuEmu

v1.0.0 - Autenticação para MuEmu

📊 Status da API

PHP 8.1.34 (requerido: 7.0+)
Extensão PDO
Extensão PDO MySQL
Extensão JSON
Arquivo de configuração (config.php)
Conexão com banco MySQL

🔗 Endpoint de Autenticação

POST /v1/auth.php

Use este endpoint no GameServer (Protect.cpp) para validar licenças.

🚀 Como Configurar

  1. Configure o banco MySQL:
    mysql -u root -p < sql/mysql_tables.sql
  2. Edite api/config/config.php:
    define('API_KEY', 'sua_chave');
    define('DB_HOST', 'localhost');
    define('DB_NAME', 'muonline');
  3. Configure o Common.dat do GameServer:
    CustomerName=GBSOficial
    CustomerHardwareId=1234...ABC
    UseApiMode=1
    ApiUrl=http://seu-servidor.com/api/v1/auth.php
    ApiKey=sua_chave
  4. Compile o GameServer (já está atualizado)
  5. Inicie o GameServer - ele autenticará automaticamente!

🧪 Testar a API

Use curl ou Postman para testar:

curl -X POST http://auth.helpserver.net/v1/auth.php \ -H "Content-Type: application/json" \ -H "X-API-Key: sua_chave" \ -d '{"customer_name":"GBSOficial","hardware_id":"1234...","server_type":"game_server"}' Testar no Navegador

📦 Resposta da API

{ "status": "success", "data": { "valid": true, "package_type": 1, "plan_type": 1, "customer_name": "GBSOficial", "hardware_id": "1234...ABC" } }

🗄️ Tabelas MySQL

Tabela Descrição
User Usuários/Clientes
License Licenças (UserId, ProductId, HardwareId)
AuthLog Log de autenticações

ProductId: 1=Connect, 2=Join, 3=Data, 4=Game

AuthServer API - Integrada com GameServer MuEmu