I just add some extra steps in the previous guide. This is for 20gb version, not sure if it works for big one. I just start learning c++ recently, so maybe some steps are not ideal, and some steps may miss as well, just let me know. I will try to help.
## 2. Install compilation tools
-cmake(>3.0.2)
-g++ (I'm using 9.2)
-redis (I'm using 6.2.7)
-mysql (I have mysql installed previously, so if below step is not correct, just google it)
## 3. Connect resources
- copy config, rogamelibs, roserver to your server root
- cd roserver
- open 111.sh, change icc_path to your g++ path, in my case, it is /usr/local/bin
- go to "/roserver/exe/gsconf", delete all folders except "script" and "serveronly", by doing this, we can link those folders from config folder with next step
- run ./111.sh ../config
## 4. Install and compile dependent software
- Install mysql-devel, mysql version
```sh
yum install mysql-devel
yum install mysql-community-server.x86_64
```
## 5. Compile server
if you see "make -jx" especially "make -j128" in below sh files, just change it to "make -j<nb of your cpu core>"
- build librogamelibs.a
open /rogamelibs/buildtool/build_linux.sh
change icc_path
change cmake command to below
"cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/LINUX.cmake -DCMAKE_BUILD_TYPE=Debug -DGCC=9.2.0 -DGCOV=Off -DASAN=Off -DLSAN=Off -DCMAKE_C_COMPILER=$icc_path/gcc -DCMAKE_CXX_COMPILER=$icc_path/g++ ../.."
then run build_linux.sh
- build libconfiglib.a
open /rogamelibs/table/buildtool/build_linux.sh
change icc_path
change cmake command to below
"cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/LINUX.cmake -DCMAKE_C_COMPILER=$icc_path/gcc -DCMAKE_CXX_COMPILER=$icc_path/g++ ../.."
then run build_linux.sh
- go to /roserver/lib, check both librogamelibs.a and libconfiglib.a link to correct files
- cd /roserver/Build/Debug
- run "make" to build all servers, or you can go to each server folder, then build it one by one
- Comment out the files that are not found in the code (Be patient, it is not too many)
## 6. Configure mysql
- Start mysql
- Run the .sql files under /roserver/exe/sql/create_sql and update_sql
- Add a piece of server information to the gateinfo table under database login
(Example server_id channel state is_open server_name zone_name ipaddr free_ipaddr register_account online_role open_time full_register_time combine_serverid
1 1 1 1 mzx sywc
your_server_ip:10110 0 0 2024-04-15 08:00:00 2024-04-15 08:00:00 0)
- **Possible problems:**
- (1) mysql cannot be started
The error message is that there is already a file in a certain folder. Modify the path pointed to by data in /etc/my.cnf.
- (2) mysql query and modify the initial password query and modify
```sh
grep "temporary password" /var/log/mysqld.log
mysqladmin -u root -p oldpasswd password newpasswd
```
- (3) Timestamp default value invalid when running .sql
The most direct way to modify sql_mode
```sh
set sql_mode='';
```
## 7. Configure redis
- configure your redis in /roserver/exe/gsconf/serveronly/game_redis_conf.json
## 8. Generate and modify the server configuration file
- copy my conf.zip file, then unzip to /roserver/Build/Debug/bin
- Modify the xml files of each server in roserver/Build/Debug/bin/conf. Fill in the mysql account password database information.
If you want to start multiple gameservers, copy gs_conf.xml and modify the line information in it.
- copy my run_server_command.zip, then replace start,status and stop with my ones
## 9. Open port for 25009 (default 25001 client port not work for me, no idea why) and 10110 (gate),
## 10. Install screen
## 11. Start the server
```sh
cd ./Build/Debug/bin
./start [any name]
```
screen related commands
```sh
screen -ls //View started servers
screen -r [server name] //Switch to each server window to ensure there are no errors
First ctrl+A and then D to exit the screen
```
2024-04-18 Update:
1. change 3 version numbers in "/roserver/exe/loginconf/version.txt" to "0.2.0.1" (this is client version number)
2. Missing files like below. You can copy from big zip ("Ro\rogamelibs\include\aidebug" and "Ro\rogamelibs\aidebug") or use my attachment. Comment out "shared_data.SerializeToPb" errors
View attachment 259831
3. in /roserver/thirdparty, compile and install liboauth-0.9.4 and libevhtp-1.2.10
4. update step 3
View attachment 259784