|
@ -41,41 +41,66 @@ pub type Rooms = [Option<room::RoomState>; MAX_ROOMS]; |
|
|
pub type Clients = HashMap<ClientId, ClientState>;
|
|
|
pub type Clients = HashMap<ClientId, ClientState>;
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug)]
|
|
|
#[derive(Error, Debug)]
|
|
|
#[error("shiperror {0:?}")]
|
|
|
|
|
|
pub enum ShipError {
|
|
|
pub enum ShipError {
|
|
|
|
|
|
#[error("client not found {0}")]
|
|
|
ClientNotFound(ClientId),
|
|
|
ClientNotFound(ClientId),
|
|
|
|
|
|
#[error("no character in slot {0} {1}")]
|
|
|
NoCharacterInSlot(ClientId, u32),
|
|
|
NoCharacterInSlot(ClientId, u32),
|
|
|
|
|
|
#[error("invalid slot {0} {1}")]
|
|
|
InvalidSlot(ClientId, u32),
|
|
|
InvalidSlot(ClientId, u32),
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("too many clients")]
|
|
|
TooManyClients,
|
|
|
TooManyClients,
|
|
|
|
|
|
#[error("client error location {0}")]
|
|
|
ClientLocationError(#[from] ClientLocationError),
|
|
|
ClientLocationError(#[from] ClientLocationError),
|
|
|
|
|
|
#[error("get neighbor error {0}")]
|
|
|
GetNeighborError(#[from] GetNeighborError),
|
|
|
GetNeighborError(#[from] GetNeighborError),
|
|
|
|
|
|
#[error("get clients error {0}")]
|
|
|
GetClientsError(#[from] GetClientsError),
|
|
|
GetClientsError(#[from] GetClientsError),
|
|
|
|
|
|
#[error("get area error {0}")]
|
|
|
GetAreaError(#[from] GetAreaError),
|
|
|
GetAreaError(#[from] GetAreaError),
|
|
|
|
|
|
#[error("maps error {0}")]
|
|
|
MapsError(#[from] MapsError),
|
|
|
MapsError(#[from] MapsError),
|
|
|
|
|
|
#[error("map area error {0}")]
|
|
|
MapAreaError(#[from] MapAreaError),
|
|
|
MapAreaError(#[from] MapAreaError),
|
|
|
|
|
|
#[error("invalid room {0}")]
|
|
|
InvalidRoom(u32),
|
|
|
InvalidRoom(u32),
|
|
|
|
|
|
#[error("monster already droppped item {0} {1}")]
|
|
|
MonsterAlreadyDroppedItem(ClientId, u16),
|
|
|
MonsterAlreadyDroppedItem(ClientId, u16),
|
|
|
|
|
|
#[error("slice error {0}")]
|
|
|
SliceError(#[from] std::array::TryFromSliceError),
|
|
|
SliceError(#[from] std::array::TryFromSliceError),
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("item error")]
|
|
|
ItemError, // TODO: refine this
|
|
|
ItemError, // TODO: refine this
|
|
|
|
|
|
#[error("pick up invalid item id {0}")]
|
|
|
PickUpInvalidItemId(u32),
|
|
|
PickUpInvalidItemId(u32),
|
|
|
|
|
|
#[error("drop invalid item id {0}")]
|
|
|
DropInvalidItemId(u32),
|
|
|
DropInvalidItemId(u32),
|
|
|
|
|
|
#[error("item state error {0}")]
|
|
|
ItemStateError(#[from] items::state::ItemStateError),
|
|
|
ItemStateError(#[from] items::state::ItemStateError),
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("item drop location not set")]
|
|
|
ItemDropLocationNotSet,
|
|
|
ItemDropLocationNotSet,
|
|
|
|
|
|
#[error("box already dropped item {0} {1}")]
|
|
|
BoxAlreadyDroppedItem(ClientId, u16),
|
|
|
BoxAlreadyDroppedItem(ClientId, u16),
|
|
|
|
|
|
#[error("invalid quest category {0}")]
|
|
|
InvalidQuestCategory(u32),
|
|
|
InvalidQuestCategory(u32),
|
|
|
|
|
|
#[error("invalid quest {0}")]
|
|
|
InvalidQuest(u32),
|
|
|
InvalidQuest(u32),
|
|
|
|
|
|
#[error("invalid quest filename {0}")]
|
|
|
InvalidQuestFilename(String),
|
|
|
InvalidQuestFilename(String),
|
|
|
|
|
|
#[error("io error {0}")]
|
|
|
IoError(#[from] std::io::Error),
|
|
|
IoError(#[from] std::io::Error),
|
|
|
|
|
|
#[error("not enough meseta {0} {1}")]
|
|
|
NotEnoughMeseta(ClientId, u32),
|
|
|
NotEnoughMeseta(ClientId, u32),
|
|
|
#[error("")]
|
|
|
|
|
|
|
|
|
#[error("shop error")]
|
|
|
ShopError,
|
|
|
ShopError,
|
|
|
|
|
|
#[error("gateway error {0}")]
|
|
|
GatewayError(#[from] GatewayError),
|
|
|
GatewayError(#[from] GatewayError),
|
|
|
|
|
|
#[error("unknown monster {0}")]
|
|
|
UnknownMonster(crate::ship::monster::MonsterType),
|
|
|
UnknownMonster(crate::ship::monster::MonsterType),
|
|
|
|
|
|
#[error("invalid ship {0}")]
|
|
|
InvalidShip(usize),
|
|
|
InvalidShip(usize),
|
|
|
|
|
|
#[error("invalid block {0}")]
|
|
|
InvalidBlock(usize),
|
|
|
InvalidBlock(usize),
|
|
|
|
|
|
#[error("invalid item {0}")]
|
|
|
InvalidItem(items::ClientItemId),
|
|
|
InvalidItem(items::ClientItemId),
|
|
|
#[error("trade error {0}")]
|
|
|
#[error("trade error {0}")]
|
|
|
TradeError(#[from] crate::ship::packet::handler::trade::TradeError),
|
|
|
TradeError(#[from] crate::ship::packet::handler::trade::TradeError),
|
|
|