diff --git a/backend/src/main.rs b/backend/src/main.rs index 5e2f97e..4f01f35 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -1,5 +1,7 @@ use rocket::fs::FileServer; +use crate::items::Game; + #[macro_use] extern crate rocket; @@ -65,21 +67,24 @@ async fn index_fallback() -> Option { #[launch] fn rocket() -> _ { + let mut game_list: Vec = Vec::new(); let mut user_list: Vec = Vec::new(); + game_list.push(Game { + title: "Naramo Nuclear Plant V2".to_string(), + source: items::Source::Roblox.into(), + multiplayer: true, + min_players: 1, + max_players: 90, + price: 0, + remote_id: 0, + }); + user_list.push(User { person: items::Person { name: "John".to_string(), opinion: vec![items::Opinion { - game: Some(items::Game { - title: "Naramo Nuclear Plant V2".to_string(), - source: items::Source::Roblox.into(), - multiplayer: true, - min_players: 1, - max_players: 90, - price: 0, - remote_id: 0, - }), + title: "Naramo Nuclear Plant V2".to_string(), would_play: true, }], }, diff --git a/protobuf/items.proto b/protobuf/items.proto index 7beb8d4..239b5a3 100644 --- a/protobuf/items.proto +++ b/protobuf/items.proto @@ -8,7 +8,7 @@ message Person { } message Opinion { - Game game = 1; + string title = 1; bool would_play = 2; } @@ -60,4 +60,11 @@ service AuthService { rpc Login(LoginRequest) returns (LoginResponse); rpc Logout(LogoutRequest) returns (LogoutResponse); rpc GetAuthStatus(AuthStatusRequest) returns (AuthStatusResponse); +} + +message GameRequest { string title = 1; } + +service MainService { + rpc GetGame(GameRequest) returns (Game); + rpc AddOpinion(GameRequest) returns (Person); } \ No newline at end of file