-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroom.proto
More file actions
106 lines (83 loc) · 2.36 KB
/
room.proto
File metadata and controls
106 lines (83 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
syntax = "proto3";
option java_multiple_files = true;
option java_package = "com.github.CA21engineer.HouseHackathonUnityServer.grpc";
option java_outer_classname = "RoomService";
//import "google/protobuf/timestamp.proto";
package room;
message RoomResponse {
oneof response {
CreateRoomResponse createRoomResponse = 1;
JoinRoomResponse joinRoomResponse = 2;
ReadyResponse readyResponse = 3;
}
}
message CreateRoomRequest {
string AccountId = 1;
string roomKey = 2; // Optional
string AccountName = 3;
}
message CreateRoomResponse {
string RoomId = 1;
}
message JoinRoomRequest {
string AccountId = 1;
string roomKey = 2; // Option
string AccountName = 3;
}
message JoinRoomResponse {
string RoomId = 1;
int32 vagrant = 2; // 空き人数
}
message ReadyResponse {
string RoomId = 1;
repeated Coordinate ghostRecord = 2;
repeated Member Member = 3;
Direction Direction = 4;
string date = 5; // 準備完了時間UTC
}
message Member {
string AccountName = 1;
Direction Direction = 2;
}
enum Direction {
UNKNOWN = 0;
Up = 1;
Down = 2;
Left = 3;
Right =4;
}
// require MetaData: string roomid, string accountid
message Coordinate {
float x = 1;
float y = 2;
// dateはゲームスタートからの開始ミリ秒(1s = 1000ms)
int64 date = 3; // ゲームスタートからの経過時間
}
// require MetaData: string roomid, string accountid
message Operation {
Direction Direction = 1;
float strength = 2; // 0 ~ 1
}
message ParentOperationRequest {
string RoomId = 1;
string AccountId = 2;
}
message SendResultRequest {
string RoomId = 1;
string AccountId = 2;
repeated Coordinate ghostRecord = 3;
}
message GetPublicRoomResponse {
int32 vagrantRoom = 1;
}
message Empty {}
service RoomService {
rpc CreateRoom(CreateRoomRequest) returns (stream RoomResponse) {};
rpc JoinRoom(JoinRoomRequest) returns (stream RoomResponse) {};
rpc CoordinateSharing(stream Coordinate) returns (stream Coordinate) {};
rpc ChildOperation(stream Operation) returns (Empty) {};
rpc ParentOperation(ParentOperationRequest) returns (stream Operation) {};
rpc SendResult(SendResultRequest) returns (Empty) {};
// まだ埋まっていない公開部屋数
rpc GetPublicRoom(Empty) returns (GetPublicRoomResponse) {};
}