The source code is for testing only and should not be used commercially. The source code comes from the Internet. If there is any infringement, please contact me to remove it.
七星棋牌地方定制源码服务搭建教程

 preface

This site has compiled source code.Seven Star Card Local Card Shaoyang Card Repair Edition

I believe many people have obtained the source code. The source code construction requires a certain programming foundation.

This article briefly talks about the local environment construction process of Seven Star source code. The local environment built can be used for debugging during the second opening to find errors and exceptions faster.

1. Tools

Since the source code is developed by js, we use the webstorm development tool.

2. Environmental preparation

1. node js environment installation

Install node js environment locally,Download the Node.js version for your system: Download | Node.js

After the installation is complete, check whether the installation was successful.

PS D:\Project\backstate> node -v
v12.12.0
PS D:\Project\backstate> npm -v
6.11.3

Install pomelo

npm install -g pomelo
PS D:\Project\backstate> pomelo -V
2.2.7

After installation, we import the code

edit

This is my directory. Everyone chooses your own background directory to import it. My directory contains all the background, including some test code, management background, scheduled tasks, and all kinds of miscellaneous things.

2. Add startup item

Add node js startup entry. As shown in the picture:

edit

Click on this configuration. I have already configured this one.

edit

edit As shown in the figure above, first click the + sign to create a new Node.js.

Select the server-side project directory. The server-side project directory here is game-server, and the pomelo project has this name by default.

Select app.js in the home directory to start js. Add a startup parameter, which is used in the code. Linux systems use environment variables. We need to add them ourselves for debugging here. The environment to start based on this parameter is different.

3. code configuration item

First of all, the database needs to be installed, mysql. I won't say much here. You can install one on your Cloud Virtual Machine or install one locally. Import sql data from the source code. This is not much.

Code database configuration. (The config directory here is the configuration directory of each env. We started the Shaoyang for parameter configuration before, so the files in the Shaoyang directory will be loaded here)

edit

Configure mysql.js as shown

