ServerState on_disconnect
This commit is contained in:
parent
704d6386f7
commit
272be2db74
@ -25,5 +25,6 @@ pub trait ServerState {
|
|||||||
fn on_connect(&mut self, id: ClientId) -> Vec<OnConnect<Self::SendPacket>>;
|
fn on_connect(&mut self, id: ClientId) -> Vec<OnConnect<Self::SendPacket>>;
|
||||||
fn handle(&mut self, id: ClientId, pkt: &Self::RecvPacket)
|
fn handle(&mut self, id: ClientId, pkt: &Self::RecvPacket)
|
||||||
-> Result<Box<dyn Iterator<Item = (ClientId, Self::SendPacket)>>, Self::PacketError>;
|
-> Result<Box<dyn Iterator<Item = (ClientId, Self::SendPacket)>>, Self::PacketError>;
|
||||||
|
fn on_disconnect(&mut self, id: ClientId) -> Vec<(ClientId, Self::SendPacket)>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,6 +454,10 @@ impl<EG: EntityGateway> ServerState for CharacterServerState<EG> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn on_disconnect(&mut self, id: ClientId) -> Vec<(ClientId, SendCharacterPacket)> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -131,6 +131,10 @@ impl<EG: EntityGateway> ServerState for LoginServerState<EG> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn on_disconnect(&mut self, id: ClientId) -> Vec<(ClientId, SendLoginPacket)> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -200,6 +200,10 @@ impl ServerState for PatchServerState {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn on_disconnect(&mut self, id: ClientId) -> Vec<(ClientId, SendPatchPacket)> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_patch_dir(basedir: &str, patchbase: &str, file_ids: &mut HashMap<u32, PatchFile>) -> PatchFileTree {
|
fn load_patch_dir(basedir: &str, patchbase: &str, file_ids: &mut HashMap<u32, PatchFile>) -> PatchFileTree {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use log::warn;
|
||||||
|
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
|
|
||||||
@ -427,4 +428,9 @@ impl<EG: EntityGateway> ServerState for ShipServerState<EG> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn on_disconnect(&mut self, id: ClientId) -> Vec<(ClientId, SendShipPacket)> {
|
||||||
|
warn!("disconnected!");
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user