1
0
forked from metin2/web

Added website Docker image, bumped PHP version, added mall authentication, added experimental patcher support, improved migrations, added teasers

This commit is contained in:
2024-09-22 21:14:31 +03:00
parent a1d0a5b9cf
commit dea61c5a0c
253 changed files with 23071 additions and 547 deletions

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -17,6 +18,10 @@ return new class extends Migration
$table->string('mKey')->default('')->primary();
$table->string('mValue')->default('');
});
// Populate the table data
$data = File::json(database_path('data/locale.json'));
\App\Models\Game\Common\Locale::upsert($data, ['mKey']);
}
/**

View File

@ -14,6 +14,11 @@ return new class extends Migration
public function up()
{
Schema::connection('common')->create('spam_db', function (Blueprint $table) {
// TODO: update this to modern standards (InnoDB & utf8mb4)
$table->engine = "MyISAM";
$table->charset = "utf8";
$table->collation = "utf8_general_ci";
$table->set('type', ['GOOD', 'SPAM'])->default('SPAM');
$table->string('word', 256)->primary();
$table->integer('score')->default(10);

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -14,8 +15,12 @@ return new class extends Migration
public function up()
{
Schema::connection('player')->create('banword', function (Blueprint $table) {
$table->binary('word')->default('')->primary();
$table->binary('word', length: 24)->default('')->primary();
});
// Populate the table data
$data = File::json(database_path('data/banword.json'));
\App\Models\Game\Player\Banword::upsert($data, ['word']);
}
/**

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -30,6 +31,10 @@ return new class extends Migration
$table->string('shield', 100)->default('');
$table->string('ear', 100)->default('');
});
// Populate the table data
$data = File::json(database_path('data/item_attr_rare.json'));
\App\Models\Game\Player\ItemAttrRare::upsert($data, ['apply']);
}
/**

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -30,6 +31,10 @@ return new class extends Migration
$table->string('shield', 100)->default('');
$table->string('ear', 100)->default('');
});
// Populate the table data
$data = File::json(database_path('data/item_attr.json'));
\App\Models\Game\Player\ItemAttr::upsert($data, ['apply']);
}
/**

View File

@ -15,8 +15,8 @@ return new class extends Migration
{
Schema::connection('player')->create('item_proto', function (Blueprint $table) {
$table->unsignedInteger('vnum')->default(0)->primary();
$table->binary('name')->default('Noname');
$table->binary('locale_name')->default('Noname');
$table->binary('name', length: 24)->default('Noname');
$table->binary('locale_name', length: 24)->default('Noname');
$table->tinyInteger('type')->default(0);
$table->tinyInteger('subtype')->default(0);
$table->tinyInteger('weight')->nullable()->default(0);

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -25,6 +26,10 @@ return new class extends Migration
$table->unsignedInteger('price')->default(0);
$table->enum('enable', ['YES', 'NO'])->default('NO');
});
// Populate the table data
$data = File::json(database_path('data/land.json'));
\App\Models\Game\Player\Land::upsert($data, ['id']);
}
/**

View File

@ -15,8 +15,8 @@ return new class extends Migration
{
Schema::connection('player')->create('mob_proto', function (Blueprint $table) {
$table->integer('vnum')->default(0)->primary();
$table->string('name', 24)->default('Noname');
$table->binary('locale_name')->default('Noname ');
$table->binary('name', length: 24)->default('Noname');
$table->binary('locale_name', length: 24)->default('Noname');
$table->tinyInteger('rank')->default(0);
$table->tinyInteger('type')->default(0);
$table->boolean('battle_type')->default(false);

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -29,6 +30,10 @@ return new class extends Migration
$table->unsignedInteger('group_vnum')->default(0);
$table->unsignedInteger('dependent_group')->default(0);
});
// Populate the table data
$data = File::json(database_path('data/object_proto.json'));
\App\Models\Game\Player\ObjectProto::upsert($data, ['vnum']);
}
/**

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -30,6 +31,10 @@ return new class extends Migration
$table->unsignedInteger('result_vnum')->default(0);
$table->smallInteger('prob')->default(100);
});
// Populate the table data
$data = File::json(database_path('data/refine_proto.json'));
\App\Models\Game\Player\RefineProto::upsert($data, ['id']);
}
/**

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -20,6 +21,10 @@ return new class extends Migration
$table->unique(['shop_vnum', 'item_vnum', 'count'], 'vnum_unique');
});
// Populate the table data
$data = File::json(database_path('data/shop_item.json'));
\App\Models\Game\Player\ShopItem::upsert($data, ['shop_vnum', 'item_vnum']);
}
/**

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -18,6 +19,10 @@ return new class extends Migration
$table->string('name', 32)->default('Noname');
$table->smallInteger('npc_vnum')->default(0);
});
// Populate the table data
$data = File::json(database_path('data/shop.json'));
\App\Models\Game\Player\Shop::upsert($data, ['vnum']);
}
/**

View File

@ -2,6 +2,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
@ -15,7 +16,7 @@ return new class extends Migration
{
Schema::connection('player')->create('skill_proto', function (Blueprint $table) {
$table->integer('dwVnum')->default(0)->primary();
$table->string('szName', 32)->default('');
$table->binary('szName', 32)->default('');
$table->tinyInteger('bType')->default(0);
$table->tinyInteger('bLevelStep')->default(0);
$table->tinyInteger('bMaxLevel')->default(0);
@ -46,6 +47,14 @@ return new class extends Migration
$table->integer('dwTargetRange')->default(1000);
$table->unsignedInteger('dwSplashRange')->default(0);
});
// Populate the table data
$data = File::json(database_path('data/skill_proto.json'));
foreach ($data as $key => &$value) {
// Decode szName from the base64 encoding
$value['szName'] = base64_decode($value['szName']);
}
\App\Models\Game\Player\SkillProto::upsert($data, ['dwVnum']);
}
/**

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::connection('website')->create('guild_highscore_cache', function (Blueprint $table) {
$table->bigInteger('id', true);
$table->text('name');
$table->text('master');
$table->integer('empire');
$table->bigInteger('level');
$table->bigInteger('ladder_point');
$table->timestamp('date')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('website')->dropIfExists('guild_highscore_cache');
}
};

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::connection('website')->create('highscore_cache', function (Blueprint $table) {
$table->bigInteger('id', true);
$table->text('name');
$table->integer('job');
$table->integer('empire');
$table->bigInteger('level');
$table->bigInteger('exp');
$table->timestamp('date')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('website')->dropIfExists('highscore_cache');
}
};

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::connection('website')->create('mall_categories', function (Blueprint $table) {
$table->integer('id', true);
$table->text('name');
});
// Populate the table data
$data = File::json(database_path('data/mall_categories.json'));
\App\Models\Mall\MallCategory::upsert($data, ['id']);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('website')->dropIfExists('mall_categories');
}
};

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::connection('website')->create('mall_data', function (Blueprint $table) {
$table->unsignedInteger('vnum')->default(0)->primary();
$table->unsignedInteger('socket0')->default(0);
$table->unsignedInteger('socket1')->default(0);
$table->unsignedInteger('socket2')->default(0);
$table->unsignedInteger('socket3')->default(0);
$table->unsignedInteger('socket4')->default(0);
$table->unsignedInteger('socket5')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('website')->dropIfExists('mall_data');
}
};

View File

@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::connection('website')->create('mall_items', function (Blueprint $table) {
$table->integer('id', true);
$table->integer('vnum');
$table->integer('category_id');
$table->integer('old_price')->nullable();
$table->integer('price');
$table->enum('pricing', ['CASH', 'MILEAGE'])->default('CASH');
$table->integer('quantity');
$table->text('image')->nullable();
$table->text('description')->nullable();
$table->enum('other', ['recommend', 'recommend_desc'])->nullable();
});
// Populate the table data
$data = File::json(database_path('data/mall_items.json'));
\App\Models\Mall\MallItem::upsert($data, ['id']);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('website')->dropIfExists('mall_items');
}
};

View File

@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::connection('website')->create('mall_storage', function (Blueprint $table) {
$table->bigInteger('id', true);
$table->unsignedInteger('owner_id')->default(0)->index('owner_id_idx');
$table->unsignedTinyInteger('count')->default(0);
$table->unsignedInteger('vnum')->default(0)->index('item_vnum_index');
$table->unsignedInteger('socket0')->default(0);
$table->unsignedInteger('socket1')->default(0);
$table->unsignedInteger('socket2')->default(0);
$table->unsignedInteger('socket3')->default(0);
$table->unsignedInteger('socket4')->default(0);
$table->unsignedInteger('socket5')->default(0);
$table->tinyInteger('attrtype0')->default(0);
$table->smallInteger('attrvalue0')->default(0);
$table->tinyInteger('attrtype1')->default(0);
$table->smallInteger('attrvalue1')->default(0);
$table->tinyInteger('attrtype2')->default(0);
$table->smallInteger('attrvalue2')->default(0);
$table->tinyInteger('attrtype3')->default(0);
$table->smallInteger('attrvalue3')->default(0);
$table->tinyInteger('attrtype4')->default(0);
$table->smallInteger('attrvalue4')->default(0);
$table->tinyInteger('attrtype5')->default(0);
$table->smallInteger('attrvalue5')->default(0);
$table->tinyInteger('attrtype6')->default(0);
$table->smallInteger('attrvalue6')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('website')->dropIfExists('mall_storage');
}
};