-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchatto_proto.proto
86 lines (70 loc) · 1.35 KB
/
chatto_proto.proto
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
syntax = "proto3";
package chatto;
option csharp_namespace = "Proto";
//server to client:
//=================
message MessageFromServer {
//data
oneof message {
Chat chat_from_server = 1;
Error error = 2;
UserAction user_action = 3;
string server_broadcast = 4;
}
//time in ticks
uint64 time = 15;
//inner types
message Chat {
string text = 1;
string name = 2;
string trip = 3;
}
//when another user does something
message UserAction {
ActionType action_type = 1;
string name = 2;
enum ActionType {
JOIN = 0;
LEAVE = 1;
}
}
}
//server's resonse to a join, giving info about the room
message JoinResponse {
oneof response {
JoinResponseSuccessful success = 1;
Error error = 2;
}
}
//if the join is successful, the JoinResponse will contain one of these:
message JoinResponseSuccessful {
repeated string online_users = 1;
}
//if the join resulted in an error, the JoinResponse will contain one of these:
enum Error {
NAME_TAKEN = 0;
NAME_INVALID = 1;
RATE_LIMIT = 2;
}
//client to server:
//=================
message Join {
string room = 1;
string name = 2;
string password = 3;
}
message MessageToServer {
//data
oneof message {
Chat chat_to_server = 1;
ReadReciept read_reciept = 2;
}
//time in ticks
uint64 time = 15;
//inner types
message Chat {
string text = 1;
}
message ReadReciept {
}
}