将 openspec skills 迁移到全局 + 定义后续 proto 类型
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4,35 +4,34 @@ namespace Network.Defines
|
||||
{
|
||||
Unknow = 0,
|
||||
|
||||
// 游戏相关
|
||||
PlayerInput = 1,
|
||||
// Gameplay
|
||||
MoveInput = 1,
|
||||
PlayerState = 2,
|
||||
PlayerAction = 3,
|
||||
GameState = 4,
|
||||
ShootInput = 3,
|
||||
CombatEvent = 4,
|
||||
PlayerJoin = 5,
|
||||
PlayerLeave = 6,
|
||||
PlayerAction = 7,
|
||||
GameState = 8,
|
||||
|
||||
// 聊天相关
|
||||
// Chat
|
||||
ChatMessage = 10,
|
||||
PrivateMessage = 11,
|
||||
SystemMessage = 12,
|
||||
|
||||
// 系统相关
|
||||
// Session
|
||||
HeartBeat = 20,
|
||||
|
||||
LoginRequest = 21,
|
||||
LoginResponse = 22,
|
||||
|
||||
LogoutRequest = 23,
|
||||
|
||||
// 房间管理
|
||||
// Room management
|
||||
CreateRoom = 30,
|
||||
JoinRoom = 31,
|
||||
LeaveRoom = 32,
|
||||
RoomList = 33,
|
||||
|
||||
|
||||
Heartbeat = 40,
|
||||
HeartbeatResponse = 41,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package Network.Defines;
|
||||
option csharp_namespace = "Network.Defines";
|
||||
|
||||
message Envelope {
|
||||
int32 type = 1;
|
||||
bytes payload = 2;
|
||||
}
|
||||
|
||||
message Vector3 {
|
||||
float x = 1;
|
||||
float y = 2;
|
||||
float z = 3;
|
||||
}
|
||||
|
||||
message LoginRequest {
|
||||
string player_id = 1;
|
||||
int32 speed = 2;
|
||||
}
|
||||
|
||||
message LoginResponse {
|
||||
repeated string player_id = 1;
|
||||
repeated Vector3 positions = 2;
|
||||
int32 speed = 3;
|
||||
int64 server_tick = 4;
|
||||
bool result = 5;
|
||||
}
|
||||
|
||||
message PlayerJoin {
|
||||
string player_id = 1;
|
||||
Vector3 position = 2;
|
||||
}
|
||||
|
||||
message LogoutRequest {
|
||||
string player_id = 1;
|
||||
}
|
||||
|
||||
message MoveInput {
|
||||
string player_id = 1;
|
||||
int64 tick = 2;
|
||||
float move_x = 3;
|
||||
float move_y = 4;
|
||||
}
|
||||
|
||||
message ShootInput {
|
||||
string player_id = 1;
|
||||
int64 tick = 2;
|
||||
float dir_x = 3;
|
||||
float dir_y = 4;
|
||||
string target_id = 5;
|
||||
}
|
||||
|
||||
enum CombatEventType {
|
||||
COMBAT_EVENT_TYPE_UNSPECIFIED = 0;
|
||||
COMBAT_EVENT_TYPE_HIT = 1;
|
||||
COMBAT_EVENT_TYPE_DAMAGE_APPLIED = 2;
|
||||
COMBAT_EVENT_TYPE_DEATH = 3;
|
||||
COMBAT_EVENT_TYPE_SHOOT_REJECTED = 4;
|
||||
}
|
||||
|
||||
message CombatEvent {
|
||||
int64 tick = 1;
|
||||
CombatEventType event_type = 2;
|
||||
string attacker_id = 3;
|
||||
string target_id = 4;
|
||||
int32 damage = 5;
|
||||
Vector3 hit_position = 6;
|
||||
}
|
||||
|
||||
message PlayerState {
|
||||
string player_id = 1;
|
||||
Vector3 position = 2;
|
||||
Vector3 velocity = 3;
|
||||
float rotation = 4;
|
||||
int64 tick = 5;
|
||||
int32 hp = 6;
|
||||
}
|
||||
|
||||
message Heartbeat {
|
||||
}
|
||||
|
||||
message HeartbeatResponse {
|
||||
int64 server_tick = 1;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 188a244376e8ae247b1c065b510a70d0
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user