[client][server] file transfer working, ui not ready for it
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use bytes::Bytes;
|
||||
use lanspread_db::db::Game;
|
||||
use lanspread_db::db::{Game, GameFileDescription};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tracing::error;
|
||||
|
||||
@ -8,6 +8,7 @@ pub enum Request {
|
||||
Ping,
|
||||
ListGames,
|
||||
GetGame { id: String },
|
||||
GetGameFileData(GameFileDescription),
|
||||
Invalid(Bytes, String),
|
||||
}
|
||||
|
||||
@ -15,7 +16,7 @@ pub enum Request {
|
||||
pub enum Response {
|
||||
Pong,
|
||||
Games(Vec<Game>),
|
||||
Game(Game),
|
||||
GetGame(Vec<GameFileDescription>),
|
||||
GameNotFound(String),
|
||||
InvalidRequest(Bytes, String),
|
||||
EncodingError(String),
|
||||
@ -74,16 +75,3 @@ impl Message for Response {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Helper methods for Response
|
||||
impl Response {
|
||||
#[must_use]
|
||||
pub fn games(games: Vec<Game>) -> Self {
|
||||
Response::Games(games)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn game(game: Game) -> Self {
|
||||
Response::Game(game)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user