Skip to content
Distributed Game Server Framework
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
9miao_files readme Aug 15, 2013
firefly Modify previous wrong directory structure, redundant files Apr 23, 2014
firefly v1.2.5更新.docx
firefly v1.3.0更新.docx
firefly v1.3.1更新.docx
firefly v1.3.2更新.docx
firefly v1.3.3更新.docx
setup.cfg dreload Mar 3, 2014


####firefly 分支gfirefly介绍

firefly-gevent 是firefly的gevent版本。相比现在的firefly版本使用的twisted,gevent更加的精简。

result = root.callChild("test_node",1,u'Root测试')
print result


Home Page:
<div id="main">

	<div id="primary">
		<div id="content" role="main">

Firefly Game Server Framework Intro


<div class="entry-content">
	<p align="left">Firefly, written in Python and based on Twisted framework development, is a distributed game server framework with free, open source, stable, rapid extension and hot update features. With development framework, database caching and other basic game server services encapsulating, it signicantly reduces game development working time thereby truely allowing its users to spend more time on gameplay logic implementation. It also can be used to build customized distributed framwork, and only having a corresponding configuration file modification demand.</p>

Advantages and Features

  • Single-threaded and multi-porcess architecture with customized distributed architecture support
  • Conveninent server extension mechanism that can rapidly extend server type and quantity
  • TCP persistent connections to clients without issues like stick pack concerns
  • data caching services encapsulating
  • real-time hot updating data and game logic with no disturbing on client players
  • dozens of basic gameplay system modules for assembly using (V1. 3. 0 available)

Framework Description


  • Management: Firefly is a multi-process distributed game server, thererfore the management and extension of all game servers (processes) is a crucial part of Firefly, and extending servers will be very easy through framework.
  • Network: the skeleton of game framework is constituted by client connections communications, server inter-process communication and others, and all game flow is based on this context. Server’s communication with clients adopts request-reply mode, it will give corresponding response by all received client’s request, and can also active push and broadcast information to clients. All these requests are based on instructions number (such as difining 101 as login instruction). Here the inter-server process communication adopts asynchronous callback mode, thus reducing the time cost of inter-process communication through networks.
  • Data: data processing is a significant part of online game in which mass data needs to be stored and updated, thus the database’s read-write rate becomes the biggest performance bottleneck of server. Firefly’s db processing is able to cache the data from database table to memcache, and operate data by calling corresponding object method in the form of object, obtain synchronous data by instantiating cache instances with same name in different process and wirte the cache object’s data back to database.

Framework Ideas

        the most basic server is a continually running application. In a distributed game server, the features we need includes: monitoring client connections and other service processes’ message as well as connecting these service processes, and sometimes database connections and caching services are also required. It’s shown below:


Net connect works as client connection, root monitors other server processes’ message, and node connects other server processes, db database and caches. whether to monitor client connections and other service processes’ message as well as each server’s name and their connection relationship are all can be configured in config.json, thus developers could get their own customized distributed framework.


You can’t perform that action at this time.