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:34:33 +00:00
|
|
|
string user_id = 1;
|
|
|
|
string room_id = 2;
|
|
|
|
string variable_name = 3;
|
|
|
|
int32 value = 4;
|
2021-06-02 21:09:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetAllVariablesRequest {
|
|
|
|
string user_id = 1;
|
|
|
|
string room_id = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetAllVariablesReply {
|
2021-09-03 09:34:33 +00:00
|
|
|
string user_id = 1;
|
|
|
|
string room_id = 2;
|
|
|
|
map<string, int32> variables = 3;
|
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:34:33 +00:00
|
|
|
string user_id = 1;
|
|
|
|
repeated Room rooms = 2;
|
2021-06-02 21:09:58 +00:00
|
|
|
}
|