






















这里我们以 CENTOS 7.6 x64为例
教程演示虚拟机地址:123.207.42.5 外网和局域网搭建方式雷同
安装宝塔直接运行命令即可。
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec
输入y回车确认安装
输入n取消安装SSL
搭建环境:
Nginx1.18
mysql5.6 这里是5.6的版本
php 5.6
下面开始搭建
1、关闭防火墙、开放端口{使用putty或其他工具登陆服务器}
centos7系统
systemctl stop firewalld.service
systemctl disable firewalld.service
宝塔放行端口:1:65535
为了安全考虑你也可以不关闭防火墙直接单独放行:81、20021、20013
2、上传cs.tar.gz到服务器根目录/(根目录不是root目录!!!!){使用WinSCP或其他工具上传数据}
上传好后,解压cs.tar.gz
cd /
tar zxvf cs.tar.gz
给予data 777权限
chmod 777 -R /data
chmod 777 -R /www/wwwroot/game
3、设置数据库密码为:syymw.com(在宝塔直接设置)
创建数据库并导入数据.(命令行工具)
cd /data
./sk
数据库 – 从服务器获取(获取到2个就可以了)
4、网站架设
宝塔直接创建网站有端口加端口,加端口对应客户端里面记得有一处也要加
这里端口 88
路径/www/wwwroot/game/
5、IP修改
修改以下根目录路径文件中123.207.42.5为你自己外网ip
服务端:
data/sbin/resource/config/gateway_cfg.lua 一共4处
data/sbin/resource/config/session_cfg.lua 一共4处
到此服务端基本搭建完毕,下面看看客户端。
6、启动游戏服务
启动命令
cd /data/
./q
一共5个进程都显示 success 表示成功了
传世有一些端WorldFrame_d有点奇怪有时候显示了success
登陆还是提示“服务器维护”
如果遇到这样情况参考下面 温馨提示 部分处理
可以通过 命令ps -ef |grep WorldFrame_d查看WorldFrame_d是否运行
出现这样就表示正常运行了
[root@localhost data]# ps -ef |grep WorldFrame_d
root 3556 1 83 14:11 pts/0 00:00:18 ./WorldFrame_d -c 0000020
root 3637 3260 0 14:11 pts/0 00:00:00 grep –color=auto WorldFrame_d
如果只有
root 3572 3156 0 11:32 pts/0 00:00:00 grep –color=auto WorldFrame_d
就需要参考温馨提示部分单独启动这个进程了。
我这里是全部都启动成功了我们进游戏试试。
可以看这里现在是 启动失败了的。登陆服务器会提示“服务器维护中。”
如果上面启动一直失败(service failure )就手动启动
cd /data/sbin/linux
bash db_service.sh start 0801
bash session_service.sh start 0801
bash gamegate_service.sh start 0801 1
bash world_service.sh start 0801
bash nameserver_service.sh start 2
停止命令
cd /data/
./t1
#先运行上面的,等待1分钟左右在运行下面整个关闭
cd /data/
./t
手动停止
chmod 777 -R /data
cd /data/
./qw
killall DBAServer_d
killall SessionServer_d
killall GameGateway_d
killall WorldFrame_d
killall NameServer_d
success表示启动成功.
6、客户端修改
安卓
\assets\kuniu\defServerList.json
\assets\kuniu\netconfig.luac4
修改123.207.42.5为你自己的
修改后 就直接签名
可以进入游戏。
好了,本期教程到此结束,其他自行研究
祝君好运。。。
PS:
下面简单看看后台
GM工具:http://IP:88/gm/gm.php
GM码:syymw.com
发送后小退在登陆就有邮件了。