drop the commentary and run a workspace-wide format pass
This commit is contained in:
parent
a585b0c18d
commit
f0f739c02c
43 changed files with 72 additions and 70 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -2,3 +2,5 @@
|
|||
/data
|
||||
*.json.tmp
|
||||
docs/protocol.md
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
use auth_service::{AuthConfig, AuthService};
|
||||
use service_rpc::serve;
|
||||
use std::sync::Arc;
|
||||
use tokio::net::TcpListener;
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
use std::sync::Arc;
|
||||
use crate::config::AuthConfig;
|
||||
use crate::store::{unavailable, AccountStore};
|
||||
use crate::time::{days_between, format_utc, unix_millis, unix_seconds};
|
||||
use service_rpc::{
|
||||
AccountRef, AuthApi, AuthRequest, AuthResponse, DeviceInfo, LoginOutcome, RpcResult,
|
||||
RpcService, Session,
|
||||
};
|
||||
use crate::config::AuthConfig;
|
||||
use crate::store::{unavailable, AccountStore};
|
||||
use crate::time::{days_between, format_utc, unix_millis, unix_seconds};
|
||||
use std::sync::Arc;
|
||||
fn connect_failed(error: storage::StorageError) -> std::io::Error {
|
||||
std::io::Error::other(format!(
|
||||
"{error}\ncreate the database with `createdb scroll`, or point DATABASE_URL somewhere else"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
mod postgres;
|
||||
pub use postgres::AccountStore;
|
||||
use rand::distributions::Alphanumeric;
|
||||
use rand::Rng;
|
||||
use service_rpc::{AccountRef, RpcError};
|
||||
use storage::StorageError;
|
||||
pub use postgres::AccountStore;
|
||||
pub const PASS_TOKEN_LEN: usize = 40;
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Account {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use service_rpc::AccountRef;
|
||||
use storage::{Database, DatabaseConfig, Result, Row};
|
||||
use crate::store::{generate_pass_token, Account};
|
||||
use crate::time::unix_seconds;
|
||||
use service_rpc::AccountRef;
|
||||
use storage::{Database, DatabaseConfig, Result, Row};
|
||||
pub struct AccountStore {
|
||||
database: Database,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
use crate::commands::command::{CommandOutcome, Execute};
|
||||
use crate::commands::command_type;
|
||||
use crate::commands::header::LogicCommandHeader;
|
||||
use crate::data::LogicDataRef;
|
||||
use crate::home::LogicHomeMode;
|
||||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
pub const COMMODITY_ACHIEVEMENT_PROGRESS: usize = 2;
|
||||
pub const COMMODITY_ACHIEVEMENT_CLAIMED: usize = 3;
|
||||
#[derive(Debug, Default, Payload, Command)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
use crate::battle::LogicVector2;
|
||||
use crate::commands::command::{CommandOutcome, Execute};
|
||||
use crate::commands::command_type;
|
||||
|
|
@ -7,6 +5,8 @@ use crate::commands::header::LogicCommandHeader;
|
|||
use crate::data::LogicDataRef;
|
||||
use crate::home::LogicHomeMode;
|
||||
use crate::model::LogicSpell;
|
||||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Default, Payload, Command)]
|
||||
#[command(id = command_type::DO_SPELL)]
|
||||
pub struct LogicDoSpellCommand {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
use crate::commands::command::{CommandOutcome, Execute};
|
||||
use crate::commands::header::LogicCommandHeader;
|
||||
use crate::commands::reward::LogicReward;
|
||||
use crate::commands::{chest_source, command_type};
|
||||
use crate::home::LogicHomeMode;
|
||||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Default, Payload, Command)]
|
||||
#[command(id = command_type::CLAIM_REWARD)]
|
||||
pub struct LogicClaimRewardCommand {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::data::LogicDataRef;
|
||||
use crate::home::LogicHomeMode;
|
||||
use std::any::Any;
|
||||
use std::fmt::Debug;
|
||||
use titan::{ByteStreamReader, ByteStreamWriter, Payload, Result};
|
||||
use crate::data::LogicDataRef;
|
||||
use crate::home::LogicHomeMode;
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum CommandOutcome {
|
||||
ClaimStarted {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
use crate::commands::command::{CommandOutcome, Execute};
|
||||
use crate::commands::command_type;
|
||||
use crate::commands::header::LogicCommandHeader;
|
||||
use crate::home::LogicHomeMode;
|
||||
use crate::model::{LogicSpell, DECK_SLOT_COUNT};
|
||||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Default, Payload, Command)]
|
||||
#[command(id = command_type::SWAP_SPELLS)]
|
||||
pub struct LogicSwapSpellsCommand {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::commands::command::{CommandRegistryEntry, LogicCommand};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use titan::{ByteStreamReader, ByteStreamWriter, Error, Payload, Result};
|
||||
use crate::commands::command::{CommandRegistryEntry, LogicCommand};
|
||||
static REGISTRY: OnceLock<Arc<HashMap<i32, CommandRegistryEntry>>> = OnceLock::new();
|
||||
pub struct LogicCommandManager;
|
||||
impl LogicCommandManager {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
use crate::commands::command::{CommandOutcome, Execute};
|
||||
use crate::commands::command_type;
|
||||
use crate::commands::header::LogicCommandHeader;
|
||||
use crate::home::LogicHomeMode;
|
||||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Default, Payload, Command)]
|
||||
#[command(id = command_type::UPDATE_LAST_SHOWN_LEVEL_UP)]
|
||||
pub struct LogicUpdateLastShownLevelUpCommand {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Payload;
|
||||
use crate::model::LogicSpell;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Payload)]
|
||||
pub struct LogicReward {
|
||||
#[codec(null_list)]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
use crate::commands::command::{CommandOutcome, Execute};
|
||||
use crate::commands::command_type;
|
||||
use crate::commands::header::LogicCommandHeader;
|
||||
use crate::data::LogicDataRef;
|
||||
use crate::home::LogicHomeMode;
|
||||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
pub const WEEKDAY_MIN: i32 = 1;
|
||||
pub const WEEKDAY_MAX: i32 = 7;
|
||||
#[derive(Debug, Default, Payload, Command)]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
use crate::commands::command::{CommandOutcome, Execute};
|
||||
use crate::commands::command_type;
|
||||
use crate::commands::header::LogicCommandHeader;
|
||||
use crate::data::LogicDataRef;
|
||||
use crate::home::LogicHomeMode;
|
||||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Default, Payload, Command)]
|
||||
#[command(id = command_type::FUSE_SPELLS)]
|
||||
pub struct LogicFuseSpellsCommand {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
use crate::commands::command::{CommandOutcome, Execute};
|
||||
use crate::commands::command_type;
|
||||
use crate::commands::header::LogicCommandHeader;
|
||||
use crate::home::LogicHomeMode;
|
||||
use logic_derive::Command;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Default, Payload, Command)]
|
||||
#[command(id = command_type::HELP_OPENED)]
|
||||
pub struct LogicHelpOpenedCommand {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Message;
|
||||
use crate::commands::{LogicClaimRewardCommand, LogicCommand};
|
||||
use titan::Message;
|
||||
#[derive(Debug, Message)]
|
||||
#[message(
|
||||
id = 24111,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Message;
|
||||
use crate::battle::LogicBattleEvent;
|
||||
use titan::Message;
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Message)]
|
||||
#[message(id = 12951, direction = "client", name = "SendBattleEventMessage")]
|
||||
pub struct SendBattleEventMessage {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Message;
|
||||
use crate::commands::LogicCommand;
|
||||
use titan::Message;
|
||||
#[derive(Debug, Default, Message)]
|
||||
#[message(id = 14102, direction = "client", name = "EndClientTurnMessage")]
|
||||
#[codec(partial)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::{LogicLong, Message};
|
||||
use crate::data::LogicDataRef;
|
||||
use titan::{LogicLong, Message};
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Message)]
|
||||
#[message(id = 10101, direction = "client", name = "LoginMessage")]
|
||||
#[codec(partial)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Message;
|
||||
use crate::commands::LogicCommand;
|
||||
use titan::Message;
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Message)]
|
||||
#[message(id = 24106, direction = "server", name = "StopHomeLogicMessage")]
|
||||
pub struct StopHomeLogicMessage {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
mod available_server_command;
|
||||
mod battle_event;
|
||||
mod battle_result;
|
||||
mod client_capabilities;
|
||||
mod client_requests;
|
||||
|
|
@ -11,7 +12,6 @@ mod login_ok;
|
|||
mod matchmake;
|
||||
mod out_of_sync;
|
||||
mod own_home_data;
|
||||
mod battle_event;
|
||||
mod request_sector_state;
|
||||
mod sector_command;
|
||||
mod sector_heartbeat;
|
||||
|
|
@ -19,6 +19,7 @@ mod sector_state;
|
|||
mod server_error;
|
||||
mod start_mission;
|
||||
pub use available_server_command::AvailableServerCommandMessage;
|
||||
pub use battle_event::{BattleEventMessage, SendBattleEventMessage};
|
||||
pub use battle_result::{
|
||||
BattleResultMessage, BATTLE_RESULT_DRAW, BATTLE_RESULT_LOSE, BATTLE_RESULT_WIN,
|
||||
};
|
||||
|
|
@ -36,7 +37,6 @@ pub use login_ok::LoginOkMessage;
|
|||
pub use matchmake::{CancelMatchmakeDoneMessage, HomeLogicStoppedMessage, StopHomeLogicMessage};
|
||||
pub use out_of_sync::OutOfSyncMessage;
|
||||
pub use own_home_data::OwnHomeDataMessage;
|
||||
pub use battle_event::{BattleEventMessage, SendBattleEventMessage};
|
||||
pub use request_sector_state::RequestSectorStateMessage;
|
||||
pub use sector_command::SectorCommandMessage;
|
||||
pub use sector_heartbeat::SectorHeartbeatMessage;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Message;
|
||||
use crate::model::{LogicClientAvatar, LogicClientHome};
|
||||
use titan::Message;
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Message)]
|
||||
#[message(id = 24101, direction = "server", name = "OwnHomeDataMessage")]
|
||||
pub struct OwnHomeDataMessage {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Message;
|
||||
use crate::commands::LogicCommand;
|
||||
use titan::Message;
|
||||
#[derive(Debug, Default, Message)]
|
||||
#[message(id = 12904, direction = "client", name = "SectorCommandMessage")]
|
||||
#[codec(partial)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Message;
|
||||
use crate::data::LogicDataRef;
|
||||
use titan::Message;
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Message)]
|
||||
#[message(id = 14104, direction = "client", name = "StartMissionMessage")]
|
||||
pub struct StartMissionMessage {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use titan::Payload;
|
||||
use crate::data::{LogicDataRef, LogicTreasureChestData};
|
||||
use crate::model::LogicTimer;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum ChestSource {
|
||||
Free = 0,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use titan::{LogicLong, Payload};
|
||||
use crate::data::{LogicArenaData, LogicDataRef};
|
||||
use crate::model::LogicDataSlot;
|
||||
use titan::{LogicLong, Payload};
|
||||
pub const COMMODITY_TYPE_COUNT: usize = 6;
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Payload)]
|
||||
pub struct LogicCommodityStore {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use titan::{LogicLong, Payload};
|
||||
use crate::data::{LogicArenaData, LogicDataRef};
|
||||
use crate::model::{LogicChest, LogicDataSlot, LogicSpellCollection, LogicSpellDeck, LogicTimer};
|
||||
use titan::{LogicLong, Payload};
|
||||
pub const TUTORIAL_BITSET_WORDS: usize = 8;
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Payload)]
|
||||
pub struct LogicClientHome {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Payload;
|
||||
use crate::data::LogicDataRef;
|
||||
use titan::Payload;
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Payload)]
|
||||
pub struct LogicDataSlot {
|
||||
pub data: LogicDataRef,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use titan::Payload;
|
||||
use crate::data::LogicDataRef;
|
||||
use titan::Payload;
|
||||
pub const DECK_SLOT_COUNT: usize = 8;
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Payload)]
|
||||
pub struct LogicSpell {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
mod supervisor;
|
||||
use std::sync::Arc;
|
||||
use crate::supervisor::ServiceSpec;
|
||||
use auth_service::{AuthConfig, AuthService};
|
||||
use game_service::{GameConfig, GameService};
|
||||
use gateway::{Backends, GatewayConfig};
|
||||
use crate::supervisor::ServiceSpec;
|
||||
use std::sync::Arc;
|
||||
fn supervised() -> bool {
|
||||
std::env::var("SCROLL_MODE")
|
||||
.map(|mode| mode.eq_ignore_ascii_case("supervised"))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use crate::error::RpcResult;
|
||||
use crate::game::AccountRef;
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct DeviceInfo {
|
||||
#[serde(default)]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
use std::marker::PhantomData;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::sync::Mutex;
|
||||
use crate::error::{RpcError, RpcResult};
|
||||
use crate::server::{read_frame, write_frame};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use std::marker::PhantomData;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::sync::Mutex;
|
||||
pub const DEFAULT_POOL_SIZE: usize = 8;
|
||||
pub struct RpcClient<Req, Res> {
|
||||
endpoint: String,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use crate::error::RpcResult;
|
||||
use crate::wire::WireMessage;
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[derive(
|
||||
Debug, Default, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize,
|
||||
)]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use std::sync::Arc;
|
||||
use crate::error::{RpcError, RpcResult};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use std::sync::Arc;
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
use tokio::net::{TcpListener, TcpStream};
|
||||
use crate::error::{RpcError, RpcResult};
|
||||
pub const MAX_FRAME_LEN: usize = 8 * 1024 * 1024;
|
||||
#[async_trait::async_trait]
|
||||
pub trait RpcService: Send + Sync + 'static {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::time::Duration;
|
||||
use crate::error::Result;
|
||||
use sqlx::postgres::{PgConnectOptions, PgPoolOptions};
|
||||
use sqlx::{ConnectOptions, PgPool};
|
||||
use crate::error::Result;
|
||||
use std::time::Duration;
|
||||
pub const DEFAULT_URL: &str = "postgres:///scroll";
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DatabaseConfig {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use std::marker::PhantomData;
|
||||
use crate::error::{Error, Result};
|
||||
use crate::io::{ByteStreamReader, ByteStreamWriter, MAX_COLLECTION_LEN};
|
||||
use crate::logic_long::LogicLong;
|
||||
use crate::message::Payload;
|
||||
use std::marker::PhantomData;
|
||||
pub trait Codec<T> {
|
||||
fn write(writer: &mut ByteStreamWriter, value: &T) -> Result<()>;
|
||||
fn read(reader: &mut ByteStreamReader<'_>) -> Result<T>;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
mod rc4;
|
||||
pub use rc4::Rc4Encrypter;
|
||||
use crate::error::Result;
|
||||
pub use rc4::Rc4Encrypter;
|
||||
pub const SCROLL_RC4_KEY: &str = "fhsd6f86f67rt8fw78fw789we78r9789wer6re";
|
||||
pub const SCROLL_RC4_NONCE: &str = "nonce";
|
||||
pub trait StreamEncrypter: Send + Sync {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::collections::HashMap;
|
||||
use crate::csv::row::CsvRow;
|
||||
use crate::csv::value::{ColumnType, CsvValue};
|
||||
use std::collections::HashMap;
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct CsvColumn {
|
||||
pub name: String,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::error::{Error, Result};
|
||||
use crate::message::{Direction, Message, MessageMeta};
|
||||
use std::collections::HashMap;
|
||||
use std::fmt::Debug;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use crate::error::{Error, Result};
|
||||
use crate::message::{Direction, Message, MessageMeta};
|
||||
type DecodeFn = fn(&[u8]) -> Result<Box<dyn Message>>;
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct RegistryEntry {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ pub use data_ref::GlobalId;
|
|||
pub use error::{Error, Result};
|
||||
pub use factory::{MessageFactory, MessageRegistry};
|
||||
pub use frame::{FrameCodec, FrameHeader, MessageFrame, HEADER_LEN, MAX_PAYLOAD_LEN};
|
||||
pub use inventory;
|
||||
pub use io::{ByteStreamReader, ByteStreamWriter};
|
||||
pub use json::JsonValue;
|
||||
pub use logic_long::LogicLong;
|
||||
|
|
@ -28,7 +29,6 @@ pub use message::{Direction, Message, MessageMeta, Payload};
|
|||
pub use net::{
|
||||
Incoming, Messaging, MessagingConfig, MessagingError, MessagingSender, OutboundMessage,
|
||||
};
|
||||
pub use inventory;
|
||||
pub use titan_derive::{Message, Payload};
|
||||
pub mod prelude {
|
||||
pub use crate::codec::{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::any::Any;
|
||||
use std::fmt::Debug;
|
||||
use crate::error::Result;
|
||||
use crate::io::{ByteStreamReader, ByteStreamWriter};
|
||||
use std::any::Any;
|
||||
use std::fmt::Debug;
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum Direction {
|
||||
ClientToServer,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
use crate::crypto::{SessionCipher, StreamEncrypter};
|
||||
use crate::error::Error;
|
||||
use crate::factory::MessageFactory;
|
||||
use crate::frame::{FrameCodec, FrameHeader, MessageFrame, HEADER_LEN};
|
||||
use crate::io::ByteStreamWriter;
|
||||
use crate::message::Message;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
|
@ -6,12 +12,6 @@ use tokio::net::TcpStream;
|
|||
use tokio::sync::mpsc;
|
||||
use tokio::task::JoinHandle;
|
||||
use tokio::time::timeout;
|
||||
use crate::crypto::{SessionCipher, StreamEncrypter};
|
||||
use crate::error::Error;
|
||||
use crate::factory::MessageFactory;
|
||||
use crate::frame::{FrameCodec, FrameHeader, MessageFrame, HEADER_LEN};
|
||||
use crate::io::ByteStreamWriter;
|
||||
use crate::message::Message;
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum MessagingError {
|
||||
#[error("io: {0}")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue