找回密码
 立即注册

微信登录

只需一步,快速开始

QQ登录

只需一步,快速开始

使用一键脚本之前一定要是用root用户登录的shh

f06e78c07cc75fde1cb3afa293f0d73c.webp

1340059f13175154799cf66a2fd8f422.webp

f77e185c1be8179c12ac8f487cb612d7.webp

55c9d6c1e9006feab6d58be545602a5c.webp

9d8a738d54808bcbb6c361c9161bb4e9.webp

78ed398e4bcb06ae9feb0902e50706aa.webp

  1. 如果非腾讯云服务器操作系统安装完后换apt源和pip源为腾讯源
  2. 服务器版本为ubuntu server 18.04
  3. 请百度使用成root用户来搭建

  4. 安装环境
  5. apt-get install expect subversion build-essential  lib32stdc++6 gcc-multilib  g++-multilib python-dev pypy-dev gdb python2.7-dbg libcurl4-openssl-dev graphviz openssl libssl-dev swig gawk iotop lsof iftop ifstat iptraf htop dstat iotop  ltrace strace sysstat bmon nethogs silversearcher-ag libsasl2-2 sasl2-bin libsasl2-modules python-setuptools luajit curl wget unzip  python-pip
  6. apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
  7. echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" | tee /etc/apt/sources.list.d/mongodb-org-3.6.list

  8. 安装宝塔:
  9. wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
  10. 输入y回车确认安装

  11. 安装环境
  12. Nginx 1.18
  13. MySQL 5.6
  14. Php 7.1

  15. 关闭防火墙
  16. sudo ufw disable

  17. 上传服务端hhw.zip到服务器/home/ubuntu文件夹

  18. 解压
  19. cd /home/ubuntu
  20. unzip hhw.zip

  21. 安装芒果数据库
  22. sudo apt-get update

  23. mv /home/ubuntu/mongodb.tar.gz /

  24. cd /
  25. tar -zxvf mongodb.tar.gz

  26. apt-get install mongodb-org=3.6.12 mongodb-org-server=3.6.12 mongodb-org-shell=3.6.12 mongodb-org-mongos=3.6.12 mongodb-org-tools=3.6.12

  27. rm -rf /usr/lib/python2.7/dist-packages/OpenSSL

  28. rm -rf /usr/lib/python2.7/dist-packages/pyOpenSSL-0.15.1.egg-info

  29. pip install cython six lz4==0.8.2 numpy==1.16.0 xlrd xdot rpdb psutil fabric==1.7.3 pycurl pycrypto M2Crypto==0.36.0 objgraph msgpack-python backports.ssl-match-hostname Markdown toro pymongo pyrasite pyopenssl ThinkingDataSdk==1.4.0

  30. pip install tornado==4.4.2

  31. pip install Supervisor==3.3.0

  32. pip install cryptography==2.6

  33. sudo mv /home/ubuntu/default /etc/nginx/sites-available
  34. sudo mv /home/ubuntu/pokemon_server_test.zip /mnt
  35. sudo mv /home/ubuntu/game.zip /www

  36. cd /mnt
  37. unzip pokemon_server_test.zip

  38. cd /www
  39. unzip game.zip

  40. 重新加载nginx
  41. nginx -s reload

  42. 给予权限
  43. chmod 755 -R /mnt
  44. chmod 777 -R /www/wwwroot

  45. 修改服务端文件IP:  搜:193.112.101.67
  46. /www/wwwroot/game/pokemon/patch/1112/res/version.plist
  47. /mnt/pokemon/release/login/conf/dev/serv.json
  48. /mnt/pokemon/release/login/conf/serv.json
  49. /mnt/pokemon/release/login/defines.json
  50. /mnt/pokemon/release/game_defines.py
  51. /mnt/pokemon/release/payment_defines.py

  52. 查看md5和获取文件size
  53. md5sum /www/wwwroot/game/pokemon/patch/1112/res/version.plist # 复制输出的md5码

  54. ls -l /www/wwwroot/game/pokemon/patch/1112/res/version.plist  # 获取文件size大小值

  55. 修改服务端文件
  56. /mnt/pokemon/release/login/patch/cn/1112.json  # 将version.plist的md5码和size更新一下并保存退出

  57. 重启nginx

  58. 启动游戏
  59. cd /mnt/pokemon/deploy_dev
  60. rm supervisor.sock
  61. supervisord -c supervisord.conf
  62. supervisorctl start all
  63. supervisorctl status

  64. 关闭游戏:
  65. supervisorctl reload

  66. 客户端修改:
  67. 安卓
  68. /assets/res/version.plist

  69. 后台地址
  70. 管理后台:http://IP:39981/login
  71. 账号:admin
  72. 密码:qq123456..
  73. 邮件发送格式:{"指令":数量}

  74. 授权GM后台:
  75. http://IP:81/gm/gm.php
  76. GM码:t9gm.com

  77. 玩家后台:
  78. http://IP:81/gm/

  79. 游戏正常启动示列
  80. root@VM-20-11-ubuntu:/mnt/pokemon/deploy_dev# supervisorctl status
  81. account_db_server                RUNNING   pid 4048, uptime 0:00:20
  82. anti_cheat_server                RUNNING   pid 4153, uptime 0:00:19
  83. crash_platform_server            RUNNING   pid 4062, uptime 0:00:20
  84. disable_word_check_server        RUNNING   pid 4051, uptime 0:00:20
  85. game_mongodb                     RUNNING   pid 4047, uptime 0:00:20
  86. game_server                      RUNNING   pid 4055, uptime 0:00:20
  87. gm_server                        RUNNING   pid 4063, uptime 0:00:20
  88. login_server                     RUNNING   pid 4064, uptime 0:00:20
  89. nsqadmin                         RUNNING   pid 4045, uptime 0:00:20
  90. nsqd                             RUNNING   pid 4044, uptime 0:00:20
  91. nsqlookupd                       RUNNING   pid 4046, uptime 0:00:20
  92. online_fight_forward_server      RUNNING   pid 4152, uptime 0:00:19
  93. payment_server                   RUNNING   pid 4054, uptime 0:00:20
  94. pvp_server                       RUNNING   pid 4052, uptime 0:00:20
  95. storage_server                   RUNNING   pid 4049, uptime 0:00:20
  96. 所有RUNNING这样才算正常。。。。。
复制代码