Compare commits

...

5 Commits

10 changed files with 212 additions and 166 deletions

50
.env.example Normal file
View File

@ -0,0 +1,50 @@
################################################################################
# MySQL settings
################################################################################
MYSQL_HOST=mysql
MYSQL_USER=root
MYSQL_PASSWORD=metin2
MYSQL_PORT=3306
MYSQL_EXTERNAL_PORT=3306
MYSQL_DB_ACCOUNT=account
MYSQL_DB_PLAYER=player
MYSQL_DB_COMMON=common
MYSQL_DB_LOG=log
################################################################################
# Web app settings
################################################################################
# General configuration
WEB_IMAGE=git.old-metin2.com/metin2/website:nightly
WEB_APP_NAME=Metin2
WEB_APP_ENV=production
WEB_APP_URL=http://metin2.local
WEB_APP_KEY=
WEB_EXTERNAL_PORT=80
# E-mail configuration
WEB_MAIL_MAILER=smtp
WEB_MAIL_HOST=smtp.example.com
WEB_MAIL_PORT=587
WEB_MAIL_USERNAME=smtp-username
WEB_MAIL_PASSWORD=smtp-password
WEB_MAIL_ENCRYPTION=tls
WEB_MAIL_FROM_ADDRESS=no-reply@example.com
WEB_MAIL_FROM_NAME=Metin2
################################################################################
# Game server settings
################################################################################
# Global settings
TEST_SERVER=0
# DBCache settings
DB_ADDR=db
DB_PORT=15000
# Game settings
PUBLIC_IP=127.0.0.1
GAME_IMAGE=git.old-metin2.com/metin2/server:nightly
GAME_MAX_LEVEL=105

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
# Working copy of .env file
.env
# Storage directory # Storage directory
storage/ storage/

View File

@ -0,0 +1,5 @@
CREATE DATABASE account CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE common CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE log CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE player CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE website CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@ -1,18 +0,0 @@
CHANNEL: 1
HOSTNAME: auth
PUBLIC_IP: 127.0.0.1
PORT: 11000
P2P_PORT: 12000
DB_ADDR: db
DB_PORT: 15000
PLAYER_SQL: mysql root metin2 account
COMMON_SQL: mysql root metin2 common
LOG_SQL: mysql root metin2 log
TABLE_POSTFIX:
PASSES_PER_SEC: 25
PING_EVENT_SECOND_CYCLE: 180
ADMINPAGE_PASSWORD: metin2adminpass
ADMINPAGE_IP: 127.0.0.1
AUTH_SERVER: master
TRAFFIC_PROFILE:
TEST_SERVER: 0

View File

@ -1,27 +0,0 @@
CHANNEL: 1
HOSTNAME: ch1_first
PUBLIC_IP: 127.0.0.1
PORT: 13000
P2P_PORT: 14000
DB_ADDR: db
DB_PORT: 15000
MAP_ALLOW: 1 4 5 6 3 23 43 112 107 67 68 72 208 302 304
PLAYER_SQL: mysql root metin2 player
COMMON_SQL: mysql root metin2 common
LOG_SQL: mysql root metin2 log
TABLE_POSTFIX:
PASSES_PER_SEC: 25
SAVE_EVENT_SECOND_CYCLE: 180
PING_EVENT_SECOND_CYCLE: 180
VIEW_RANGE: 8000
CHECK_MULTIHACK: 0
ADMINPAGE_PASSWORD: metin2adminpass
ADMINPAGE_IP: 127.0.0.1
SPEEDHACK_LIMIT_COUNT: 300
SPEEDHACK_LIMIT_BONUS: 80
PK_PROTECT_LEVEL: 15
MALL_URL: google.com
TRAFFIC_PROFILE:
TEST_SERVER: 0
MAX_LEVEL: 105
MARK_SERVER: 1

View File

