































服务器系统:centos7.6
安装宝塔直接运行命令即可。
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
搭建环境
Nginx1.18
mysql5.6
php5.4 (禁用函数exec 删除 重载配置 重启php 两个PHP版本都要操作不然后台不能用)
1、关闭防火墙、开放端口
宝塔放行端口:1:65535
systemctl stop firewalld
systemctl disable firewalld
PS:如果使用腾讯云或阿里云记得把控制台的端口也打开
2、上传xy.tar.gz到服务器根目录(根目录不是root目录!!使用WinSCP或其他工具上传数据,也可以直接宝塔传!!)
解压xy.tar.gz
cd /
tar zxvf xy.tar.gz
给予 777权限
chmod -R 7777 /usr/bin/qd
chmod -R 7777 /home
chmod -R 7777 /www/wwwroot
3、环境配置
安装java
cd /home
rpm -ivh jdk-8u144-linux-x64.rpm
tar zxvf log4cpp-1.1.3.tar.gz
cd log4cpp
./configure
make
make install
yum install -y gcc-c++ log4cpp
ln -s /usr/lib64/liblog4cpp.so.4 /usr/lib64/liblog4cpp.so.5 这条命令如果报错可不管它
4、设置数据库密码为:b65437736253ed18(在宝塔直接设置)
输入命令导入数据库
cd /home
./sk
数据库创建结束。可以通过宝塔查看是否创建成功。(数据库 – 点击 从服务器获取 获取到2个就正确的)
运行后为了安全可以把 sk 文件删除
5、搭建网站
这里每个端有所差异具体以实际配套的文字教程为准
新建两个站点
站点一
ip:88
目录/www/wwwroot/3W/
站点二
127.0.0.1:81
目录/www/wwwroot/mhxy1
6、服务端和网站修改 192.168.200.129 修改为你的IP
\home\hme1\sdk_server\sdk.config.xml 修改成自己的IP
\www\wwwroot\3w\mhxyserver\index.html 修改成自己的IP 与客户端匹配
\www\wwwroot\mhxy1\user\reg.php 修改成自己的IP
到此算服务端就可以了,下面看看客户端
7、启动游戏服务
启动
qd
1
关闭
qd
5
启动后可以通过
端口查看命令 netstat -lntp
8、客户端修改 (客户端默认地址192.168.200.129)
安卓:
AndroidManifest.xml
\lib\armeabi-v7a\libgame.so 需要ip一样位数,如果ip位数不一样,可以通过文件名来修改,多出来就减少,少就加
192.168.200.129:88/mhxyserver/index.html
43.154.102.30:88/mhxyserver/indexxx.html
IOS修改:mt3
注册地址:http://IP:81/user/reg.php
PS: 角色创建不了 邀请码里面输入你的账号 即可
简单介绍下GM后台使用
GM后台:http://ip:81/gm/gm/gm.php
GM码:syymw.com
管理后台:http://ip:81/adminu+2022
账号:admin
密码:syymw.com
友情提示:如果是阿里云或者腾讯云架设 请注意端口是否开放。