Windows Game Server-side framework Firefly installation instructions and demo run

Source: Internet
Author: User
Tags python script

Original address: http://blog.csdn.net/wangqiuyun/article/details/11150503

Originally the Company A game server selected Pomelo framework, and then out of a firefly, in order to make a comparison, decided to study Firefly. Look at the Firefly, feel the head big, python, I python small white, had to slowly toss, a day down finally installed on the Firefly framework, and his open-source online game "Diablo World" server run up, hereby record sharing!

In fact, about the installation of the framework, their official website and BBS is a tutorial is just too fragmented, and is oriented to the use of the master, Python small white at all do not understand, here I try to write a simple and clear, you are just a beginner novice can read. Before I start, I'll say roughly that this framework is based on Python, third-party libraries rely on: twisted, python-memcached,dbutils,mysqldb, back-end data storage for MySQL and memcached, so let's start from the beginning , note that I'm here for the Win7 system.

1. Install Python, I use Python-2.7.5.msi, note is 2.7 version, if you installed 2.6 below twisted and Mysql-python also will install the corresponding 2.6 version, download the next installation can, note the installation of the choice to add his path to PATH environment variable, so we can directly in The console uses Python commands;

2, install MySQL, I use is Mysql-5.5.27-win32.msi, is also the next installation can, pay attention to set the root account password, and the default port 3306;

3, install Memcached, you can download the source code back to these several compilations, you can also find someone else compile number, I found a 1.4.13 version of: Memcached 1.4.13 for Windows 32or64.zip

About memcached, I am also the first to use, here wordy a few words:

Installation: Run cmd as Administrator, enter the Memcached.exe path, run memcached.exe-d install-m 500 can be installed, you can go to the Windows service to see if there is a memcached service;

Start: memcached.exe-d start

Stop: memcached.exe-d stop

Basic Settings for memcached:
-P Listening Port default port: 11211
-L connected IP address, default is native
-D Start memcached service
-D Restart Restart memcached service
-D Stop|shutdown Close the running memcached service
-D Install memcached service
-d Uninstall Uninstall memcached service
-U Run as (only valid when running as root)
-m maximum memory usage, in megabytes. Default 64MB
-M running out of memory and returning an error instead of deleting an item
-c Maximum number of simultaneous connections, default is 1024
-F Block size growth factor, default is 1.25
-N Minimum allocated space, key+value+flags default is 48
-H Display Help

4, install Setuptools, this is actually convenient to use Easy_install to install Python third-party library, Download: Setuptools-0.6c11.win32-py2.7.exe, after installation, the Python under the Scripts path is also added to the PATH environment variable, I here is path:c:\python27\scripts;

5, install twisted, actually can use Easy_install Twisted command to install, I here is download twisted-12.2.0.win32-py2.7.exe to install;

6, run the command easy_install python-memcached installation python-memcached;

7, run the command easy_install dbutils installation dbutils;

8, run the command easy_install affinity installation affinity;

9, install Mysql-python, you can use Easy_install mysql-python command installation, I download here Mysql-python-1.2.4.win32-py2.7.exe installation;

10, Windows should also install a pywin32, download Pywin32-218.win32-py2.7.exe installation;

11, install Firefly, download Firefly, here is 1.2.2 version, after decompression, cmd into the Firefly directory, run

Python setup.py Build

Python setup.py Install

installation is complete;

12. Create and Run Demo

After installing Firefly, there is a firefly-admin tool in the Python script package. Create the first project:

firefly-admin.py CreateProject MyProject

Run: Python startmaster.py

If not the error will prove to run;

13. Run the Dark World server side

Download diabloworld-server-v1.4, unzip, run the Anheisj.sql script with MySQL to create the database;

Enter the diabloworld-server-v1.4 directory, modify the Config.json memcached server geology and MySQL database host address;

Terminal run Python startmaster.py can;

If the can ' t connect to MySQL server on ' localhost ' appears, go to change the MySQL database host address to 127.0.0.1.

------------------------------------------------------------------------

Write it down!

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.