(client) feat:添加数据序列化相关代码 (#37)

Co-authored-by: zzdxxz <2079238449@qq.com>
Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
2025-07-16 13:05:04 +08:00
committed by TheRedApricot
parent 55cf9d954e
commit ffeb65ba6b
11 changed files with 2407 additions and 25 deletions

View File

@ -49,4 +49,57 @@ message SignupRequest {
message SignupResponse {
RequestResult result = 1;
string message = 2;
}
// 定义 FilePack 消息
message FilePack {
string filePath = 1;
bytes content = 2;
}
// 定义 DataPackListPack 消息
message DataPackListPack {
repeated Pair packIDAndVersion = 1;
// 定义内部的 Pair 消息(用于替代 Tuple<string, string>
message Pair {
string key = 1;
string value = 2;
}
}
// 定义 TileMapTablePack 消息
message TileMapTablePack {
map<int32, string> tileMapKey = 1; // 使用 int32 替代 int
}
// 定义 MapDataPack 消息
message MapDataPack {
Vector2 position = 1;
Vector2 size = 2;
repeated int32 tileMapType = 3; // 使用 int32 替代 int
}
// 定义 MonsterAttributes 消息
message MonsterAttributes {
int32 health = 1;
int32 moveSpeed = 2;
int32 attack = 3;
int32 defense = 4;
int32 attackSpeed = 5;
int32 attackRange = 6;
int32 attackTargetCount = 7;
}
// 定义 MonsterPack 消息
message MonsterPack {
int32 monsterID = 1;
Vector2 position = 2;
MonsterAttributes attributes = 3;
}
// 定义 Vector2 消息
message Vector2 {
float x = 1;
float y = 2;
}