You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

61 lines
1.1 KiB

syntax = "proto3";
package game;
// Connection utilities to get a client_id
service Connection {
rpc name(Null) returns(Name);
rpc connect(Name) returns(UserID);
rpc joinLobbyWithCode(LobbyCode) returns(Null);
rpc joinLobbyWithoutCode(Null) returns(LobbyCode);
}
// Lobby functionality (client_id required for most of them)
service Lobby {
rpc getGames(Null) returns(stream Game);
rpc getCardImage(CardID) returns (Image);
rpc vote(Vote) returns(Null);
rpc ready (Null) returns (Null);
rpc status (Null) returns (LobbyStatus);
}
message UserID {
string id = 1;
}
message Name {
string name = 1;
}
message Null {}
message CardID {
uint64 gameId = 1;
string cardId = 2;
}
message Image {
bytes content = 1;
}
message LobbyCode { uint32 code = 1; }
message Game {
string name = 1;
string version = 2;
repeated string authors = 3;
uint64 id = 4;
}
message Vote { uint64 id = 1; }
message LobbyStatus {
repeated Vote votes = 1;
repeated Player ready = 2;
bool isStarting = 3;
}
message Player {
string name = 1;
uint64 id = 2;
}