Browse Source

Rewrite protos and disable rustfmt on them

main
ThePerkinrex 5 years ago
parent
commit
a559bcdf1c
No known key found for this signature in database GPG Key ID: FD81DE6D75E20917
  1. 3
      server/src/games/config.rs
  2. 8
      server/src/games/run/types.rs
  3. 5
      server/src/server/protos.rs
  4. 10
      server/src/server/protos/protocol.rs

3
server/src/games/config.rs

@ -77,8 +77,7 @@ impl Config {
let folder = folder.clone(); let folder = folder.clone();
tokio::task::spawn_blocking(|| cache_image(p, folder)); tokio::task::spawn_blocking(|| cache_image(p, folder));
} }
for for Card {
Card {
image, image,
back_image, back_image,
other: _, other: _,

8
server/src/games/run/types.rs

@ -236,6 +236,12 @@ impl RunningPile {
other.insert(k, v); other.insert(k, v);
} }
Ok(Self { name, cards, face_down, visible, other }) Ok(Self {
name,
cards,
face_down,
visible,
other,
})
} }
} }

5
server/src/server/protos.rs

@ -1,14 +1,19 @@
#[rustfmt::skip]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub mod connection; pub mod connection;
#[rustfmt::skip]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub mod lobby; pub mod lobby;
#[rustfmt::skip]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub mod game; pub mod game;
#[rustfmt::skip]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub mod common; pub mod common;
#[rustfmt::skip]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub mod protocol; pub mod protocol;

10
server/src/server/protos/protocol.rs

@ -1,9 +1,6 @@
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientServerPacket { pub struct ClientServerPacket {
#[prost( #[prost(oneof="client_server_packet::Data", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14")]
oneof = "client_server_packet::Data",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14"
)]
pub data: ::core::option::Option<client_server_packet::Data>, pub data: ::core::option::Option<client_server_packet::Data>,
} }
/// Nested message and enum types in `ClientServerPacket`. /// Nested message and enum types in `ClientServerPacket`.
@ -45,10 +42,7 @@ pub mod client_server_packet {
} }
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerClientPacket { pub struct ServerClientPacket {
#[prost( #[prost(oneof="server_client_packet::Data", tags="1, 2, 3, 4, 5, 6, 7, 8, 9")]
oneof = "server_client_packet::Data",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9"
)]
pub data: ::core::option::Option<server_client_packet::Data>, pub data: ::core::option::Option<server_client_packet::Data>,
} }
/// Nested message and enum types in `ServerClientPacket`. /// Nested message and enum types in `ServerClientPacket`.

Loading…
Cancel
Save