module.exports = {
    connectionLimit: 10,
    host: '127.0.0.1',
    port: 3306,
    user: 'root',
    password: 'root',
    database: 'field',
    charset: 'utf8mb4',
    master: {
        connectionLimit: 10,
        host: '127.0.0.1',
        port: 3306,
        user: 'root',
        password: 'root',
        database: 'field',
        charset: 'utf8mb4'
    },
    slave: {
        connectionLimit: 10,
        host: '127.0.0.1',
        port: 3306,
        user: 'root',
        password: 'root',
        database: 'field',
        charset: 'utf8mb4'
    },

I didn't cut it all, so you can see for yourself. There should be branch libraries here, and we can configure the same ones. Fill in the corresponding information in your database here.

Then redis configured that I used the default port 6379. If there is no password, I can install a redis to start it. The configuration file is the reddis.js file configuration in the same directory.

Server IP configuration

Configure your own IP and port in the server.js configuration in the same directory.

module.exports = {
    host: ['192.168.31.194'],
    port: [16010, 16011]
};

Next is the configuration of the game server, as shown in the figure

edit

Configure master.json server.json This is the configuration file for the pomelo framework. It can be convenient to configure multiple server nodes and expand the server. We only need to configure one for testing

master.json

{
  "shaoyang":      {"id": "jtcfgame",  "host": "192.168.31.194",      "port": 3005},
  "field-test":     {"id": "jtcfgame",  "host": "127.0.0.1",      "port": 3005}
}

This also needs to correspond to the env configuration. Our env parameter configuration is Shaoyang and the first one will be launched here.

server.json

"shaoyang": {
    "pkmaster": [
      {"restart-force": false, "auto-restart": false, "id": "pkmaster", "host": "192.168.31.194", "port": 3006}
    ],
    "pkcon": [
      {"restart-force": true, "auto-restart": true, "id": "pkcon000", "host": "192.168.31.194", "port": 15000, "clientPort": 16010, "frontend": true},
      {"restart-force": true, "auto-restart": true, "id": "pkcon001", "host": "192.168.31.194", "port": 15001, "clientPort": 16011, "frontend": true}
    ],
    "pkplayer": [
      {"restart-force": false, "auto-restart": false, "id": "pkplayer000", "host": "192.168.31.194", "port": 15100}
    ],
    "pkclub": [
      {"restart-force": false, "auto-restart": false, "id": "pkclub000", "host": "192.168.31.194", "port": 15200}
    ],
    "pkleague": [
      {"restart-force": false, "auto-restart": false, "id": "pkleague000", "host": "192.168.31.194", "port": 15250}
    ],
    "pkroom": [
      {"restart-force": false, "auto-restart": false, "id": "pkroom000", "host": "192.168.31.194", "port": 15300}
    ]
  }

The various servers configured here include connection servers, login servers for players, relatives and friends circles, major leagues, and room servers. Configure the startup ip and port. Similarly, the Shaoyang beginning with json should correspond to env.

The configuration has been completed here. The next step is to activate.

[2022-11-11 11:08:44.716] [INFO] LOG - [Response][127.0.0.1] {"code":0,"message":"success","env":"shaoyang"}
[2022-11-11 11 jtcfgame listening at 09 jtcfgame listening at 02.262] [INFO] Von-jtcfgame listening at 127.0.1
[2022-11-11 11 pkclub000 listening at 09 pkclub000 listening at 07.015] [INFO] 15200 LOG-pkclub000 listening at 127.0.1
[2022-11-11 11 pkleague000 listening at 09V 06.985] [INFO] LOG-pkleague000 listening at 127.0.1
[2022-11-11 11 pkplayer000 listening at 09 pkplayer000 listening at 07.322] [INFO] 15100 LOG-pkplayer000 listening at 127.0.1
[2022-11-11 11 pkcon000 listening at 09 pkcon000 listening at 06.688] [INFO] 15000 LOG-pkcon000 listening at 127.0.1
[2022-11-11 11 pkcon001 listening at 09 pkcon001 listening at 06.936] [INFO] 15001 LOG-pkcon001 listening at 127.0.1
[2022-11-11 11 09VR 08.384] [ERROR] LOG-entry configuration not found!
[2022-11-11 11 virtual circle of relatives and friends []] [INFO] LOG
[2022-11-11 11 COMMON_CHANNEL 09V 08449] [INFO] LOG-COMMON_CHANNEL initialized successfully
[2022-11-11 11 pkplayer000 09 pkplayer000 08.450] [INFO] LOG-initialize system parameters successfully
[2022-11-11 11 pkmaster listening at 09V 06.742] [INFO] LOG-pkmaster listening at 127.0.1
[2022-11-11 11 redis mq subscribe QUEUE_WRITE_PLAYBACK_GAME 09 LOG 08.477] [INFO]
[2022-11-11 11 redis mq subscribe QUEUE_WRITE_ANALYSIS 09 LOG 08.478] [INFO]
[2022-11-11 11 redis mq subscribe QUEUE_WRITE_STANDINGS_IMAGE 09 LOG 08.478] [INFO]
[2022-11-11 11 game-http server listening at port 09 game-http server listening at port 09 game-http server listening at port 08.682] [INFO]
[2022-11-11 11 0913. 481] [INFO] LOG- env   shaoyang
[2022-11-11 11:09:13.481] [INFO] LOG - redis 127.0.0.1 6379
[2022-11-11 11:09:13.481] [INFO] LOG - mysql-master 127.0.0.1 field
[2022-11-11 11:09:13.481] [INFO] LOG - mysql-slave 127.0.0.1 field
[2022-11-11 11:09:13.482] [INFO] LOG - mysql-beta 127.0.0.1 field
[2022-11-11 11:09:13.482] [INFO] LOG - mongo mongodb://39.108.11.211:27017/dev
[2022-11-11 11:09:13.482] [INFO] LOG -                     _ooOoo_                    
[2022-11-11 11:09:13.482] [INFO] LOG -                    o8888888o                   
[2022-11-11 11:09:13.482] [INFO] LOG -                    888 . 888                   
[2022-11-11 11:09:13.482] [INFO] LOG -                    (| -_- |)                   
[2022-11-11 11:09:13.482] [INFO] LOG -                     O  =  O                    
[2022-11-11 11:09:13.482] [INFO] LOG -                 ____/`---'\____               
[2022-11-11 11:09:13.482] [INFO] LOG -               / ||| ||     ||| || \             
[2022-11-11 11:09:13.482] [INFO] LOG -              /--||| ||  :  ||| ||--\            
[2022-11-11 11:09:13.482] [INFO] LOG -             /---||| || -:- ||| ||---\           
[2022-11-11 11:09:13.483] [INFO] LOG -            |    |\\\\  -  ////|    |       
[2022-11-11 11:09:13.483] [INFO] LOG -            |    | \\\\---//// |    |      
[2022-11-11 11:09:13.483] [INFO] LOG -             \ . -\__  `-`  __/- . /          
[2022-11-11 11:09:13.483] [INFO] LOG -           ___... ''''/--.--\''''...___         
[2022-11-11 11:09:13.483] [INFO] LOG -        . ''''<  '.___\_& lt;|>_/___.' >''''.       
[2022-11-11 11:09:13.483] [INFO] LOG -       | |:   `- \'..'\ _ /'..'/ - ` :| |     
[2022-11-11 11:09:13.483] [INFO] LOG -       \ \`-.     \_ __\ /__ _/    .-`/ /   
[2022-11-11 11:09:13.483] [INFO] LOG -        '.____`-._____\___/_____.-`____.'      
[2022-11-11 11:09:13.483] [INFO] LOG - ^^^^^^^^^Blessed by the Buddha, there will never be BUG^^^^^^^^^^^^^
[2022-11-11 11:09:13.497] [ERROR] LOG - { inspect: [Function: inspect] }
[2022-11-11 11:09:07.069] [INFO] LOG - pkroom000 listening at 127.0.0.1::::15300
[2022-11-11 11:09:17.946] [INFO] LOG -File read successfully pkroom000 Time 00:10
[2022-11-11 11:09:19.850] [INFO] LOG -Initialization of system parameters successfully pkroom000
[2022-11-11 11:09:19.851] [ERROR] LOG-Pass configuration not found!!!

Start complete..

warm reminder

Due to the large number of versions, some of them may have bugs and need to fix some errors yourself.

There is no guarantee that everyone will start successfully.

read more
Resource download
PriceFree
The use is limited to testing, experiments, and research purposes. It is prohibited for all commercial operations. This team is not responsible for any illegal behavior of users during use. Please self-test all source codes! There is no guarantee of the integrity and validity of your source code. All source code is collected from the entire network
Original link:https://bcbccb.cn/en/13535.html, please indicate the source for reprinting. Disclaimer: This resource has not been authorized by the original rights holder and is not commercially available. It can only be used to learn and analyze the underlying code, CSS, etc., and is prohibited for commercial purposes. Any relevant disputes and legal liabilities arising from unauthorized commercial use shall be fully borne by the user. Everyone is responsible to support genuine copies. Please delete them within 24 hours after downloading. Thank you for your support!
1

Comments0

美团代付 支持多模板全开源 多种支付通道 多模版三合一源码 附教程
Meituan payment supports multiple templates, full open source, multiple payment channels, multiple templates, three-in-one source code with tutorials
Someone bought it 8 minutes ago Go and have a look

Site Announcements

The source code (theme/plug-in/application source code) and other resources provided by this site are only for learning and exchange

Commercial use is prohibited, otherwise all consequences will be borne by the downloading user!

Some resources are collected or copied online. If they infringe on your legitimate rights and interests, please write to us.

Currently, members have a big reward, and the current price for a lifetime member is 299 gold coins.Recent price adjustments

Join quickly, opportunities wait for no one! immediately participated in

Captcha

Fast login to social accounts

en_USEnglish