#C# game server framework(based on socket4net)
####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:
<!--single node-->
<node name="Chat server"
type="Chat"
guid="{12B3E06E-6CFF-4BC8-8DF9-67F03273C299}"
ip="127.0.0.1"
port="6001"
pwd="">
</node>
<!--multiple server nodes-->
<servers>
<node .../>
...
</servers>
<!--multiple client nodes-->
<clients>
<node .../>
...
</clients>
You can also config Redis
nodes, for example:
<redisnodes>
<node name="Redis client"
type="Redis"
guid="{D49A172A-00DD-4E8D-AB21-490F35A560A2}"
ip="127.0.0.1"
port="6379"
pwd="" />
</redisnodes>
#####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:
{
"Comment": "实体定义",
"Name": "Ship",
"Properties": [
"One",
"Two",
"Three"
],
"Components": [
"ModifierComponent",
]
}
####Question
QQ group:Click to join
e-mail : lizs4ever@163.com