2020-04-22 07:14:59 -06:00
|
|
|
use log::warn;
|
|
|
|
use libpso::packet::messages::*;
|
|
|
|
use crate::common::serverstate::ClientId;
|
2020-05-02 22:08:37 -03:00
|
|
|
use crate::ship::ship::{SendShipPacket, Rooms};
|
|
|
|
use crate::ship::location::{ClientLocation, RoomLobby};
|
2020-04-22 07:14:59 -06:00
|
|
|
|
|
|
|
pub fn request_exp(id: ClientId,
|
|
|
|
request_exp: &RequestExp,
|
|
|
|
client_location: &ClientLocation,
|
|
|
|
rooms: &Rooms)
|
|
|
|
-> Box<dyn Iterator<Item = (ClientId, SendShipPacket)> + Send> {
|
|
|
|
|
|
|
|
match client_location.get_area(id).unwrap() {
|
|
|
|
RoomLobby::Room(room) => {
|
|
|
|
let r = rooms[room.0].as_ref().unwrap();
|
2020-04-26 22:01:05 -06:00
|
|
|
warn!("killed a {:?}", r.maps.enemy_by_id(request_exp.enemy_id as usize).unwrap().monster);
|
2020-04-22 07:14:59 -06:00
|
|
|
},
|
|
|
|
_ => {}
|
|
|
|
};
|
|
|
|
Box::new(None.into_iter())
|
|
|
|
}
|