# Pi
**Repository Path**: moonty/Pi
## Basic Information
- **Project Name**: Pi
- **Description**: An distributed game server framework based on [Socket4Net](https://github.com/lizs/socket4net)
- **Primary Language**: C#
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 11
- **Forks**: 2
- **Created**: 2016-07-01
- **Last Updated**: 2025-08-29
## Categories & Tags
**Categories**: game-dev
**Tags**: None
## README
#C# game server framework(based on [socket4net](https://git.oschina.net/lizs4ever/Socket4Net.git))
####Features
* Easy to use
* Distributed
* Automatic codes generation supported
* Configurable
####Getting Pi
To install Pi, run the following command in the Package Manager Console
```
PM > Install-Package Pi
```
####Framework
Pi consists of 3 parts:`Node`/`ECS`/`Editor`
#####Node
Your server cluster may have multiple processes to work together, every process can perform as a server or an client or both.In pi, We call a server or an client as a `Node`. So, one process may have serveral `Nodes`, they are managed by `NodesMgr`.
`Node` can communicate with others(remote) by a set of `Push/RequestAsyn` interfaces. `Node` and `NodesMgr` has their own configuration(standard xml), for example:
```xml
...
...
```
You can also config `Redis` nodes, for example:
```xml
```
#####ECS
ECS is an Entity/Component/System implementation.
`Entity` indicates what data does an object have. `Component` indicates what can an object do.
`Entity` may has serveral `Component`, and it's codes could automatic generated by `Pi.Editor.exe`. `Component` is freedom, you can write the game driver logic in these `Components`.
#####Editor
It's main goal is to make `Entity` definition visually, but it's just a commandline tool in current development.
`Editor` generate `Pi.Gen.dll` finnally, which contains the game protocol, constants and entities.
######Protocol define
Standart google protobuf message.
######Entity define
Json file, for example:
```json
{
"Comment": "实体定义",
"Name": "Ship",
"Properties": [
"One",
"Two",
"Three"
],
"Components": [
"ModifierComponent",
]
}
```
####Question
QQ group:[Click to join](http://jq.qq.com/?_wv=1027&k=VptNja)
e-mail : lizs4ever@163.com