From 7ab0088c26d58d591465f68aa41d5adf18b85c76 Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 13 Nov 2023 23:27:12 -0700 Subject: [PATCH] move ship server into its own crate --- Cargo.toml | 3 + ship_server/Cargo.toml | 32 ++++ .../handler => ship_server/src}/auth.rs | 3 +- {src/ship => ship_server/src}/chatcommand.rs | 2 +- .../src}/communication.rs | 4 +- .../src}/direct_message.rs | 2 +- src/ship/ship.rs => ship_server/src/lib.rs | 157 +++++++++--------- .../handler => ship_server/src}/lobby.rs | 3 +- .../handler => ship_server/src}/message.rs | 2 +- .../handler => ship_server/src}/quest.rs | 2 +- .../handler => ship_server/src}/room.rs | 2 +- .../handler => ship_server/src}/settings.rs | 2 +- .../handler => ship_server/src}/ship.rs | 2 +- .../handler => ship_server/src}/trade.rs | 2 +- src/bin/main.rs | 14 +- src/bin/ship.rs | 6 +- src/lib.rs | 15 -- src/ship/mod.rs | 4 - src/ship/packet/handler/mod.rs | 10 -- src/ship/packet/mod.rs | 2 - tests/common.rs | 2 +- tests/test_bank.rs | 2 +- tests/test_character.rs | 2 +- tests/test_exp_gain.rs | 2 +- tests/test_item_actions.rs | 2 +- tests/test_item_drop.rs | 2 +- tests/test_item_id.rs | 2 +- tests/test_item_pickup.rs | 2 +- tests/test_item_use.rs | 2 +- tests/test_mags.rs | 2 +- tests/test_rooms.rs | 2 +- tests/test_shops.rs | 2 +- tests/test_trade.rs | 4 +- 33 files changed, 155 insertions(+), 142 deletions(-) create mode 100644 ship_server/Cargo.toml rename {src/ship/packet/handler => ship_server/src}/auth.rs (96%) rename {src/ship => ship_server/src}/chatcommand.rs (98%) rename {src/ship/packet/handler => ship_server/src}/communication.rs (96%) rename {src/ship/packet/handler => ship_server/src}/direct_message.rs (99%) rename src/ship/ship.rs => ship_server/src/lib.rs (80%) rename {src/ship/packet/handler => ship_server/src}/lobby.rs (99%) rename {src/ship/packet/handler => ship_server/src}/message.rs (99%) rename {src/ship/packet/handler => ship_server/src}/quest.rs (99%) rename {src/ship/packet/handler => ship_server/src}/room.rs (99%) rename {src/ship/packet/handler => ship_server/src}/settings.rs (98%) rename {src/ship/packet/handler => ship_server/src}/ship.rs (95%) rename {src/ship/packet/handler => ship_server/src}/trade.rs (99%) delete mode 100644 src/lib.rs delete mode 100644 src/ship/mod.rs delete mode 100644 src/ship/packet/handler/mod.rs delete mode 100644 src/ship/packet/mod.rs diff --git a/Cargo.toml b/Cargo.toml index 19347e4..a514c54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ members = [ "trade", "patch_server", "login_server", + "ship_server", ] [workspace.dependencies] @@ -39,6 +40,7 @@ trade = { path = "./trade" } room = { path = "./room" } patch_server = { path = "./patch_server" } login_server = { path = "./login_server" } +ship_server = { path = "./ship_server" } libpso = { git = "http://git.sharnoth.com/jake/libpso" } @@ -86,6 +88,7 @@ trade = { workspace = true } room = { workspace = true } patch_server = { workspace = true } login_server = { workspace = true } +ship_server = { workspace = true } libpso = { workspace = true } diff --git a/ship_server/Cargo.toml b/ship_server/Cargo.toml new file mode 100644 index 0000000..604dda8 --- /dev/null +++ b/ship_server/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "ship_server" +version = "0.1.0" +edition = "2021" + +[dependencies] +networking = { workspace = true } +trade = { workspace = true } +maps = { workspace = true } +location = { workspace = true } +room = { workspace = true } +shops = { workspace = true } +client = { workspace = true } +pktbuilder = { workspace = true } +items = { workspace = true } +entity = { workspace = true } +drops = { workspace = true } +quests = { workspace = true } +stats = { workspace = true } + +login_server = { workspace = true } + +libpso = { workspace = true } + +async-std = { workspace = true } +async-trait = { workspace = true } +log = { workspace = true } +anyhow = { workspace = true } +thiserror = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +futures = { workspace = true } diff --git a/src/ship/packet/handler/auth.rs b/ship_server/src/auth.rs similarity index 96% rename from src/ship/packet/handler/auth.rs rename to ship_server/src/auth.rs index 891ae6e..b8f746e 100644 --- a/src/ship/packet/handler/auth.rs +++ b/ship_server/src/auth.rs @@ -1,7 +1,8 @@ use libpso::packet::login::{Login, LoginResponse, AccountStatus, Session}; use libpso::packet::ship::*; use networking::serverstate::ClientId; -use crate::ship::ship::{SendShipPacket, ShipError, ClientState, Clients}; +use crate::{SendShipPacket, ShipError}; +use client::{Clients, ClientState}; use login_server::login::get_login_status; use entity::gateway::EntityGateway; use items::state::ItemState; diff --git a/src/ship/chatcommand.rs b/ship_server/src/chatcommand.rs similarity index 98% rename from src/ship/chatcommand.rs rename to ship_server/src/chatcommand.rs index 7799e17..a2d3ff1 100644 --- a/src/ship/chatcommand.rs +++ b/ship_server/src/chatcommand.rs @@ -1,7 +1,7 @@ use libpso::packet::ship::PlayerChat; use entity::gateway::EntityGateway; use networking::serverstate::ClientId; -use crate::ship::ship::{ShipServerState, SendShipPacket}; +use crate::{ShipServerState, SendShipPacket}; use client::Clients; use items::state::ItemState; use entity::item::{BankName, BankIdentifier}; diff --git a/src/ship/packet/handler/communication.rs b/ship_server/src/communication.rs similarity index 96% rename from src/ship/packet/handler/communication.rs rename to ship_server/src/communication.rs index 3982efc..4949acd 100644 --- a/src/ship/packet/handler/communication.rs +++ b/ship_server/src/communication.rs @@ -1,7 +1,7 @@ use libpso::packet::ship::*; use networking::serverstate::ClientId; -use crate::ship::ship::{SendShipPacket, Clients}; -use location::{ClientLocation}; +use crate::{SendShipPacket, Clients}; +use location::ClientLocation; use entity::gateway::EntityGateway; use futures::future::join_all; diff --git a/src/ship/packet/handler/direct_message.rs b/ship_server/src/direct_message.rs similarity index 99% rename from src/ship/packet/handler/direct_message.rs rename to ship_server/src/direct_message.rs index c93ae0d..9ec6f52 100644 --- a/src/ship/packet/handler/direct_message.rs +++ b/ship_server/src/direct_message.rs @@ -6,7 +6,7 @@ use libpso::packet::ship::*; use libpso::packet::messages::*; use stats::leveltable::LEVEL_TABLE; use networking::serverstate::ClientId; -use crate::ship::ship::{SendShipPacket, ShipError, Clients}; +use crate::{SendShipPacket, ShipError, Clients}; use location::ClientLocation; use drops::ItemDrop; use room::Rooms; diff --git a/src/ship/ship.rs b/ship_server/src/lib.rs similarity index 80% rename from src/ship/ship.rs rename to ship_server/src/lib.rs index f9816c2..f6d0ed1 100644 --- a/src/ship/ship.rs +++ b/ship_server/src/lib.rs @@ -1,4 +1,16 @@ -#![allow(dead_code, unused_must_use)] +#![allow(clippy::type_complexity)] +mod auth; +mod communication; +mod direct_message; +mod lobby; +mod message; +mod room; +mod settings; +mod quest; +mod ship; +pub mod trade; +mod chatcommand; + use std::net::Ipv4Addr; use async_std::channel; @@ -22,18 +34,15 @@ use entity::character::SectionID; use entity::room::RoomNote; use location::{ClientLocation, RoomLobby, ClientLocationError, RoomId}; use drops::{DropTable, StandardDropTable}; -use items; -use room; +use ::room::{Rooms, RoomCreationError}; use maps::room::{RoomMode, Episode, Difficulty}; use quests::{load_standard_quests, load_government_quests}; use quests::{QuestList, QuestLoadError}; use maps::Holiday; use maps::area::MapAreaError; use maps::maps::{Maps, MapsError, generate_free_roam_maps}; -use crate::ship::packet::handler; use shops::{ItemShops, StandardItemShops}; -use trade::TradeState; -use crate::ship::chatcommand; +use ::trade::{TradeState, TradeStateError}; use pktbuilder::quest::{QUEST_CATEGORY_MENU_ID, QUEST_SELECT_MENU_ID}; pub use client::{Clients, ClientState}; @@ -98,13 +107,13 @@ pub enum ShipError { #[error("invalid item {0}")] InvalidItem(items::ClientItemId), #[error("trade error {0}")] - TradeError(#[from] crate::ship::packet::handler::trade::TradeError), + TradeError(#[from] trade::TradeError), #[error("trade state error {0}")] - TradeStateError(#[from] trade::TradeStateError), + TradeStateError(#[from] TradeStateError), #[error("message error {0}")] - MessageError(#[from] crate::ship::packet::handler::direct_message::MessageError), + MessageError(#[from] crate::direct_message::MessageError), #[error("room creation error {0}")] - RoomCreationError(#[from] room::RoomCreationError), + RoomCreationError(#[from] RoomCreationError), #[error("channel send error {0}")] SendError(#[from] async_std::channel::SendError), } @@ -432,7 +441,7 @@ impl ShipServerStateBuilder { #[derive(Clone, Default)] pub struct Block { client_location: ClientLocation, - pub rooms: room::Rooms, + pub rooms: Rooms, } #[derive(Clone)] @@ -481,58 +490,58 @@ impl ShipServerState { Ok(match msg.msg { GameMessage::RequestExp(request_exp) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::request_exp(id, request_exp, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms).await? + message::request_exp(id, request_exp, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms).await? }, GameMessage::PlayerDropItem(player_drop_item) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::player_drop_item(id, player_drop_item, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms, &mut self.item_state).await? + message::player_drop_item(id, player_drop_item, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms, &mut self.item_state).await? }, GameMessage::DropCoordinates(drop_coordinates) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::drop_coordinates(id, drop_coordinates, &block.client_location, &self.clients, &block.rooms).await? + message::drop_coordinates(id, drop_coordinates, &block.client_location, &self.clients, &block.rooms).await? }, GameMessage::PlayerNoLongerHasItem(no_longer_has_item) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::no_longer_has_item(id, no_longer_has_item, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + message::no_longer_has_item(id, no_longer_has_item, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::PlayerChangedMap(_) | GameMessage::PlayerChangedMap2(_) | GameMessage::TellOtherPlayerMyLocation(_) | GameMessage::PlayerWarpingToFloor(_) | GameMessage::PlayerTeleported(_) | GameMessage::PlayerStopped(_) | GameMessage::PlayerLoadedIn(_) | GameMessage::PlayerWalking(_) | GameMessage::PlayerRunning(_) | GameMessage::PlayerWarped(_) | GameMessage::PlayerChangedFloor(_) | GameMessage::InitializeSpeechNpc(_) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::update_player_position(id, msg, &self.clients, &block.client_location, &block.rooms).await? + message::update_player_position(id, msg, &self.clients, &block.client_location, &block.rooms).await? }, GameMessage::ChargeAttack(charge_attack) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::charge_attack(id, charge_attack, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + message::charge_attack(id, charge_attack, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::PlayerUseItem(player_use_item) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::player_uses_item(id, player_use_item, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + message::player_uses_item(id, player_use_item, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::PlayerUsedMedicalCenter(player_used_medical_center) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::player_used_medical_center(id, player_used_medical_center, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + message::player_used_medical_center(id, player_used_medical_center, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::PlayerFeedMag(player_feed_mag) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::player_feed_mag(id, player_feed_mag, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + message::player_feed_mag(id, player_feed_mag, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::PlayerEquipItem(player_equip_item) => { - handler::message::player_equips_item(id, player_equip_item, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? + message::player_equips_item(id, player_equip_item, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? }, GameMessage::PlayerUnequipItem(player_unequip_item) => { - handler::message::player_unequips_item(id, player_unequip_item, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? + message::player_unequips_item(id, player_unequip_item, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? }, GameMessage::SortItems(sort_items) => { - handler::message::player_sorts_items(id, sort_items, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? + message::player_sorts_items(id, sort_items, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? }, GameMessage::PlayerSoldItem(player_sold_item) => { - handler::message::player_sells_item(id, player_sold_item, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? + message::player_sells_item(id, player_sold_item, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? }, GameMessage::FloorItemLimitItemDeletion(floor_item_limit_delete) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::message::floor_item_limit_deletion(id, floor_item_limit_delete, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms, &mut self.item_state).await? + message::floor_item_limit_deletion(id, floor_item_limit_delete, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms, &mut self.item_state).await? }, _ => { let cmsg = msg.clone(); @@ -551,37 +560,37 @@ impl ShipServerState { let block = self.blocks.get_from_client(id, &self.clients).await?; Ok(match msg.msg { GameMessage::GuildcardSend(guildcard_send) => { - handler::direct_message::guildcard_send(id, guildcard_send, target, &block.client_location, &self.clients).await? + direct_message::guildcard_send(id, guildcard_send, target, &block.client_location, &self.clients).await? }, GameMessage::RequestItem(request_item) => { - handler::direct_message::request_item(id, request_item, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms, &mut self.item_state).await? + direct_message::request_item(id, request_item, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms, &mut self.item_state).await? }, GameMessage::PickupItem(pickup_item) => { - handler::direct_message::pickup_item(id, pickup_item, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + direct_message::pickup_item(id, pickup_item, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::BoxDropRequest(box_drop_request) => { - handler::direct_message::request_box_item(id, box_drop_request, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms, &mut self.item_state).await? + direct_message::request_box_item(id, box_drop_request, &mut self.entity_gateway, &block.client_location, &self.clients, &block.rooms, &mut self.item_state).await? }, GameMessage::BankRequest(_bank_request) => { - handler::direct_message::send_bank_list(id, &self.clients, &mut self.item_state).await? + direct_message::send_bank_list(id, &self.clients, &mut self.item_state).await? }, GameMessage::BankInteraction(bank_interaction) => { - handler::direct_message::bank_interaction(id, bank_interaction, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + direct_message::bank_interaction(id, bank_interaction, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::ShopRequest(shop_request) => { - handler::direct_message::shop_request(id, shop_request, &block.client_location, &self.clients, &block.rooms, &self.shops).await? + direct_message::shop_request(id, shop_request, &block.client_location, &self.clients, &block.rooms, &self.shops).await? }, GameMessage::BuyItem(buy_item) => { - handler::direct_message::buy_item(id, buy_item, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + direct_message::buy_item(id, buy_item, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::TekRequest(tek_request) => { - handler::direct_message::request_tek_item(id, tek_request, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? + direct_message::request_tek_item(id, tek_request, &mut self.entity_gateway, &self.clients, &mut self.item_state).await? }, GameMessage::TekAccept(tek_accept) => { - handler::direct_message::accept_tek_item(id, tek_accept, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? + direct_message::accept_tek_item(id, tek_accept, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state).await? }, GameMessage::TradeRequest(trade_request) => { - handler::trade::trade_request(id, trade_request, target, &block.client_location, &self.clients, &mut self.item_state, &mut self.trades).await? + trade::trade_request(id, trade_request, target, &block.client_location, &self.clients, &mut self.item_state, &mut self.trades).await? }, _ => { let cmsg = msg.clone(); @@ -627,7 +636,7 @@ impl ServerState for ShipServerState { Ok(match pkt { RecvShipPacket::Login(login) => { - handler::auth::validate_login(id, login, &mut self.entity_gateway, &mut self.clients, &mut self.item_state, &self.shipgate_sender, &self.name, self.blocks.0.len()) + auth::validate_login(id, login, &mut self.entity_gateway, &mut self.clients, &mut self.item_state, &self.shipgate_sender, &self.name, self.blocks.0.len()) .await? .into_iter() .map(move |pkt| (id, pkt)) @@ -636,7 +645,7 @@ impl ServerState for ShipServerState { RecvShipPacket::QuestDetailRequest(questdetailrequest) => { let block = self.blocks.get_from_client(id, &self.clients).await?; match questdetailrequest.menu { - QUEST_SELECT_MENU_ID => handler::quest::quest_detail(id, questdetailrequest, &block.client_location, &block.rooms).await?, + QUEST_SELECT_MENU_ID => quest::quest_detail(id, questdetailrequest, &block.client_location, &block.rooms).await?, _ => unreachable!(), } }, @@ -644,27 +653,27 @@ impl ServerState for ShipServerState { let block = self.blocks.get_from_client(id, &self.clients).await?; match menuselect.menu { SHIP_MENU_ID => { - let leave_lobby = handler::lobby::remove_from_lobby(id, &mut block.client_location).await.into_iter().flatten(); - let select_ship = handler::ship::selected_ship(id, menuselect, &self.ship_list).await?; + let leave_lobby = lobby::remove_from_lobby(id, &mut block.client_location).await.into_iter().flatten(); + let select_ship = ship::selected_ship(id, menuselect, &self.ship_list).await?; leave_lobby.chain(select_ship).collect() } BLOCK_MENU_ID => { - let leave_lobby = handler::lobby::remove_from_lobby(id, &mut block.client_location).await.into_iter().flatten(); - let select_block = handler::lobby::block_selected(id, menuselect, &self.clients, &self.item_state).await?.into_iter(); + let leave_lobby = lobby::remove_from_lobby(id, &mut block.client_location).await.into_iter().flatten(); + let select_block = lobby::block_selected(id, menuselect, &self.clients, &self.item_state).await?.into_iter(); leave_lobby.chain(select_block).collect() } - ROOM_MENU_ID => handler::room::join_room(id, menuselect, &mut self.entity_gateway, &mut block.client_location, &self.clients, &mut self.item_state, &block.rooms, self.event).await?, - QUEST_CATEGORY_MENU_ID => handler::quest::select_quest_category(id, menuselect, &block.client_location, &block.rooms).await?, + ROOM_MENU_ID => room::join_room(id, menuselect, &mut self.entity_gateway, &mut block.client_location, &self.clients, &mut self.item_state, &block.rooms, self.event).await?, + QUEST_CATEGORY_MENU_ID => quest::select_quest_category(id, menuselect, &block.client_location, &block.rooms).await?, _ => unreachable!(), } }, RecvShipPacket::QuestMenuSelect(questmenuselect) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::quest::player_chose_quest(id, questmenuselect, &self.clients, &block.client_location, &block.rooms, self.event).await? + quest::player_chose_quest(id, questmenuselect, &self.clients, &block.client_location, &block.rooms, self.event).await? }, RecvShipPacket::MenuDetail(menudetail) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::lobby::get_room_tab_info(id, menudetail, &mut block.client_location, &self.clients).await? + lobby::get_room_tab_info(id, menudetail, &mut block.client_location, &self.clients).await? }, RecvShipPacket::RoomPasswordReq(room_password_req) => { let block = self.blocks.get_from_client(id, &self.clients).await?; @@ -678,7 +687,7 @@ impl ServerState for ShipServerState { menu: room_password_req.menu, item: room_password_req.item, }; - handler::room::join_room(id, menuselect, &mut self.entity_gateway, &mut block.client_location, &self.clients, &mut self.item_state, &block.rooms, self.event).await? + room::join_room(id, menuselect, &mut self.entity_gateway, &mut block.client_location, &self.clients, &mut self.item_state, &block.rooms, self.event).await? } else { vec![(id, SendShipPacket::SmallDialog(SmallDialog::new("Incorrect password".into())))] @@ -686,7 +695,7 @@ impl ServerState for ShipServerState { }, RecvShipPacket::CharData(chardata) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::lobby::send_player_to_lobby(id, chardata, &mut block.client_location, &self.clients, &self.item_state, self.event).await? + lobby::send_player_to_lobby(id, chardata, &mut block.client_location, &self.clients, &self.item_state, self.event).await? }, RecvShipPacket::Message(msg) => { self.message(id, msg).await? @@ -704,40 +713,40 @@ impl ServerState for ShipServerState { }, None => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::communication::player_chat(id, msg, &block.client_location, &self.clients).await? + communication::player_chat(id, msg, &block.client_location, &self.clients).await? } } }, RecvShipPacket::CreateRoom(create_room) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::room::create_room(id, create_room, &mut self.entity_gateway, &mut block.client_location, &self.clients, &mut self.item_state, + room::create_room(id, create_room, &mut self.entity_gateway, &mut block.client_location, &self.clients, &mut self.item_state, &block.rooms, self.map_builder.clone(), self.drop_table_builder.clone(), self.standard_quest_builder.clone(), self.government_quest_builder.clone(), self.event).await? }, RecvShipPacket::RoomNameRequest(_req) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::room::room_name_request(id, &block.client_location, &block.rooms).await? + room::room_name_request(id, &block.client_location, &block.rooms).await? }, RecvShipPacket::UpdateTechMenu(pkt) => { - handler::settings::update_tech_menu(id, pkt, &self.clients, &mut self.entity_gateway).await? + settings::update_tech_menu(id, pkt, &self.clients, &mut self.entity_gateway).await? }, RecvShipPacket::UpdateConfig(pkt) => { - handler::settings::update_config(id, pkt, &self.clients, &mut self.entity_gateway).await? + settings::update_config(id, pkt, &self.clients, &mut self.entity_gateway).await? }, RecvShipPacket::ViewInfoboardRequest(_pkt) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::communication::request_infoboard(id, &block.client_location, &self.clients).await? + communication::request_infoboard(id, &block.client_location, &self.clients).await? }, RecvShipPacket::WriteInfoboard(pkt) => { - handler::communication::write_infoboard(id, pkt, &self.clients, &mut self.entity_gateway).await? + communication::write_infoboard(id, pkt, &self.clients, &mut self.entity_gateway).await? }, RecvShipPacket::RoomListRequest(_req) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::room::request_room_list(id, &block.client_location, &block.rooms).await + room::request_room_list(id, &block.client_location, &block.rooms).await }, RecvShipPacket::Like62ButCooler(cool62) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::room::cool_62(id, cool62, &block.client_location).await? + room::cool_62(id, cool62, &block.client_location).await? }, RecvShipPacket::ClientCharacterData(_) => { // TOOD: validate this in some way? @@ -745,57 +754,57 @@ impl ServerState for ShipServerState { }, RecvShipPacket::DoneBursting(_) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::room::done_bursting(id, &block.client_location, &block.rooms).await? + room::done_bursting(id, &block.client_location, &block.rooms).await? }, RecvShipPacket::DoneBursting2(_) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::room::done_bursting(id, &block.client_location, &block.rooms).await? + room::done_bursting(id, &block.client_location, &block.rooms).await? }, RecvShipPacket::LobbySelect(pkt) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::lobby::change_lobby(id, pkt.lobby, &mut block.client_location, &self.clients, &mut self.item_state, &block.rooms, &mut self.entity_gateway, self.event).await? + lobby::change_lobby(id, pkt.lobby, &mut block.client_location, &self.clients, &mut self.item_state, &block.rooms, &mut self.entity_gateway, self.event).await? }, RecvShipPacket::RequestQuestList(rql) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::quest::send_quest_category_list(id, rql, &block.client_location, &block.rooms).await? + quest::send_quest_category_list(id, rql, &block.client_location, &block.rooms).await? }, RecvShipPacket::QuestFileRequest(quest_file_request) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::quest::quest_file_request(id, quest_file_request, &block.client_location, &mut block.rooms).await? + quest::quest_file_request(id, quest_file_request, &block.client_location, &mut block.rooms).await? }, RecvShipPacket::QuestChunkAck(quest_chunk_ack) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::quest::quest_chunk_ack(id, quest_chunk_ack, &block.client_location, &block.rooms).await? + quest::quest_chunk_ack(id, quest_chunk_ack, &block.client_location, &block.rooms).await? }, RecvShipPacket::DoneLoadingQuest(_) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::quest::done_loading_quest(id, &self.clients, &block.client_location).await? + quest::done_loading_quest(id, &self.clients, &block.client_location).await? }, RecvShipPacket::FullCharacterData(_full_character_data) => { Vec::new() }, RecvShipPacket::SaveOptions(save_options) => { - handler::settings::save_options(id, save_options, &self.clients, &mut self.entity_gateway).await? + settings::save_options(id, save_options, &self.clients, &mut self.entity_gateway).await? }, RecvShipPacket::RequestShipList(_) => { - handler::ship::ship_list(id, &self.ship_list).await + ship::ship_list(id, &self.ship_list).await }, RecvShipPacket::RequestShipBlockList(_) => { - handler::ship::block_list(id, &self.name, self.blocks.0.len()) + ship::block_list(id, &self.name, self.blocks.0.len()) }, RecvShipPacket::ItemsToTrade(items_to_trade) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::trade::items_to_trade(id, items_to_trade, &block.client_location, &self.clients, &mut self.item_state, &mut self.trades).await? + trade::items_to_trade(id, items_to_trade, &block.client_location, &self.clients, &mut self.item_state, &mut self.trades).await? }, RecvShipPacket::TradeConfirmed(_) => { let block = self.blocks.get_from_client(id, &self.clients).await?; - handler::trade::trade_confirmed(id, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state, &mut self.trades).await? + trade::trade_confirmed(id, &mut self.entity_gateway, &block.client_location, &self.clients, &mut self.item_state, &mut self.trades).await? }, RecvShipPacket::KeyboardConfig(keyboard_config) => { - handler::settings::keyboard_config(id, keyboard_config, &self.clients, &mut self.entity_gateway).await? + settings::keyboard_config(id, keyboard_config, &self.clients, &mut self.entity_gateway).await? }, RecvShipPacket::GamepadConfig(gamepad_config) => { - handler::settings::gamepad_config(id, gamepad_config, &self.clients, &mut self.entity_gateway).await? + settings::gamepad_config(id, gamepad_config, &self.clients, &mut self.entity_gateway).await? }, }) } @@ -816,7 +825,7 @@ impl ServerState for ShipServerState { entity_gateway.add_room_note(room.room_id, RoomNote::PlayerJoin { character_id, }).await - })}).await; + })}).await??; if neighbors.is_empty() { block.rooms.remove(room).await; } @@ -831,9 +840,9 @@ impl ServerState for ShipServerState { if let Some(mut client) = self.clients.remove(&id).await { client.user.at_ship = false; - self.entity_gateway.save_user(&client.user).await; + self.entity_gateway.save_user(&client.user).await?; if let Some(shipgate_sender) = self.shipgate_sender.as_ref() { - shipgate_sender.send(ShipMessage::RemoveUser(client.user.id)).await; + shipgate_sender.send(ShipMessage::RemoveUser(client.user.id)).await?; } self.item_state.remove_character_from_room(&client.character).await } diff --git a/src/ship/packet/handler/lobby.rs b/ship_server/src/lobby.rs similarity index 99% rename from src/ship/packet/handler/lobby.rs rename to ship_server/src/lobby.rs index 3033091..8e6090a 100644 --- a/src/ship/packet/handler/lobby.rs +++ b/ship_server/src/lobby.rs @@ -1,13 +1,12 @@ use libpso::packet::ship::*; use networking::serverstate::ClientId; use stats::leveltable::LEVEL_TABLE; -use crate::ship::ship::{SendShipPacket, ShipError}; +use crate::{SendShipPacket, ShipError}; use maps::Holiday; use client::Clients; use room::Rooms; use pktbuilder::character::FullCharacterBytesBuilder; use location::{ClientLocation, LobbyId, RoomLobby, ClientLocationError, RoomId}; -//use pktbuilder; use items::state::ItemState; use entity::gateway::EntityGateway; use entity::room::RoomNote; diff --git a/src/ship/packet/handler/message.rs b/ship_server/src/message.rs similarity index 99% rename from src/ship/packet/handler/message.rs rename to ship_server/src/message.rs index ca731c9..31a6541 100644 --- a/src/ship/packet/handler/message.rs +++ b/ship_server/src/message.rs @@ -4,7 +4,7 @@ use entity::gateway::EntityGateway; use entity::item::Meseta; use networking::serverstate::ClientId; use stats::leveltable::LEVEL_TABLE; -use crate::ship::ship::{SendShipPacket, ShipError}; +use crate::{SendShipPacket, ShipError}; use client::{Clients, ItemDropLocation}; use ::room::Rooms; use location::{ClientLocation, ClientLocationError}; diff --git a/src/ship/packet/handler/quest.rs b/ship_server/src/quest.rs similarity index 99% rename from src/ship/packet/handler/quest.rs rename to ship_server/src/quest.rs index 6193530..b40c718 100644 --- a/src/ship/packet/handler/quest.rs +++ b/ship_server/src/quest.rs @@ -2,7 +2,7 @@ use std::io::{Cursor, Read, Seek, SeekFrom}; use futures::stream::{FuturesOrdered, StreamExt}; use libpso::packet::ship::*; use networking::serverstate::ClientId; -use crate::ship::ship::{SendShipPacket, ShipError}; +use crate::{SendShipPacket, ShipError}; use client::Clients; use maps::Holiday; use room::Rooms; diff --git a/src/ship/packet/handler/room.rs b/ship_server/src/room.rs similarity index 99% rename from src/ship/packet/handler/room.rs rename to ship_server/src/room.rs index 563385d..254fdd0 100644 --- a/src/ship/packet/handler/room.rs +++ b/ship_server/src/room.rs @@ -11,7 +11,7 @@ use entity::gateway::EntityGateway; use entity::character::SectionID; use entity::room::{NewRoomEntity, RoomEntityMode, RoomNote}; use drops::DropTable; -use crate::ship::ship::SendShipPacket; +use crate::SendShipPacket; use client::Clients; use room::{Rooms, RoomState, RoomCreationError}; use maps::Holiday; diff --git a/src/ship/packet/handler/settings.rs b/ship_server/src/settings.rs similarity index 98% rename from src/ship/packet/handler/settings.rs rename to ship_server/src/settings.rs index 4bd665d..b21491b 100644 --- a/src/ship/packet/handler/settings.rs +++ b/ship_server/src/settings.rs @@ -1,6 +1,6 @@ use libpso::packet::ship::*; use networking::serverstate::ClientId; -use crate::ship::ship::{SendShipPacket, Clients}; +use crate::{SendShipPacket, Clients}; use entity::gateway::EntityGateway; pub async fn update_config(id: ClientId, diff --git a/src/ship/packet/handler/ship.rs b/ship_server/src/ship.rs similarity index 95% rename from src/ship/packet/handler/ship.rs rename to ship_server/src/ship.rs index 762e73f..a006004 100644 --- a/src/ship/packet/handler/ship.rs +++ b/ship_server/src/ship.rs @@ -3,7 +3,7 @@ use libpso::packet::ship::*; use libpso::packet::login::RedirectClient; use networking::serverstate::ClientId; use networking::interserver::Ship; -use crate::ship::ship::{SendShipPacket, ShipError}; +use crate::{SendShipPacket, ShipError}; use pktbuilder as builder; pub async fn ship_list(id: ClientId, ship_list: &Arc>>) -> Vec<(ClientId, SendShipPacket)> { diff --git a/src/ship/packet/handler/trade.rs b/ship_server/src/trade.rs similarity index 99% rename from src/ship/packet/handler/trade.rs rename to ship_server/src/trade.rs index 8da8f38..b57b218 100644 --- a/src/ship/packet/handler/trade.rs +++ b/ship_server/src/trade.rs @@ -2,7 +2,7 @@ use std::convert::TryInto; use libpso::packet::ship::*; use libpso::packet::messages::*; use networking::serverstate::ClientId; -use crate::ship::ship::{SendShipPacket, ShipError, Clients}; +use crate::{SendShipPacket, ShipError, Clients}; use location::{ClientLocation}; use items::ClientItemId; use items::state::{ItemState, ItemStateError}; diff --git a/src/bin/main.rs b/src/bin/main.rs index e12ad1b..ec67554 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -5,7 +5,7 @@ use networking::interserver::AuthToken; use login_server::login::LoginServerState; use login_server::character::CharacterServerState; use patch_server::{PatchServerState, generate_patch_tree, load_config, load_motd}; -use elseware::ship::ship::ShipServerStateBuilder; +use ship_server::ShipServerStateBuilder; use maps::Holiday; use entity::gateway::{EntityGateway, InMemoryGateway}; @@ -363,13 +363,13 @@ fn main() { let ship_state = ShipServerStateBuilder::default() .name("US/Sona-Nyl".into()) .ip(Ipv4Addr::new(127,0,0,1)) - .port(elseware::ship::ship::SHIP_PORT) + .port(ship_server::SHIP_PORT) .event(Holiday::Halloween) .gateway(entity_gateway.clone()) .build(); let sub_ship_state = ship_state.clone(); let ship_loop1 = async_std::task::spawn(async move { - networking::mainloop::run_server(sub_ship_state, elseware::ship::ship::SHIP_PORT).await; + networking::mainloop::run_server(sub_ship_state, ship_server::SHIP_PORT).await; }); let sub_ship_state = ship_state.clone(); let inter_ship_loop1 = async_std::task::spawn(async move { @@ -379,13 +379,13 @@ fn main() { let ship_state = ShipServerStateBuilder::default() .name("EU/Dylath-Leen".into()) .ip(Ipv4Addr::new(127,0,0,1)) - .port(elseware::ship::ship::SHIP_PORT+2000) + .port(ship_server::SHIP_PORT+2000) .event(Holiday::Christmas) .gateway(entity_gateway.clone()) .build(); let sub_ship_state = ship_state.clone(); let ship_loop2 = async_std::task::spawn(async move { - networking::mainloop::run_server(sub_ship_state, elseware::ship::ship::SHIP_PORT+2000).await; + networking::mainloop::run_server(sub_ship_state, ship_server::SHIP_PORT+2000).await; }); let sub_ship_state = ship_state.clone(); let inter_ship_loop2 = async_std::task::spawn(async move { @@ -395,12 +395,12 @@ fn main() { let ship_state = ShipServerStateBuilder::default() .name("JP/Thalarion".into()) .ip(Ipv4Addr::new(127,0,0,1)) - .port(elseware::ship::ship::SHIP_PORT+3000) + .port(ship_server::SHIP_PORT+3000) .gateway(entity_gateway.clone()) .build(); let sub_ship_state = ship_state.clone(); let ship_loop3 = async_std::task::spawn(async move { - networking::mainloop::run_server(sub_ship_state, elseware::ship::ship::SHIP_PORT+3000).await; + networking::mainloop::run_server(sub_ship_state, ship_server::SHIP_PORT+3000).await; }); let sub_ship_state = ship_state.clone(); let inter_ship_loop3 = async_std::task::spawn(async move { diff --git a/src/bin/ship.rs b/src/bin/ship.rs index cfa50ed..b664bda 100644 --- a/src/bin/ship.rs +++ b/src/bin/ship.rs @@ -1,6 +1,6 @@ use log::info; use entity::gateway::postgres::PostgresGateway; -use elseware::ship::ship::ShipServerStateBuilder; +use ship_server::ShipServerStateBuilder; use networking::interserver::AuthToken; fn main() { @@ -40,7 +40,7 @@ fn main() { let ship_state = ShipServerStateBuilder::default() .name(ship_name) .ip(ip) - .port(elseware::ship::ship::SHIP_PORT) + .port(ship_server::SHIP_PORT) .gateway(entity_gateway) .auth_token(AuthToken(shipgate_token)) .build(); @@ -49,7 +49,7 @@ fn main() { let sub_ship_state = ship_state.clone(); let ship_loop = async_std::task::spawn(async move { - networking::mainloop::run_server(sub_ship_state, elseware::ship::ship::SHIP_PORT).await; + networking::mainloop::run_server(sub_ship_state, ship_server::SHIP_PORT).await; }); let inter_ship_loop = async_std::task::spawn(async move { networking::mainloop::run_interserver_connect(ship_state, shipgate_ip, login_server::login::COMMUNICATION_PORT).await; diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 3b52841..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![allow(clippy::type_complexity)] -#![allow(incomplete_features)] -#![feature(inline_const)] -#![feature(extract_if)] -#![feature(try_blocks)] -#![feature(test)] -#![feature(error_generic_member_access)] - -extern crate test; - -//pub mod common; -//pub mod entity; -//pub mod patch; -//pub mod login; -pub mod ship; diff --git a/src/ship/mod.rs b/src/ship/mod.rs deleted file mode 100644 index cf2a804..0000000 --- a/src/ship/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[allow(clippy::module_inception)] -pub mod ship; -pub mod packet; -pub mod chatcommand; diff --git a/src/ship/packet/handler/mod.rs b/src/ship/packet/handler/mod.rs deleted file mode 100644 index c921d28..0000000 --- a/src/ship/packet/handler/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub mod auth; -pub mod communication; -pub mod direct_message; -pub mod lobby; -pub mod message; -pub mod room; -pub mod settings; -pub mod quest; -pub mod ship; -pub mod trade; diff --git a/src/ship/packet/mod.rs b/src/ship/packet/mod.rs deleted file mode 100644 index 9b5f908..0000000 --- a/src/ship/packet/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -//pub mod builder; -pub mod handler; diff --git a/tests/common.rs b/tests/common.rs index eb21187..ebab507 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -5,7 +5,7 @@ use entity::gateway::EntityGateway; use entity::account::{UserAccountEntity, NewUserAccountEntity, NewUserSettingsEntity}; use entity::character::{CharacterEntity, NewCharacterEntity, SectionID}; use entity::item::{Meseta, BankIdentifier}; -use elseware::ship::ship::{ShipServerState, ShipServerStateBuilder, RecvShipPacket}; +use ship_server::{ShipServerState, ShipServerStateBuilder, RecvShipPacket}; use maps::room::{RoomMode, Difficulty, Episode}; use maps::area::MapArea; use maps::maps::null_free_roam_maps; diff --git a/tests/test_bank.rs b/tests/test_bank.rs index 9211f97..7f825af 100644 --- a/tests/test_bank.rs +++ b/tests/test_bank.rs @@ -2,7 +2,7 @@ use std::collections::BTreeSet; use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; use entity::item; -use elseware::ship::ship::{RecvShipPacket, SendShipPacket}; +use ship_server::{RecvShipPacket, SendShipPacket}; use shops::StandardItemShops; use libpso::packet::ship::*; diff --git a/tests/test_character.rs b/tests/test_character.rs index 3a9cc64..237ded9 100644 --- a/tests/test_character.rs +++ b/tests/test_character.rs @@ -1,6 +1,6 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; -use elseware::ship::ship::RecvShipPacket; +use ship_server::RecvShipPacket; use libpso::character::settings::{DEFAULT_KEYBOARD_CONFIG1, DEFAULT_KEYBOARD_CONFIG4}; use libpso::packet::ship::*; diff --git a/tests/test_exp_gain.rs b/tests/test_exp_gain.rs index da30c8a..db71ec9 100644 --- a/tests/test_exp_gain.rs +++ b/tests/test_exp_gain.rs @@ -1,7 +1,7 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; use stats::leveltable::CharacterLevelTable; -use elseware::ship::ship::{SendShipPacket, RecvShipPacket}; +use ship_server::{SendShipPacket, RecvShipPacket}; use maps::variant::{MapVariant, MapVariantMode}; use maps::maps::Maps; use maps::area::MapArea; diff --git a/tests/test_item_actions.rs b/tests/test_item_actions.rs index beef459..1237063 100644 --- a/tests/test_item_actions.rs +++ b/tests/test_item_actions.rs @@ -1,6 +1,6 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; -use elseware::ship::ship::RecvShipPacket; +use ship_server::RecvShipPacket; use entity::item; use libpso::packet::ship::*; diff --git a/tests/test_item_drop.rs b/tests/test_item_drop.rs index bcf4165..91f179b 100644 --- a/tests/test_item_drop.rs +++ b/tests/test_item_drop.rs @@ -1,6 +1,6 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::InMemoryGateway; -use elseware::ship::ship::{SendShipPacket, RecvShipPacket}; +use ship_server::{SendShipPacket, RecvShipPacket}; use maps::monster::MonsterType; use drops::{StandardDropTable, MonsterDropStats, MonsterDropType}; use drops::rare_drop_table::{RareDropTable, RareDropRate, RareDropItem}; diff --git a/tests/test_item_id.rs b/tests/test_item_id.rs index 01ec5d2..3302806 100644 --- a/tests/test_item_id.rs +++ b/tests/test_item_id.rs @@ -1,7 +1,7 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; use entity::item; -use elseware::ship::ship::RecvShipPacket; +use ship_server::RecvShipPacket; use libpso::packet::ship::*; use libpso::packet::messages::*; diff --git a/tests/test_item_pickup.rs b/tests/test_item_pickup.rs index 82dd777..ccef78a 100644 --- a/tests/test_item_pickup.rs +++ b/tests/test_item_pickup.rs @@ -1,7 +1,7 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; use entity::item; -use elseware::ship::ship::RecvShipPacket; +use ship_server::RecvShipPacket; use libpso::packet::ship::*; use libpso::packet::messages::*; diff --git a/tests/test_item_use.rs b/tests/test_item_use.rs index d4117f7..274a344 100644 --- a/tests/test_item_use.rs +++ b/tests/test_item_use.rs @@ -1,7 +1,7 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; use entity::item; -use elseware::ship::ship::RecvShipPacket; +use ship_server::RecvShipPacket; use entity::character::TechLevel; use libpso::packet::ship::*; diff --git a/tests/test_mags.rs b/tests/test_mags.rs index d55a269..8ffc6a9 100644 --- a/tests/test_mags.rs +++ b/tests/test_mags.rs @@ -1,7 +1,7 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; use entity::item; -use elseware::ship::ship::RecvShipPacket; +use ship_server::RecvShipPacket; use entity::character::{CharacterClass, SectionID}; use libpso::packet::ship::*; diff --git a/tests/test_rooms.rs b/tests/test_rooms.rs index 3d073e4..5e65574 100644 --- a/tests/test_rooms.rs +++ b/tests/test_rooms.rs @@ -1,6 +1,6 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; -use elseware::ship::ship::{RecvShipPacket, SendShipPacket}; +use ship_server::{RecvShipPacket, SendShipPacket}; use libpso::packet::ship::*; //use libpso::packet::messages::*; diff --git a/tests/test_shops.rs b/tests/test_shops.rs index 3e2dc02..59540b7 100644 --- a/tests/test_shops.rs +++ b/tests/test_shops.rs @@ -1,7 +1,7 @@ use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; use entity::item; -use elseware::ship::ship::{RecvShipPacket, SendShipPacket}; +use ship_server::{RecvShipPacket, SendShipPacket}; use maps::room::Difficulty; use items::state::ItemStateError; use shops::StandardItemShops; diff --git a/tests/test_trade.rs b/tests/test_trade.rs index 93f1463..8266892 100644 --- a/tests/test_trade.rs +++ b/tests/test_trade.rs @@ -2,9 +2,9 @@ use std::convert::TryInto; use networking::serverstate::{ClientId, ServerState}; use entity::gateway::{EntityGateway, InMemoryGateway}; use entity::item; -use elseware::ship::ship::{ShipServerState, RecvShipPacket, SendShipPacket}; +use ship_server::{ShipServerState, RecvShipPacket, SendShipPacket}; use entity::item::{Meseta, ItemEntity, InventoryItemEntity}; -use elseware::ship::packet::handler::trade::TradeError; +use ship_server::trade::TradeError; use libpso::packet::ship::*; use libpso::packet::messages::*;