Skip to content

Commit

Permalink
Merge pull request #8 from GuoWQ222/dev
Browse files Browse the repository at this point in the history
docs: 🎨 server
  • Loading branch information
asdawej authored Nov 16, 2023
2 parents b96bcec + 761484d commit 717c235
Show file tree
Hide file tree
Showing 4 changed files with 462 additions and 3 deletions.
10 changes: 10 additions & 0 deletions dependency/proto/Message2Clients.proto
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ message BoolRes
bool act_success = 1;
}

message MessageOfNews
{
oneof news // 一条新闻
{
string text_message = 1;
bytes binary_message = 4;
}
int64 from_id = 2;
int64 to_id = 3;
}
// message MsgRes // 用于获取队友发来的消息
// {
// bool have_message = 1; // 是否有待接收的消息
Expand Down
5 changes: 5 additions & 0 deletions dependency/proto/Message2Server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,35 @@ message CollectorMsg
{
int64 collector_id = 1;
CollectorType collector_type = 2;
int64 ship_id=3;
}

message ArmorMsg
{
int64 armor_id = 1;
ArmorType armor_type = 2;
int64 ship_id=3;
}

message ShieldMsg
{
int64 shield_id = 1;
ShieldType shield_type = 2;
int64 ship_id=3;
}

message BuilderMsg
{
int64 builder_id = 1;
BuilderType builder_type = 2;
int64 ship_id=3;
}

message BulleterMsg
{
int64 bullet_id = 1;
BulletType bullet_type = 2;
int64 ship_id=3;
}

message MoveMsg
Expand Down
4 changes: 1 addition & 3 deletions dependency/proto/Services.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ service AvailableService
{
rpc TryConnection (IDMsg) returns(BoolRes);
// 游戏开局调用一次的服务
rpc AddBasicShip (ShipMsg) returns(stream MessageToClient); // 连接上后等待游戏开始,server会定时通过该服务向所有client发送消息。
rpc AddHome (HomeMsg) returns (stream MessageToClient);
rpc AddBuilding(BuildingMsg) returns (stream MessageToClient);
rpc AddShip (ShipMsg) returns(stream MessageToClient); // 连接上后等待游戏开始,server会定时通过该服务向所有client发送消息。
// 游戏过程中玩家执行操作的服务
//船动作
rpc Move (MoveMsg) returns (MoveRes);
Expand Down
Loading

0 comments on commit 717c235

Please sign in to comment.