use super::{dos_protection::DosPolicy, world_session::WorldSession};
use crate::game::GameTime;
use async_trait::async_trait;
use crossbeam::atomic::AtomicCell;
#[async_trait]
pub trait World: Sized + Sync + Send {
type WorldSessionimplementer: WorldSession<Self> + 'static + Send + Sync;
async fn on_start(_game_time: &'static AtomicCell<GameTime>) {}
fn game_time(&'static self) -> Option<&'static AtomicCell<GameTime>> {
None
}
fn update(&'static self, _diff: i64, _game_time: GameTime) {}
fn get_packet_limit(&self, _cmd: u16) -> (u16, u32, DosPolicy) {
(15, 10 * 1024, DosPolicy::Log)
}
fn global_limit(&self) -> (u16, u32) {
(50, 5000)
}
}