@ -1,26 +0,0 @@
CHANNEL: 1
HOSTNAME: ch1_game1
PUBLIC_IP: 127.0.0.1
PORT: 13001
P2P_PORT: 14001
DB_ADDR: db
DB_PORT: 15000
MAP_ALLOW: 21 24 25 26 108 61 63 69 70 73 216 217 303
PLAYER_SQL: mysql root metin2 player
COMMON_SQL: mysql root metin2 common
LOG_SQL: mysql root metin2 log
TABLE_POSTFIX:
PASSES_PER_SEC: 25
SAVE_EVENT_SECOND_CYCLE: 180
PING_EVENT_SECOND_CYCLE: 180
VIEW_RANGE: 8000
CHECK_MULTIHACK: 0
ADMINPAGE_PASSWORD: metin2adminpass
ADMINPAGE_IP: 127.0.0.1
SPEEDHACK_LIMIT_COUNT: 300
SPEEDHACK_LIMIT_BONUS: 80
PK_PROTECT_LEVEL: 15
MALL_URL: google.com
TRAFFIC_PROFILE:
TEST_SERVER: 0
MAX_LEVEL: 105

View File

@ -1,26 +0,0 @@
CHANNEL: 1
HOSTNAME: ch1_game2
PUBLIC_IP: 127.0.0.1
PORT: 13002
P2P_PORT: 14002
DB_ADDR: db
DB_PORT: 15000
MAP_ALLOW: 41 44 45 46 109 62 64 65 66 71 104 301 351
PLAYER_SQL: mysql root metin2 player
COMMON_SQL: mysql root metin2 common
LOG_SQL: mysql root metin2 log
TABLE_POSTFIX:
PASSES_PER_SEC: 25
SAVE_EVENT_SECOND_CYCLE: 180
PING_EVENT_SECOND_CYCLE: 180
VIEW_RANGE: 8000
CHECK_MULTIHACK: 0
ADMINPAGE_PASSWORD: metin2adminpass
ADMINPAGE_IP: 127.0.0.1
SPEEDHACK_LIMIT_COUNT: 300
SPEEDHACK_LIMIT_BONUS: 80
PK_PROTECT_LEVEL: 15
MALL_URL: google.com
TRAFFIC_PROFILE:
TEST_SERVER: 0
MAX_LEVEL: 105

View File

@ -1,19 +0,0 @@
WELCOME_MSG = "DB Server has been started"
SQL_ACCOUNT = "mysql account root metin2 0"
SQL_PLAYER = "mysql player root metin2 0"
SQL_COMMON = "mysql common root metin2 0"
SQL_HOTBACKUP = "mysql hotbackup root metin2 0"
TABLE_POSTFIX = ""
BIND_PORT = 15000
DB_SLEEP_MSEC = 10
CLIENT_HEART_FPS = 10
HASH_PLAYER_LIFE_SEC = 600
BACKUP_LIMIT_SEC = 3600
PLAYER_ID_START = 100
PLAYER_DELETE_LEVEL_LIMIT = 70
ITEM_ID_RANGE = 10000001 20000000
TEST_SERVER = 0

View File

@ -1,26 +0,0 @@
CHANNEL: 99
HOSTNAME: game99
PUBLIC_IP: 127.0.0.1
PORT: 13099
P2P_PORT: 14099
DB_ADDR: db
DB_PORT: 15000
MAP_ALLOW: 113 81 100 101 103 105 110 111 114 118 119 120 121 122 123 124 125 126 127 128 181 182 183 200
PLAYER_SQL: mysql root metin2 player
COMMON_SQL: mysql root metin2 common
LOG_SQL: mysql root metin2 log
TABLE_POSTFIX:
PASSES_PER_SEC: 25
SAVE_EVENT_SECOND_CYCLE: 180
PING_EVENT_SECOND_CYCLE: 180
VIEW_RANGE: 8000
CHECK_MULTIHACK: 0
ADMINPAGE_PASSWORD: metin2adminpass
ADMINPAGE_IP: 127.0.0.1
SPEEDHACK_LIMIT_COUNT: 300
SPEEDHACK_LIMIT_BONUS: 80
PK_PROTECT_LEVEL: 15
MALL_URL: google.com
TRAFFIC_PROFILE:
TEST_SERVER: 0
MAX_LEVEL: 105

