├── README.md ├── Setup.bat ├── Start MariaDB.bat ├── Start_alpha-core.bat ├── Stop MariaDB.bat ├── scripts ├── Setup_alpha-core.ps1 └── Update_alpha-core.ps1 ├── sql └── realmlist.sql └── update └── Update.bat /README.md: -------------------------------------------------------------------------------- 1 | # alpha-core_setup 2 | 3 | Scripts to automate alpha-core setup with minimal user input. 4 | 5 | ## Prerequisites 6 | Windows 10 version 1803 (build 17063) or above. 7 | 8 | ## How to setup: 9 | 1. Run ```Setup.bat``` 10 | 2. When asked for user input just press enter. 11 | 3. Wait for server to finish loading. 12 | 4. Open realmlist.wtf in your client 13 | 5. Change it to the following: SET realmlist "127.0.0.1" 14 | 5. Start alpha client and login. 15 | 16 | ## How to start server after setup script closed: 17 | 1. Run ```Start MariaDB.bat``` 18 | 2. Run ```Start_alpha-core.bat``` 19 | 3. Once server finished loading, start alpha client and login. 20 | 21 | ## How to update: 22 | 1. Go into update folder 23 | 2. Run ```Update.bat``` 24 | 3. When asked for user input just press enter. 25 | 4. Once server finished loading, start alpha client and login. -------------------------------------------------------------------------------- /Setup.bat: -------------------------------------------------------------------------------- 1 | curl -LJO https://github.com/The-Alpha-Project/alpha-core/archive/refs/heads/master.zip 2 | tar -xf alpha-core-master.zip 3 | del /F /Q alpha-core-master.zip 4 | winget install --id=Python.Python.3.11 -e 5 | winget install --id=Microsoft.PowerShell -e 6 | winget install --id=MariaDB.Server -v "10.9.3.0" -e 7 | start pwsh -NoProfile -ExecutionPolicy Bypass -Command "& './scripts/Setup_alpha-core.ps1'" -------------------------------------------------------------------------------- /Start MariaDB.bat: -------------------------------------------------------------------------------- 1 | "C:\Program Files\MariaDB 10.9\bin\mariadbd.exe" --console -------------------------------------------------------------------------------- /Start_alpha-core.bat: -------------------------------------------------------------------------------- 1 | cd alpha-core-master 2 | py main.py -------------------------------------------------------------------------------- /Stop MariaDB.bat: -------------------------------------------------------------------------------- 1 | "C:\Program Files\MariaDB 10.9\bin\mysqladmin.exe" -u root shutdown -------------------------------------------------------------------------------- /scripts/Setup_alpha-core.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Version 7.0 2 | Set-Location alpha-core-master 3 | if ($IsWindows) { 4 | $env:py = (';' + $env:LOCALAPPDATA + '\Programs\Python\Python311' + ';' + $env:LOCALAPPDATA + '\Programs\Python\Python311\Scripts') 5 | $env:Path += ($env:py + ';' + 'C:\Program Files\MariaDB 10.9\bin') 6 | } 7 | pip3 install -r requirements.txt 8 | $username = ($v = Read-Host "Enter your database username [root]") ? $v : 'root' 9 | $password = ($v = Read-Host "Enter your database password []") ? $v : '' 10 | $port = ($v = Read-Host "Enter your database port [3306]") ? $v : '3306' 11 | $realm = ($v = Read-Host "Enter your realm database [alpha_realm]") ? $v : 'alpha_realm' 12 | $dbc = ($v = Read-Host "Enter your dbc database [alpha_dbc]") ? $v : 'alpha_dbc' 13 | $world = ($v = Read-Host "Enter your world database [alpha_world]") ? $v : 'alpha_world' 14 | Start-Process mariadbd.exe --console 15 | mariadb --user=$username --password=$password --port=$port -e "create database $realm"; 16 | mariadb --user=$username --password=$password --port=$port -e "create database $dbc"; 17 | mariadb --user=$username --password=$password --port=$port -e "create database $world"; 18 | mariadb --user=$username --password=$password --port=$port $realm -e "source etc\databases\realm\realm.sql" 19 | mariadb --user=$username --password=$password --port=$port $realm -e "source etc\databases\realm\updates\updates.sql" 20 | mariadb --user=$username --password=$password --port=$port $dbc -e "source etc\databases\dbc\dbc.sql"; 21 | mariadb --user=$username --password=$password --port=$port $dbc -e "source etc\databases\dbc\updates\updates.sql" 22 | mariadb --user=$username --password=$password --port=$port $world -e "source etc\databases\world\world.sql" 23 | mariadb --user=$username --password=$password --port=$port $world -e "source etc\databases\world\updates\updates.sql" 24 | mariadb --user=$username --password=$password --port=$port $realm -e "source ..\sql\realmlist.sql" 25 | Rename-Item -Path "etc/config/config.yml.dist" -NewName "config.yml" 26 | (Get-Content etc/config/config.yml) -Replace 'host: 0.0.0.0', 'host: 127.0.0.1' | Set-Content etc/config/config.yml 27 | (Get-Content etc/config/config.yml) -Replace "username: root", "username: $username" | Set-Content etc/config/config.yml 28 | (Get-Content etc/config/config.yml) -Replace "password: pwd", "password: ''" | Set-Content etc/config/config.yml 29 | (Get-Content etc/config/config.yml) -Replace "password: ''", "password: '$password'" | Set-Content etc/config/config.yml 30 | (Get-Content etc/config/config.yml) -Replace "realm_db: alpha_realm", "realm_db: $realm" | Set-Content etc/config/config.yml 31 | (Get-Content etc/config/config.yml) -Replace "dbc_db: alpha_dbc", "dbc_db: $dbc" | Set-Content etc/config/config.yml 32 | (Get-Content etc/config/config.yml) -Replace "world_db: alpha_world", "world_db: $world" | Set-Content etc/config/config.yml 33 | (Get-Content etc/config/config.yml) -Replace 'auto_create_gm_accounts: False', 'auto_create_gm_accounts: True' | Set-Content etc/config/config.yml 34 | py main.py 35 | -------------------------------------------------------------------------------- /scripts/Update_alpha-core.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Version 7.0 2 | Set-Location alpha-core-master 3 | if ($IsWindows) { 4 | $env:py = (';' + $env:LOCALAPPDATA + '\Programs\Python\Python311' + ';' + $env:LOCALAPPDATA + '\Programs\Python\Python311\Scripts') 5 | $env:Path += ($env:py + ';' + 'C:\Program Files\MariaDB 10.9\bin') 6 | } 7 | pip3 install -r requirements.txt 8 | $username = ($v = Read-Host "Enter your database username [root]") ? $v : 'root' 9 | $password = ($v = Read-Host "Enter your database password []") ? $v : '' 10 | $port = ($v = Read-Host "Enter your database port [3306]") ? $v : '3306' 11 | $realm = ($v = Read-Host "Enter your realm database [alpha_realm]") ? $v : 'alpha_realm' 12 | $dbc = ($v = Read-Host "Enter your dbc database [alpha_dbc]") ? $v : 'alpha_dbc' 13 | $world = ($v = Read-Host "Enter your world database [alpha_world]") ? $v : 'alpha_world' 14 | Start-Process mariadbd.exe --console 15 | mariadb --user=$username --password=$password --port=$port $realm -e "source etc\databases\realm\updates\updates.sql" 16 | mariadb --user=$username --password=$password --port=$port $dbc -e "source etc\databases\dbc\updates\updates.sql" 17 | mariadb --user=$username --password=$password --port=$port $world -e "source etc\databases\world\updates\updates.sql" 18 | mariadb --user=$username --password=$password --port=$port $realm -e "source ..\sql\realmlist.sql" 19 | Rename-Item -Path "etc/config/config.yml.dist" -NewName "config.yml" 20 | (Get-Content etc/config/config.yml) -Replace 'host: 0.0.0.0', 'host: 127.0.0.1' | Set-Content etc/config/config.yml 21 | (Get-Content etc/config/config.yml) -Replace "username: root", "username: $username" | Set-Content etc/config/config.yml 22 | (Get-Content etc/config/config.yml) -Replace "password: pwd", "password: ''" | Set-Content etc/config/config.yml 23 | (Get-Content etc/config/config.yml) -Replace "password: ''", "password: '$password'" | Set-Content etc/config/config.yml 24 | (Get-Content etc/config/config.yml) -Replace "realm_db: alpha_realm", "realm_db: $realm" | Set-Content etc/config/config.yml 25 | (Get-Content etc/config/config.yml) -Replace "dbc_db: alpha_dbc", "dbc_db: $dbc" | Set-Content etc/config/config.yml 26 | (Get-Content etc/config/config.yml) -Replace "world_db: alpha_world", "world_db: $world" | Set-Content etc/config/config.yml 27 | (Get-Content etc/config/config.yml) -Replace 'auto_create_gm_accounts: False', 'auto_create_gm_accounts: True' | Set-Content etc/config/config.yml 28 | py main.py -------------------------------------------------------------------------------- /sql/realmlist.sql: -------------------------------------------------------------------------------- 1 | UPDATE `alpha_realm`.`realmlist` SET `proxy_address`='127.0.0.1', `realm_address`='127.0.0.1' WHERE `realm_id`=1; -------------------------------------------------------------------------------- /update/Update.bat: -------------------------------------------------------------------------------- 1 | cd .. 2 | rmdir /Q /S alpha-core-master 3 | curl -LJO https://github.com/The-Alpha-Project/alpha-core/archive/refs/heads/master.zip 4 | tar -xf alpha-core-master.zip 5 | del /F /Q alpha-core-master.zip 6 | start pwsh -NoProfile -ExecutionPolicy Bypass -Command "& './scripts/Update_alpha-core.ps1'" --------------------------------------------------------------------------------