视频教程
游戏截图
文字教程
服务器系统:CentOS 7.6
1.安装宝塔
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
2.安装环境
Nginx1.16
MySQL5.6
PHP5.6
3.关闭防火墙
宝塔放行端口:1:65535
systemctl stop firewalld.service
systemctl disable firewalld.service
4.上传xmqy.tar.gz到服务器根目录/解压
cd /
tar zxvf xmqy.tar.gz
给权限
chmod -R 777 /home/
5.安装gcc动态库(SSH输入命令 一点要把游戏的动态库上传了在执行gcc)
yum install gcc -y
yum install gcc-c++ -y
yum install glibc* -y
ldconfig
6.创建网站
域名或IP:9981
目录\www\wwwroot\xmqy
网站-设置-伪静态
添加
location /api/ {
rewrite /(.*)getserverand003/$ /api/getserverand003.php;
rewrite /(.*)verify/$ /api/verify.php;
}
7.在宝塔修改Mysql设置
在宝塔-软件商店-MySQL 5.6-设置-配置修改中第26行添加lower_case_table_names=1 然后服务–重启MYSQL
修改数据库root密码为123456
创建并导入数据库(这个要等宝塔安装完mysql才可以操作)
mysql -uroot -p123456
GRANT ALL PRIVILEGES ON . TO ‘root’@’127.0.0.1’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON . TO ‘root’@’localhost’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit
命令行输入导入数据库
cd /home
./sk
手动导入cross.sql
8.服务端修改IP(替换192.168.1.1为你的ip)
/home/xmqy/cross/debug/commonconfig.xml
/home/xmqy/cross/debug/serverconfig.xml
/home/xmqy/s1/debug/commonconfig.xml
/home/xmqy/s1/debug/serverconfig.xml
/home/xmqy/s2/debug/commonconfig.xml
/home/xmqy/s2/debug/serverconfig.xml
9.网站修改IP(替换192.168.01.001为你的ip或域名)
/www/wwwroot/xmqy/api/getserverand003.php
/www/wwwroot/xmqy/gm/user/config.php
下面文件需要注意位数 ip需要14位,个别15位 ip位数不够补0或用域名
安卓192.168.01.001
/www/wwwroot/xmqy/ugxm_dev/Android/AssetBundle/LuaAssetBundle/luajit/agent
/www/wwwroot/xmqy/ugxm_dev/Android/AssetBundle/LuaAssetBundle/luajit/init
苹果192.168.01.001
/www/wwwroot/xmqy/ugxm_dev/IOS/AssetBundle/LuaAssetBundle/luajit/init(这个文件修改192.168.001.001 位数15位)
/www/wwwroot/xmqy/ugxm_dev/IOS/AssetBundle/LuaAssetBundle/luajit/agent
10游戏启动
cd /home/xmqy/cross/debug/
./start.sh
cd /home/xmqy/s1/debug/
./start.sh
cd /home/xmqy/s2/debug/
./start.sh
关闭游戏
cd /home/xmqy/cross/debug/
./stop.sh
cd /home/xmqy/s1/debug/
./stop.sh
cd /home/xmqy/s2/debug/
./stop.sh
ip需要14位, ip位数不够补0或用域名
安卓客户端修改ip:192.168.001.01为你的ip或域名 需要14位
\assets\AssetBundle\LuaAssetBundle\luajit\agent-a68dcd5d9e7bbf3ec0d5cddb447e1d62
\assets\AssetBundle\LuaAssetBundle\luajit\init-7dd731f043e936ebdced7cf6fca7d0d3
192.168.001.01
43.154.063.029
苹果客户端修改ip:192.168.001.01 需要14位的ip或域名
\Payload\g16.app\Data\Raw\AssetBundle\LuaAssetBundle\lua\agent-b025dbd1cc67c7d11690d11994861da7
\Payload\g16.app\Data\Raw\AssetBundle\LuaAssetBundle\lua\init-f5f6eabcb1c1d491a59b87a7f5fccd1b
运营后台地址:http://IP:9981/admin/admintool/ 默认账号密码都是admin
管理授权后台地址:http://IP:9981/gm/gm.php GM码:syymw.com
玩家后台地址:http://ip:9981/gm/