Skip to content

项目结构

BigWorld 是一个大型 C/C++ MMO 引擎,本文档说明项目的目录布局和职责划分。

顶层目录

BigWorld/
├── programming/          # 源代码 (核心)
├── docs/                 # 文档 (VitePress)
├── .github/              # GitHub 配置
├── .spec-workflow/       # 规范工作流
├── logo.png              # 项目 Logo
├── package.json          # Node.js 配置 (文档)
├── README.md             # 项目说明
├── CONTRIBUTING.md       # 贡献指南
├── MAINTAINTERS.md       # 维护者
├── LICENSE               # 许可证
└── THIRD-PARTY-NOTICES   # 第三方声明

源代码目录

programming/

programming/
├── bigworld/             # BigWorld 主体
│   ├── server/           # 服务端进程
│   ├── client/           # 客户端
│   ├── lib/              # 核心库
│   ├── tools/            # 工具
│   ├── third_party/      # 第三方依赖
│   ├── build/            # 构建脚本
│   ├── common/           # 共享定义
│   └── examples/         # 示例代码
├── fantasydemo/          # FantasyDemo 示例
├── Makefile              # 顶层 Makefile
└── Makefile.rules        # Make 规则

programming/bigworld/server/

服务端进程目录:

目录进程职责
baseapp/BaseApp玩家基础数据管理
cellapp/CellApp游戏世界逻辑
dbapp/DBApp数据库代理
loginapp/LoginApp登录服务
baseappmgr/BaseAppMgrBaseApp 管理器
cellappmgr/CellAppMgrCellApp 管理器
dbappmgr/DBAppMgrDBApp 管理器
reviver/Reviver进程恢复
tools/-服务端工具
*_extensions/-扩展模块

programming/bigworld/lib/

核心库目录 (57 个子库):

基础设施

职责
cstdmf基础工具库 (调试、内存、计时器)
network网络栈 (Mercury)
math数学库
resmgr资源管理

服务器共享

职责
entitydef实体定义系统
script脚本绑定抽象
pyscriptPython 桥接层
db数据库抽象
server服务器共享代码

渲染与场景

职责
moo渲染引擎
scene场景管理
space空间管理
chunk室内场景
terrain地形系统

客户端专用

职责
connection客户端连接
connection_model连接模型
camera相机系统
controls输入控制

programming/bigworld/tools/

编辑器和工具:

工具职责
worldeditor/世界编辑器
modeleditor/模型编辑器
particle_editor/粒子编辑器
assetprocessor/资源处理器
navgen/导航网格生成

programming/bigworld/third_party/

第三方依赖 (24 个):

依赖用途
pythonPython 解释器
openssl加密库
curlHTTP 客户端
mongodbMongoDB 驱动
sqliteSQLite 数据库
jsoncppJSON 解析
re2正则表达式
recastnavigation导航网格

programming/bigworld/build/

构建脚本:

build/
├── make/                 # Linux Make 构建
│   ├── Makefile          # 主 Makefile
│   ├── platform_el6.mak  # CentOS 6 配置
│   ├── platform_el7.mak  # CentOS 7 配置
│   └── third_party_python.mak
├── cmake/                # CMake 配置
├── docker/               # Docker 配置
│   └── Dockerfile
└── *.bat                 # Windows 批处理

文档目录

docs/

docs/
├── index.md              # 首页
├── .vitepress/           # VitePress 配置
├── public/               # 静态资源
├── getting-started/      # 快速开始
├── architecture/         # 架构研究 (28 章)
├── analysis/             # 项目分析
├── migration/            # 迁移专题
└── references/           # 参考资料

依赖关系

┌─────────────┐
│   server/   │ ← 服务端进程
└──────┬──────┘

┌──────▼──────┐
│    lib/     │ ← 核心库
└──────┬──────┘

┌──────▼──────┐
│ third_party │ ← 第三方依赖
└─────────────┘

下一步

按源码证据链、源码取舍和验证边界组织,而不是按目录机械罗列。