refactor game proto

This commit is contained in:
code002lover 2025-12-02 14:24:31 +01:00
parent 0222332d3f
commit cccd5a9d83
2 changed files with 22 additions and 10 deletions

View File

@ -1,5 +1,7 @@
use rocket::fs::FileServer;
use crate::items::Game;
#[macro_use]
extern crate rocket;
@ -65,13 +67,10 @@ async fn index_fallback() -> Option<rocket::fs::NamedFile> {
#[launch]
fn rocket() -> _ {
let mut game_list: Vec<Game> = Vec::new();
let mut user_list: Vec<User> = Vec::new();
user_list.push(User {
person: items::Person {
name: "John".to_string(),
opinion: vec![items::Opinion {
game: Some(items::Game {
game_list.push(Game {
title: "Naramo Nuclear Plant V2".to_string(),
source: items::Source::Roblox.into(),
multiplayer: true,
@ -79,7 +78,13 @@ fn rocket() -> _ {
max_players: 90,
price: 0,
remote_id: 0,
}),
});
user_list.push(User {
person: items::Person {
name: "John".to_string(),
opinion: vec![items::Opinion {
title: "Naramo Nuclear Plant V2".to_string(),
would_play: true,
}],
},

View File

@ -8,7 +8,7 @@ message Person {
}
message Opinion {
Game game = 1;
string title = 1;
bool would_play = 2;
}
@ -61,3 +61,10 @@ service AuthService {
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);
}