2021-06-02 21:09:58 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package dicebot;
|
|
|
|
|
|
|
|
service Dicebot {
|
|
|
|
rpc GetVariable(GetVariableRequest) returns (GetVariableReply);
|
|
|
|
rpc GetAllVariables(GetAllVariablesRequest) returns (GetAllVariablesReply);
|
|
|
|
rpc SetVariable(SetVariableRequest) returns (SetVariableReply);
|
|
|
|
rpc RoomsForUser(UserIdRequest) returns (RoomsListReply);
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetVariableRequest {
|
|
|
|
string user_id = 1;
|
|
|
|
string room_id = 2;
|
|
|
|
string variable_name = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetVariableReply {
|
2021-09-03 09:29:52 +00:00
|
|
|
int32 value = 1;
|
2021-06-02 21:09:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetAllVariablesRequest {
|
|
|
|
string user_id = 1;
|
|
|
|
string room_id = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetAllVariablesReply {
|
2021-09-03 09:29:52 +00:00
|
|
|
map<string, int32> variables = 1;
|
2021-06-02 21:09:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SetVariableRequest {
|
|
|
|
string user_id = 1;
|
|
|
|
string room_id = 2;
|
|
|
|
string variable_name = 3;
|
|
|
|
int32 value = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SetVariableReply {
|
|
|
|
bool success = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UserIdRequest {
|
|
|
|
string user_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RoomsListReply {
|
|
|
|
message Room {
|
|
|
|
string room_id = 1;
|
|
|
|
string display_name = 2;
|
|
|
|
}
|
|
|
|
|
2021-09-03 09:29:52 +00:00
|
|
|
repeated Room rooms = 1;
|
2021-06-02 21:09:58 +00:00
|
|
|
}
|