|
|
@ -180,8 +180,9 @@ impl ServerState for PatchServerState { |
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
fn handle(&mut self, id: ClientId, pkt: &RecvPatchPacket) -> Box<dyn Iterator<Item = (ClientId, SendPatchPacket)>> {
|
|
|
|
match pkt {
|
|
|
|
fn handle(&mut self, id: ClientId, pkt: &RecvPatchPacket)
|
|
|
|
-> Result<Box<dyn Iterator<Item = (ClientId, SendPatchPacket)>>, PatchError> {
|
|
|
|
Ok(match pkt {
|
|
|
|
RecvPatchPacket::PatchWelcomeReply(_pkt) => {
|
|
|
|
Box::new(vec![SendPatchPacket::RequestLogin(RequestLogin {})].into_iter().map(move |pkt| (id, pkt)))
|
|
|
|
},
|
|
|
@ -208,7 +209,7 @@ impl ServerState for PatchServerState { |
|
|
|
];
|
|
|
|
Box::new(p.into_iter().chain(SendFileIterator::new(&self)).map(move |pkt| (id, pkt)))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|