View File

@ -1,34 +1,112 @@
version: '3.3' x-environment:
&common-environment
MYSQL_HOST: ${MYSQL_HOST}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_PORT: ${MYSQL_PORT}
MYSQL_DB_ACCOUNT: ${MYSQL_DB_ACCOUNT}
MYSQL_DB_PLAYER: ${MYSQL_DB_PLAYER}
MYSQL_DB_COMMON: ${MYSQL_DB_COMMON}
MYSQL_DB_LOG: ${MYSQL_DB_LOG}
TEST_SERVER: ${TEST_SERVER}
DB_ADDR: ${DB_ADDR}
DB_PORT: ${DB_PORT}
PUBLIC_IP: ${PUBLIC_IP}
GAME_MAX_LEVEL: ${GAME_MAX_LEVEL}
WEB_APP_URL: ${WEB_APP_URL}
WEB_APP_KEY: ${WEB_APP_KEY}
services: services:
# MySQL Database # MySQL Database
mysql: mysql:
image: mysql:5.5 image: mysql:5.5
restart: always restart: on-failure
environment: environment:
# Password for root access # Password for root access
MYSQL_ROOT_PASSWORD: 'metin2' MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
ports: ports:
- '3306:3306' - '${MYSQL_EXTERNAL_PORT}:${MYSQL_PORT}'
expose: expose:
- 3306 - ${MYSQL_PORT}
volumes: volumes:
- ./storage/database/:/var/lib/mysql/ - ./storage/database/:/var/lib/mysql/
- ./assets/db-init/:/docker-entrypoint-initdb.d/:ro
healthcheck:
test: mysqladmin ping -h localhost -u root -p$$MYSQL_ROOT_PASSWORD
interval: 10s
timeout: 5s
retries: 5
# Web management system
web:
image: ${WEB_IMAGE}
restart: on-failure
environment:
# Application config
APP_NAME: ${WEB_APP_NAME}
APP_ENV: ${WEB_APP_ENV}
APP_KEY: ${WEB_APP_KEY}
APP_URL: ${WEB_APP_URL}
# Database credentials
DB_HOST: ${MYSQL_HOST}
DB_PORT: ${MYSQL_PORT}
DB_USERNAME: ${MYSQL_USER}
DB_PASSWORD: ${MYSQL_PASSWORD}
# E-mail config
MAIL_MAILER: ${WEB_MAIL_MAILER}
MAIL_HOST: ${WEB_MAIL_HOST}
MAIL_PORT: ${WEB_MAIL_PORT}
MAIL_USERNAME: ${WEB_MAIL_USERNAME}
MAIL_PASSWORD: ${WEB_MAIL_PASSWORD}
MAIL_ENCRYPTION: ${WEB_MAIL_ENCRYPTION}
MAIL_FROM_ADDRESS: ${WEB_MAIL_FROM_ADDRESS}
MAIL_FROM_NAME: ${WEB_MAIL_FROM_NAME}
ports:
- '${WEB_EXTERNAL_PORT}:80'
volumes:
- ./storage/web/:/app/storage/
depends_on:
mysql:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:80/ || exit 1
interval: 10s
timeout: 5s
retries: 5
# DBCache Server # DBCache Server
db: db:
image: metin2/server:test image: ${GAME_IMAGE}
restart: always restart: on-failure
environment: *common-environment
expose: expose:
- 15000 - ${DB_PORT}
command: db command: db
volumes: volumes:
- ./config/db.txt:/app/conf.txt
- ./storage/log/db/:/app/log/ - ./storage/log/db/:/app/log/
depends_on:
mysql:
condition: service_healthy
web:
condition: service_healthy
# Auth server # Auth server
auth: auth:
image: metin2/server:test image: ${GAME_IMAGE}
restart: always restart: on-failure
environment:
<<: *common-environment
MYSQL_DB_PLAYER: ${MYSQL_DB_ACCOUNT}
GAME_HOSTNAME: auth
GAME_CHANNEL: 1
GAME_AUTH_SERVER: master
GAME_PORT: 11000
GAME_P2P_PORT: 12000
expose: expose:
- 11000 - 11000
- 12000 - 12000
@ -36,13 +114,25 @@ services:
- '11000:11000' - '11000:11000'
command: game command: game
volumes: volumes:
- ./config/auth.txt:/app/CONFIG
- ./storage/log/auth/:/app/log/ - ./storage/log/auth/:/app/log/
depends_on:
mysql:
condition: service_healthy
web:
condition: service_healthy
# Game server (CH1) # Game server (CH1)
ch1_first: ch1_first:
image: metin2/server:test image: ${GAME_IMAGE}
restart: always restart: on-failure
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_first
GAME_CHANNEL: 1
GAME_MARK_SERVER: 1
GAME_PORT: 13000
GAME_P2P_PORT: 14000
GAME_MAP_ALLOW: 1 4 5 6 3 23 43 112 107 67 68 72 208 302 304
expose: expose:
- 13000 - 13000
- 14000 - 14000
@ -50,13 +140,25 @@ services:
- '13000:13000' - '13000:13000'
command: game command: game
volumes: volumes:
- ./config/ch1/first.txt:/app/CONFIG
- ./storage/log/ch1/first/:/app/log/ - ./storage/log/ch1/first/:/app/log/
- ./storage/mark/:/app/mark/ - ./storage/mark/:/app/mark/
depends_on:
mysql:
condition: service_healthy
web:
condition: service_healthy
ch1_game1: ch1_game1:
image: metin2/server:test image: ${GAME_IMAGE}
restart: always restart: on-failure
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_game1
GAME_CHANNEL: 1
GAME_MARK_SERVER: 0
GAME_PORT: 13001
GAME_P2P_PORT: 14001
GAME_MAP_ALLOW: 21 24 25 26 108 61 63 69 70 73 216 217 303
expose: expose:
- 13001 - 13001
- 14001 - 14001
@ -64,12 +166,24 @@ services:
- '13001:13001' - '13001:13001'
command: game command: game
volumes: volumes:
- ./config/ch1/game1.txt:/app/CONFIG
- ./storage/log/ch1/game1/:/app/log/ - ./storage/log/ch1/game1/:/app/log/
depends_on:
mysql:
condition: service_healthy
web:
condition: service_healthy
ch1_game2: ch1_game2:
image: metin2/server:test image: ${GAME_IMAGE}
restart: always restart: on-failure
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_game2
GAME_CHANNEL: 1
GAME_MARK_SERVER: 0
GAME_PORT: 13002
GAME_P2P_PORT: 14002
GAME_MAP_ALLOW: 41 44 45 46 109 62 64 65 66 71 104 301 351
expose: expose:
- 13002 - 13002
- 14002 - 14002
@ -77,13 +191,25 @@ services:
- '13002:13002' - '13002:13002'
command: game command: game
volumes: volumes:
- ./config/ch1/game2.txt:/app/CONFIG
- ./storage/log/ch1/game2/:/app/log/ - ./storage/log/ch1/game2/:/app/log/
depends_on:
mysql:
condition: service_healthy
web:
condition: service_healthy
# Game server (game99) # Game server (game99)
game99: game99:
image: metin2/server:test image: ${GAME_IMAGE}
restart: always restart: on-failure
environment:
<<: *common-environment
GAME_HOSTNAME: game99
GAME_CHANNEL: 99
GAME_MARK_SERVER: 0
GAME_PORT: 13099
GAME_P2P_PORT: 14099
GAME_MAP_ALLOW: 113 81 100 101 103 105 110 111 114 118 119 120 121 122 123 124 125 126 127 128 181 182 183 200
expose: expose:
- 13099 - 13099
- 14099 - 14099
@ -91,5 +217,9 @@ services:
- '13099:13099' - '13099:13099'
command: game command: game
volumes: volumes:
- ./config/game99.txt:/app/CONFIG
- ./storage/log/game99/:/app/log/ - ./storage/log/game99/:/app/log/
depends_on:
mysql:
condition: service_healthy
web:
condition: service_healthy