[II] How to Build a Pomelo game Server programming and sharing environment

Source: Internet
Author: User

1. Install Node. js

First, Pomelo is based on Node. js, so you must install Node. js first.

In Linux platform, it is recommended to download Node. js source code self-compiled installation, Source Code address: http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz

Installation Steps

wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gztar zxvf node-v0.10.26.tar.gzcd node-v0.10.26./configuremakemake install

In Windows platform, it is recommended to download the Windows program installation package directly install, http://nodejs.org/download/

Test whether the installation is successful.

node --version

Get the node. js version number currently installed.

v0.10.26


Ii. Install Pomelo

After installing Node. js, we can use npm to install Pomelo.

npm install -g pomelo

Windows and Linux platforms are the same. You only need such a command. Is it very convenient. This is due to the npm tool. npm features similar to apt-get In Debian, which is very convenient.

Verify that Pomelo is successfully installed.

pomelo --version

If the installation is successful, the current Pomelo version is displayed.

0.9.5

3. Create a Pomelo Project

For the time being, it is called the Pomelo project. In fact, it is to create a directory for running the Pomelo server instance.

pomelo init pomelo-test

You can run this command on your own. After you run the command yourself, a new pomelo-test directory is created under the current directory, which contains the following files:

Game-server: This directory is the game server directory. When we develop games in the future, we need to put the relevant content under this directory.

Web-server this directory is the web server Directory. If our game project requires WEB Support, we recommend that you use the Node. js WEB server, which is actually an express server.

Shared this directory contains some contents that are used by both WEB servers and game servers. If necessary

Npm-install this script is used to improve the runtime environment of the Pomelo server. We use pomelo init to create a pomelo Project template. We also need to continue to use this script to fill in the content, the third-party Node required for running Pomelo servers. js components, the script is divided into npm-install.sh and npm-install.bat two files, respectively for Linux platform and Windows Platform

Npm-install script

cd  pomelo-testnpm-install

At this point, the Pomelo environment has been set up.

4. Selection of development tools

Before writing code, we also need a good coding tool. Many people on the internet recommend using WebStorm for breakpoint debugging. I believe it will be a good choice.


5. Recommended reading

Finally, I want to share some articles that I personally think are better.

Quickly build Node. js development environment and accelerate npm http://blog.csdn.net/ctbinzi/article/details/23055451

Use WebStorm IDE to debug the Pomelo application http://blog.csdn.net/ctbinzi/article/details/23059169

Nodejs debugging technology summary http://blog.csdn.net/ctbinzi/article/details/23059549


If you are not clear enough, please leave a message in the article comment and I will reply as soon as possible.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.