preface

Want to experience xianxia kind of game chivalrous tenderness? Want to experience the nobility of full VIP? Want to experience the invincible loneliness of a big man? All kinds of super cool fashion, mounts, wings, pets for you, in the world of langjian!

This article explains the wave sword world set up tutorial, want to study how to achieve H5 game, experience the game in seconds day seconds to seconds of air must not miss.

I set up the wave sword world H5 link: http://39.105.134.68:82/game.html, mobile phones and computers can perfect operation, pay attention to my WeChat echeverra send wave “sword”, public access to the game source code, send “sea world GM” sword, obtaining background GM, come and experience it.

Because the server network speed may have a point card, loading into the game after a period of time will be normal, if the first monster into the game can not be killed, please contact me to restart the game service can be restored.

If you are interested in H5 games, I recommend several other H5 games I set up: H5 games summary, welcome to play ~

Wave Sword World game screenshot:

Mobile client:

PC:

The erection

1. Set up conditions

Wave sword world erection needs to prepare:

  1. For Linux servers, CentOs 7.6 is recommended. Lightweight application servers with high cost performance are recommended.
  2. Game source code, pay attention to my public number Echeverra, send “wave sword world” to obtain.

Note The game port cannot be enabled on server CentOs 8 or later.

The game source code has been fixed and optimized as follows:

  • [Fixed] Packages cannot be broken up when they are almost full
  • [Fixed] returning to login every time (this doesn’t affect the game, but I really can’t stand it)
  • [Fixed] Game stalling error
  • Optimize GM tools, etc.

2. Install the pagoda and the environment

Pagoda is a server operation and maintenance management software, installation commands:

Yum install wget - y && wget - O the sh http://download.bt.cn/install/install_6.0.sh && sh the shCopy the code

After the installation, log in to the pagoda as prompted (if you cannot access the pagoda because port 8888 is not open on the server, refer to the steps to open the port), and search for the following software installation in the Pagoda software store:

  1. Web server: Apache2.4
  2. Database: mysql 5.6
  3. Programming language: PHP 5.6
  4. Database management tool: phpMyAdmin 4.4

Note Do not use Nginx; otherwise, the port cannot be started successfully.

Once installed, you need to install the three PHP extensions redis/memcached/yaf.

Set the Redis password field requirepass to PWd123456 and restart the Redis service by going to the Redis Store ->Redis-> Performance Adjustment.

3. Disable the firewall

From the pagoda menu terminal, execute the command to close the firewall:

systemctl stop firewalld.service
systemctl disable firewalld.service
Copy the code

4. Open ports

We directly open all ports 1-65535, Ali cloud server in the security group configuration rules.

The Tencent cloud server configures rules in the firewall.

Then open all ports in Pagoda menu Security.

If you have security requirements, you can open the ports to be opened separately, using the same method as above.

5. Upload the source code

Once you have the source code, upload the ljtx.zip zip file to the root directory through the pagoda (if uploading to the root directory is prohibited by the pagoda, you can upload it to another path and cut and paste it into the root directory).

Decompress the file to the root directory.

After decompression, through the pagoda menu terminal, command to grant 777 permission:

chmod -R 777 /ljserver
chmod -R 777 /usr/local/java
chmod -R 777 /root/sql
chmod 777 /root/sk
Copy the code

6. Install Java

To decompress the Java archive, run the following command:

cd /usr/local/java
tar -zxv -f jdk-8u191-linux-x64.tar.gz
Copy the code

To configure environment variables, add the following to the end of /etc/profile:

JAVA_HOME = / usr/local/Java/jdk1.8.0 _191 PATH = $JAVA_HOME/bin: $PATH CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar export PATH JAVA_HOME CLASSPATHCopy the code

Command to refresh global variables to obtain Java version information:

source /etc/profile
java -version
Copy the code

If the Java version information is displayed, the configuration is successful.

7. Change the source IP address

The IP in the source code is my own VIRTUAL machine IP (39.105.134.68) and needs to be replaced with your own server IP.

Files whose IP addresses need to be changed:

  1. /ljserver/wwwroot/public/game.html
  2. /ljserver/wwwroot/public/api/loginserver.php
  3. /root/sql/idplatdatabase.sql

Take the game. HTML file as an example. Find the file in the pagoda, double-click to modify it, and Ctrl+F to replace the IP in batches.

8. Import the database

Pagoda Set the password of database root to pwd123456.

Open database remote permission:

Mysql -u root -ppwd123456 GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY 'PWd123456' WITH GRANT OPTION;  FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'pwd123456' WITH GRANT OPTION; FLUSH PRIVILEGES; quitCopy the code

Command to create database:

cd /root
sh sk
Copy the code

9. Create a game website

To access the game, add the website domain name to your IP:82, root directory /ljserver/wwwroot/public, and select PHP version 5.6.

Set up the site again and deselect anti-xSS attacks.

10. Start the game

With that done, it’s time to start the exciting game. Start the command:

cd /ljserver
sh start.sh
Copy the code

Wait 120 seconds for the port to start completely.

Check the listening interface, generally 7000 and 7001 ports start listening is no problem, if the game fails to set up, please check whether there are ports not started listening.

netstat -lntp
Copy the code

Visit the game link: http://IP:82/game.html, using your server’s IP.

Click visitor login, input account password, register/log in, start the game, select the role, enter the game, Nice~

11. The GM tool

Game GM tool access link: http://IP:82/gm1/s1.php, using your server IP, you can recharge to send items to players, specific items need to find the item code, according to the specified format to send, no need to re-log in the game, mail real-time collection.

12. Turn off the game

Close game execution command:

cd /ljserver
sh stop.sh
Copy the code

subsequent

1. Modify the game announcement

The game notice needs to read the idplatdatabase table channel_notice, in phpMyAdmin can directly modify the game notice.

2. About the xianxia game

In fact, I have been looking for a fairy H5 game, the quality of the picture is relatively high requirements, although the previous build has been legend and westward travel games, but I still have a special preference for the fairy games. I have experienced the stars change, xiuxian Fu Demon record, xiuzhen and other similar games, because of some intolerable BUG to give up, of course, this wave sword world also have a BUG, but fortunately I have solved the Nice

This wave sword world gives me the first impression that the picture is very beautiful, the background music has a sense of empathy, giving a feeling of chivalrity tenderness. The game is not complicated, it takes only two or three days to build up the strength. And the game’s background services are written in Java, the code is very valuable research, two open is also very good. Immortal class H5 is finally selected, perfect ~

Ok, the above is all the H5 building course of Langjian World, I hope it will help you, if you have any questions, please contact me through my blog echeverra.cn or wechat official account echeverra.

Did you learn to “waste”?

(after)


The article first appeared in my blog echeverra.cn/ljtx, original article, reproduced please indicate the source.

Welcome to follow my wechat official account Echeverra to learn and make progress together! Uncertain when there are resources and welfare oh!