Resource Profile:
本次为大家带来的是《咸鱼之王》安卓平台的最终修复优化版本,具备完整内购支持,已全面修复此前版本中存在的各类问题,带来更为流畅的游戏体验。相较早期H5版本的在线人数限制与内购障碍,此客户端版本性能显著提升,支持大规模玩家同时在线,且道具购买功能完美运行。
Photo Gallery:
Installation and usage instructions:
搭建咸鱼之王游戏服务器需要满足以下条件:
推荐使用Linux服务器,CentOS 7.6版本系统最为稳定
腾讯云轻量应用服务器是性价比很高的选择
下载本文提供的Game Code包
宝塔面板安装与环境配置
宝塔面板是高效的服务器管理工具,安装命令如下:
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
安装完成后,通过宝塔面板安装以下必要组件:
- Web服务器:Nginx1.18
 - 数据库:MySQL 5.7
 - 缓存服务:Redis 6.27
 - NoSQL数据库:MongoDB 4.0.10
 - 编程语言:PHP 7.2
 - 数据库管理工具:phpMyAdmin 4.4
 
游戏运行约需1200MB内存,低配置服务器也可正常运行。
服务器安全设置调整
通过宝塔终端执行以下命令关闭防火墙:
systemctl stop firewalld.service
systemctl disable firewalld.service
为方便配置,建议开放1-65535所有端口:
阿里云服务器在安全组中配置规则
腾讯云服务器在防火墙中配置规则
宝塔面板安全设置中开放所有端口
游戏源码部署
将xyzw.zip源码包上传至服务器根目录并解压,执行权限设置命令:
chmod 777 -R /home
chmod 777 -R /www/wwwroot/game
运行环境配置
执行以下命令安装必要环境:
cd /home/proj
wget https://openresty.org/download/openresty-1.19.3.1.tar.gz
tar -zxvf openresty-1.19.3.1.tar.gz
mv openresty-1.19.3.1 openresty
cd openresty
sudo yum install -y pcre-devel openssl-devel
./configure
make
make install
echo "openresty环境变量"
echo "PATH=/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:$PATH
export  LC_ALL=en_US.UTF-8
export PATH" >> ~/.bash_profile
source ~/.bash_profile
源码IP地址修改
将源码中所有43.143.189.188替换为您服务器的实际IP地址,涉及文件包括:
- home/proj/common/settings.lus
 - home/proj/goserver/admin/assets/web/.env.development
 - 以及其他多个配置文件
 
数据库导入与配置
修改MySQL root密码为123456,然后执行以下命令导入游戏数据库:
mysql -uroot -p123456
create database sanguo DEFAULT CHARACTER SET utf8;
flush privileges;
use sanguo
source /home/sql/sanguo.sql
exit;
网站创建与配置
需要创建两个游戏网站:
- 第一个站点:IP:85,根目录为/home/proj/goserver/admin/assets/web/dist,PHP 7.2
 - 第二个站点:127.0.0.1:82,根目录为/www/wwwroot/game,PHP 7.2
 
游戏服务启动流程
1.启动服务端:
cd /home/proj/apiserver
nginx -p `pwd` -c conf/nginx.conf
2.首次运行生成密钥:
cd /home/proj/skynet
sh getkey.sh
3.启动各项服务:
./skynet ../loginserver/prodconfig
./skynet ../gameserver/prodconfig
cd /home/proj/goserver
nohup ./mygo &
4.检查端口状态:
netstat -lntp
5.添加游戏区服:
访问后台网站IP:85/#/login?next=%2F,默认账号admin/admin
在”游戏管理-区服配置”中添加新区,设置开服数量和结束时间
客户端修改与签名
- 使用ApkTool1.0反编译xyzw.apk
 - 修改以下文件中的IP地址:
- assets/assets/main/index.7ab56.js
 - assets/assets/resources/import/24/241bc4ec-587f-41fa-a24d-e904c5f906c6.9bd57.json
 - smali_classes4\cn\wyyidc\myapplication\LiveLiterals$MainActivityKt.smali
 
 - 回编译并签名APK
 - 在模拟器中使用MT管理器进行二次签名
 
游戏后台管理
后台地址:IP:85/#/login?next=%2F
默认账号:admin/admin
后台功能包括:
- 在线玩家监控
 - 邮件发送系统
 - CDK兑换码生成
 - 其他游戏管理功能
 
- Can free downloads or VIP member-only resources be commercialized directly?
 - The resources on this site are collected and organized through the network, for personal research and study purposes only. The copyright belongs to the legal owner of the software and program code, users should verify the copyright and legality of the resources, prohibited for commercial use, illegal activities or any violation of national laws and regulations.
 
- Disclaimer of liability for program or code bugs, compatibility issues or functional defects, etc.
 - As the resources on this site are collected and organized through the network, not the site's original, it can not fully guarantee its functionality or code compatibility. Users need to verify whether the resources meet the needs of their own, due to the following circumstances lead to losses, this site does not assume any responsibility:
Programs, source code and other computer software resources may contain code vulnerabilities (bugs), compatibility issues or functional defects left by the developer. This site does not provide free repair services for such technical defects, users need to bear the risk of debugging, modification or abandonment of the use. 

                    



