syntax = "proto3"; package game; // Connection utilities to get a client_id service Connection { rpc connect(Username) 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 Username { 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; }