요구 사항#
- txAdmin이 있는 RedM 서버 (최신 artifacts)
- MariaDB 또는 MySQL 데이터베이스
- portal.cfx.re 서버 키
- OneSync 활성화
docs.fivem.net - the official step by step guide to install txAdmin and create a server.
- txAdmin을 열고 Remote URL Template을 선택합니다.
- 레시피 링크를 붙여넣습니다:
https://raw.githubusercontent.com/NQ3Z/jrscore/main/recipe/jrscore.yaml- txAdmin이 스크립트를 내려받고 DB를 만들고 server.cfg를 작성합니다.
- 서버를 시작합니다.
- INSTALL.bat을 실행합니다.
- 서버 폴더, MySQL 정보, 서버 키를 입력합니다.
- 설치 프로그램이 스크립트를 복사하고 DB를 만들고 server.cfg를 작성합니다.
- txAdmin에서 Server Data Folder를 해당 폴더로 설정하고 OneSync를 켭니다.
- resources 폴더를 서버에 복사합니다.
- sql/jrscore.sql을 빈 데이터베이스에 가져옵니다.
- server.cfg를 복사하고 {{ }} 안의 값을 수정합니다.
데이터베이스 (XAMPP, HeidiSQL 또는 XAMPP 없이)#
JRS Core는 캐릭터, 아이템, 돈을 MariaDB / MySQL 데이터베이스에 저장합니다. 실행 방법을 하나 고르고 sql/jrscore.sql을 가져온 뒤 연결 문자열을 설정하세요.
- Download and install XAMPP. It includes MariaDB.
- Open the XAMPP Control Panel and press Start next to MySQL. Apache is not needed.
- Download and install HeidiSQL, the program used to manage the database.
- In HeidiSQL press New, set Network type to MariaDB or MySQL (TCP/IP), host
127.0.0.1, userroot, port3306, and press Open. - Right click the empty left panel, Create new > Database, name it
jrscoreand use the collationutf8mb4_general_ci. - Select
jrscore, choose File > Run SQL file... and picksql/jrscore.sql.
XAMPP starts with the user root and no password. That is fine on your own PC. On a public server create a dedicated user with a password (see the SQL below) and never open port 3306 to the internet.
- Install one database server: MariaDB Server (recommended) or MySQL Community Server. Write down the root password you choose.
- Create the database and a user. Open HeidiSQL or the command line and run:
CREATE DATABASE jrscore CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'jrs'@'localhost' IDENTIFIED BY 'change_this_password';
CREATE USER 'jrs'@'127.0.0.1' IDENTIFIED BY 'change_this_password';
GRANT ALL PRIVILEGES ON jrscore.* TO 'jrs'@'localhost';
GRANT ALL PRIVILEGES ON jrscore.* TO 'jrs'@'127.0.0.1';
FLUSH PRIVILEGES;- Import the tables:
mariadb -u jrs -p jrscore < sql/jrscore.sql(with MySQL the program is called mysql). Or use HeidiSQL: File > Run SQL file....
4. Manage it with HeidiSQL or DBeaver (works on Windows, Linux and macOS).
- Install Docker, then start a MariaDB container:
docker run -d --name jrs-db --restart unless-stopped \
-e MARIADB_ROOT_PASSWORD=change_this_password \
-e MARIADB_DATABASE=jrscore \
-p 127.0.0.1:3306:3306 \
-v jrs-db:/var/lib/mysql \
mariadb:11- Import the tables (works in any shell):
docker cp sql/jrscore.sql jrs-db:/jrscore.sql
docker exec jrs-db sh -c "mariadb -uroot -pchange_this_password jrscore < /jrscore.sql"The image page: hub.docker.com/_/mariadb. The 127.0.0.1: in -p keeps the database private to the machine.
Any MariaDB or MySQL host that your game server can reach works (a managed database, or a database on another VPS).
- Create a database
jrscoreand a user for it in the provider panel. - Allow the IP address of your game server only.
- Import
sql/jrscore.sqlwith HeidiSQL connected to that host. - Use the host name in the connection string below instead of
127.0.0.1.
Then tell the server how to connect. Put this line in server.cfg above ensure oxmysql:
set mysql_connection_string "mysql://jrs:change_this_password@127.0.0.1:3306/jrscore?charset=utf8mb4"With XAMPP and the root user without password it is mysql://root@127.0.0.1:3306/jrscore?charset=utf8mb4. If the password has special characters (@, :, /, #) replace them with their percent code (@ = %40) or choose a simpler password.
To check the connection start the server and look for [oxmysql] Database server connection established in the console. Not there? Check that MySQL is running, the port is 3306 and the database name is exact.
오너로 설정#
jrs_core/config/config.lua의 Config.CoreOwners에 Steam을 추가하세요:
Config.CoreOwners = {
['steam:110000xxxxxxxxx'] = true,
}또는 jrs_users 테이블에서 group을 owner 또는 admin으로 설정하세요.
로드 순서#
ensure oxmysql
ensure jrs_core
ensure jrs_inventory
ensure jrs_character포함된 server.cfg는 이미 올바른 순서입니다.
ensure 줄 끝에 # 주석을 쓰지 말고, fxmanifest.lua는 BOM 없는 UTF-8로 저장하세요.