|
|
@ -4,6 +4,7 @@ use entity::item; |
|
|
|
use elseware::ship::ship::{ShipServerState, RecvShipPacket, SendShipPacket};
|
|
|
|
use maps::room::Difficulty;
|
|
|
|
use items::state::ItemStateError;
|
|
|
|
use shops::StandardItemShops;
|
|
|
|
|
|
|
|
use libpso::packet::ship::*;
|
|
|
|
use libpso::packet::messages::*;
|
|
|
@ -20,7 +21,9 @@ async fn test_player_opens_weapon_shop() { |
|
|
|
char1.exp = 80000000;
|
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -48,7 +51,9 @@ async fn test_player_opens_tool_shop() { |
|
|
|
char1.exp = 80000000;
|
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -76,7 +81,9 @@ async fn test_player_opens_armor_shop() { |
|
|
|
char1.exp = 80000000;
|
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -105,7 +112,9 @@ async fn test_player_buys_from_weapon_shop() { |
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -141,7 +150,9 @@ async fn test_player_buys_from_tool_shop() { |
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -176,7 +187,9 @@ async fn test_player_buys_multiple_from_tool_shop() { |
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -215,7 +228,9 @@ async fn test_player_buys_from_armor_shop() { |
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -293,7 +308,9 @@ async fn test_other_clients_see_purchase() { |
|
|
|
entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap();
|
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
log_in_char(&mut ship, ClientId(2), "a2", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
@ -342,7 +359,9 @@ async fn test_other_clients_see_stacked_purchase() { |
|
|
|
),
|
|
|
|
}).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
log_in_char(&mut ship, ClientId(2), "a2", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
@ -415,7 +434,9 @@ async fn test_player_double_buys_from_tool_shop() { |
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -478,7 +499,9 @@ async fn test_techs_disappear_from_shop_when_bought() { |
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
@ -538,7 +561,9 @@ async fn test_units_disappear_from_shop_when_bought() { |
|
|
|
entity_gateway.save_character(&char1).await.unwrap();
|
|
|
|
entity_gateway.set_character_meseta(&char1.id, item::Meseta(999999)).await.unwrap();
|
|
|
|
|
|
|
|
let mut ship = standard_ship(entity_gateway.clone());
|
|
|
|
let mut ship = standard_ship_buildable(entity_gateway.clone())
|
|
|
|
.item_shops(StandardItemShops::default())
|
|
|
|
.build();
|
|
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
create_room_with_difficulty(&mut ship, ClientId(1), "room", "", Difficulty::Ultimate).await;
|
|
|
|