Massively_Multiplayer_Game_Development_CDROM
所属分类:游戏
开发工具:Visual C++
文件大小:20061KB
下载次数:48
上传日期:2009-08-03 22:00:41
上 传 者:
xzrw
说明: 大型多人在线网络游戏(Massively Multiplayer Game Development)编程附书源代码
(Massively Multiplayer Game Development source code)
文件列表:
Source Code\5.2 RDBMS for MMP\constantmodule.py (3849, 2002-08-11)
Source Code\5.2 RDBMS for MMP\localization.py (2512, 2002-08-11)
Source Code\5.2 RDBMS for MMP\lookup.py (4996, 2002-08-11)
Source Code\5.2 RDBMS for MMP\stringscript.sql (4360, 2002-08-17)
Source Code\5.2 RDBMS for MMP\stringtable.py (915, 2002-08-11)
Source Code\5.2 RDBMS for MMP (0, 2005-11-12)
Source Code\4.4 Fixed Size Allocator\BlockAllocator.h (2722, 2002-10-15)
Source Code\4.4 Fixed Size Allocator (0, 2005-11-12)
Source Code\4.3 Procedural Worlds\GLPlanet\Billboard.cpp (3048, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Billboard.h (2270, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\DXUtil.cpp (4463, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\DXUtil.h (4114, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Font.h (2972, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\GameApp.cpp (9260, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\GameApp.h (7567, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\GameEngine.cpp (8099, 2002-10-09)
Source Code\4.3 Procedural Worlds\GLPlanet\GameEngine.h (3204, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\glext.h (161817, 2001-03-09)
Source Code\4.3 Procedural Worlds\GLPlanet\glh_genext.h (67337, 2001-06-02)
Source Code\4.3 Procedural Worlds\GLPlanet\GLPlanet.dsp (7467, 2002-10-07)
Source Code\4.3 Procedural Worlds\GLPlanet\GLPlanet.dsw (539, 2002-10-07)
Source Code\4.3 Procedural Worlds\GLPlanet\GLPlanet.exe (163840, 2002-10-09)
Source Code\4.3 Procedural Worlds\GLPlanet\GLPlanet.rc (3782, 2002-08-11)
Source Code\4.3 Procedural Worlds\GLPlanet\GLUtil.cpp (4618, 2002-10-09)
Source Code\4.3 Procedural Worlds\GLPlanet\GLUtil.h (6462, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\HeightMap.cpp (3512, 2002-10-06)
Source Code\4.3 Procedural Worlds\GLPlanet\HeightMap.h (5329, 2002-10-06)
Source Code\4.3 Procedural Worlds\GLPlanet\icon1.ico (766, 2000-10-01)
Source Code\4.3 Procedural Worlds\GLPlanet\Impostor.cpp (4527, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Impostor.h (5143, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\license.txt (1527, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\ListClasses.h (4040, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\ListTemplates.h (22372, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Master.cpp (1558, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Master.h (3588, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Matrix.cpp (5687, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Matrix.h (43260, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Noise.cpp (11729, 2002-10-05)
Source Code\4.3 Procedural Worlds\GLPlanet\Noise.h (10253, 2002-10-05)
... ...
INTRODUCTION
The software in this package constitutes a sample program
that is intended to demonstrate the principles discussed
in the articles:
Precise Game Event Broadcasting with Python
Creating a "Safe Sandbox" for Game Scripting
In the accompanying book, "Massively Multiplayer Game Development".
The two articles were originally written as independent
representations, but in constructing the sample program, it
became clear that both concepts would benefit from a consistent
treatment within the same code base.
FEATURES
The program is a simple text-based multiplayer game server,
similar to a MUD. The key features of interest include:
* An asynchronous event broadcasting framework that allows
interested code to register for events using very
precise criteria, minimizing the overhead of polling
for state changes and testing for the relevance of an
event that has been received.
* A framework for creating a "safe sandbox" in which game
designers and other non-technical scripters may feel
free to push the envelope of creativity without fear of
undermining the stability of the server with coding
errors or a less than perfectly engineered implementation.
To showcase the above features, an interactive, game-like
environment was developed to illustrate both how these
features work, and how to write code that makes use of them.
The secondary features that achieve this include:
- Multi-user text-based (i.e. telnet) client support.
- A "world" with 3 distinct "rooms" that players can enter.
- A small set of trivial game behaviors, including a
player inventory, the ability to take objects from the
world, and the ability to engage in combat with other
players.
- A limited text-based command set that supports the
game play, and navigation within the "world".
FILES
The files included in this package are listed and described
below:
/
README -- This file
gameserverdemo.py -- The "main" program that drives the server.
/gameserver
__init__.py -- Special empty file used by Python
deferred.py -- Deferred call implementation [1]
eventbroadcaster.py -- Event broadcaster implemenation [1]
gameeventkeys.py -- Event keys for precise registration [1]
gameevents.py -- Module of event id constants [2]
gameobs.py -- Module containing a variety of game objects
gameserver.py -- Core server framework, based on asyncore and asynchat [3]
objmgr.py -- Object manager that allows addressing objects by an id [2]
request.py -- Request handler and processor of input commands
safesandbox.py -- Safe Sandbox implementation [1]
sandboxrexec.py -- Restricted execution implementation [1]
/gameserver/sandboxmodules
__init__.py -- Special empty file used by Python
battle.py -- A sandbox that provides an arena for combat [2]
thetrap.py -- A sandbox that demonstrates prevention of prohibited operations [2]
town.py -- A sandbox that implements a "social space" [2]
Notes:
[1] The code in these files implement the core concepts described
in the articles. Refer to them for implementation details referred
to in the text, and for comments that provide further explanation.
This code is almost identical to the listings in the articles,
except where variable or module names had to be changed in order
to enable the code to work together in the same process.
[2] These files represent concepts that either use the core concepts,
or facilitate their implementation. They are briefly alluded to
in the article text in an abstract fashion. Their implementation
details will differ from the examples in the articles, but they
should illustrate the concepts mentioned in them.
[3] The asyncore.py and asynchat.py Python modules provide a useful
framework for building asynchronous server applications. They are
excellent for quickly prototyping concepts such as those
presented by this demo.
RUNNING THE DEMO
To run the demo, you must have Python installed on your system.
This code has been tested with Python 2.2, but it should work
fine with anything from 2.0 and later. The code should work
on both Windows and Linux, as no platform-specific features
were used.
To start the server, change directory to the directory
containing this file. Then, run it with the following
command:
$ python gameserverdemo.py
where is the port number on which the server will listen
for client connections.
To connect to the server as a client, use any telnet client
to connect to the server's listening port. For example, if
you started the server on port 2112, connect with:
$ telnet 2112
where is the name of the computer on which the
server is running.
Once connected, type 'help' for a list of commands, and
play around with it.
CAVEAT EMPTOR
The code presented in this project is for demonstration purposes
only. Care was taken to ensure that the core concepts described
in the articles were accurately implemented. However, it should
be recognized that in the interest of simplicity, only limited
attention was given to error handling. In addition, the code in
this demo represents only one of many possible implementations of
the concepts described in the article. You should consider your
project's needs and architectural constraints when applying
these principles in your own implementation.
CONTACT INFORMATION
I welcome questions and comments from readers. Please direct
them to:
Matt Walker
mwalker@softhome.net
近期下载者:
相关文件:
收藏者: