|
|
@ -118,17 +118,9 @@ async fn test_trade_one_individual_item() { |
|
|
|
|
|
|
|
let mut p1_inv = Vec::new();
|
|
|
|
p1_inv.push(entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap());
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap());
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
|
entity_gateway.set_character_inventory(&char2.id, &item::InventoryEntity::new(Vec::<item::InventoryItemEntity>::new())).await.unwrap();
|
|
|
@ -217,17 +209,9 @@ async fn test_trade_player2_to_player1() { |
|
|
|
|
|
|
|
let mut p2_inv = Vec::new();
|
|
|
|
p2_inv.push(entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap());
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap());
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(Vec::<item::InventoryItemEntity>::new())).await.unwrap();
|
|
|
|
entity_gateway.set_character_inventory(&char2.id, &item::InventoryEntity::new(p2_inv)).await.unwrap();
|
|
|
@ -316,17 +300,9 @@ async fn test_reverse_trade_ack_order() { |
|
|
|
|
|
|
|
let mut p1_inv = Vec::new();
|
|
|
|
p1_inv.push(entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap());
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap());
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
|
entity_gateway.set_character_inventory(&char2.id, &item::InventoryEntity::new(Vec::<item::InventoryItemEntity>::new())).await.unwrap();
|
|
|
@ -417,13 +393,9 @@ async fn test_trade_one_stacked_item() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -519,13 +491,9 @@ async fn test_trade_partial_stacked_item() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -622,30 +590,14 @@ async fn test_trade_individual_both() { |
|
|
|
|
|
|
|
let p1_inv = vec![
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap()];
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Saber)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap()];
|
|
|
|
let p2_inv = vec![
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap()];
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap()];
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
|
entity_gateway.set_character_inventory(&char2.id, &item::InventoryEntity::new(p2_inv)).await.unwrap();
|
|
|
@ -787,13 +739,9 @@ async fn test_trade_stacked_both() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -804,13 +752,9 @@ async fn test_trade_stacked_both() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monofluid,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monofluid)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -955,13 +899,9 @@ async fn test_trade_partial_stack_both() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -972,13 +912,9 @@ async fn test_trade_partial_stack_both() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monofluid,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monofluid)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1129,13 +1065,9 @@ async fn test_trade_same_stacked_item_to_eachother() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1146,13 +1078,9 @@ async fn test_trade_same_stacked_item_to_eachother() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1299,13 +1227,9 @@ async fn test_trade_stacked_when_already_have_partial_stack() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1316,13 +1240,9 @@ async fn test_trade_stacked_when_already_have_partial_stack() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1435,29 +1355,17 @@ async fn test_trade_individual_for_stacked() { |
|
|
|
|
|
|
|
let p1_inv = vec![
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap()];
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Saber)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap()];
|
|
|
|
|
|
|
|
let p2_stack = futures::future::join_all((0..2).map(|_| {
|
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1603,55 +1511,23 @@ async fn test_trade_multiple_individual() { |
|
|
|
|
|
|
|
let p1_inv = vec![
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Saber)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Buster,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Buster)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
];
|
|
|
|
let p2_inv = vec![
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Autogun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Autogun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
];
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
@ -1861,13 +1737,9 @@ async fn test_trade_multiple_stacked() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1877,13 +1749,9 @@ async fn test_trade_multiple_stacked() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Dimate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Dimate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1894,13 +1762,9 @@ async fn test_trade_multiple_stacked() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monofluid,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monofluid)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -1910,13 +1774,9 @@ async fn test_trade_multiple_stacked() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Difluid,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Difluid)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -2126,17 +1986,8 @@ async fn test_trade_not_enough_inventory_space_individual() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
@ -2148,17 +1999,8 @@ async fn test_trade_not_enough_inventory_space_individual() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
@ -2247,13 +2089,9 @@ async fn test_trade_not_enough_inventory_space_stacked() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -2264,17 +2102,8 @@ async fn test_trade_not_enough_inventory_space_stacked() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
@ -2362,13 +2191,9 @@ async fn test_trade_stack_too_big() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -2379,13 +2204,9 @@ async fn test_trade_stack_too_big() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -2732,17 +2553,9 @@ async fn test_back_out_of_trade_last_minute() { |
|
|
|
|
|
|
|
let mut p1_inv = Vec::new();
|
|
|
|
p1_inv.push(entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap());
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap());
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
|
entity_gateway.set_character_inventory(&char2.id, &item::InventoryEntity::new(Vec::<item::InventoryItemEntity>::new())).await.unwrap();
|
|
|
@ -2798,17 +2611,8 @@ async fn test_valid_trade_when_both_inventories_are_full() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Saber)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
@ -2820,17 +2624,8 @@ async fn test_valid_trade_when_both_inventories_are_full() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
@ -2938,17 +2733,8 @@ async fn test_invalid_trade_when_both_inventories_are_full() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Saber)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
@ -2960,17 +2746,8 @@ async fn test_invalid_trade_when_both_inventories_are_full() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
@ -3155,17 +2932,9 @@ async fn test_add_then_remove_individual_item() { |
|
|
|
let mut p1_inv = Vec::new();
|
|
|
|
for _ in 0..2 {
|
|
|
|
p1_inv.push(entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap());
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap());
|
|
|
|
}
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
@ -3267,13 +3036,9 @@ async fn test_add_then_remove_stacked_item() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -3284,13 +3049,9 @@ async fn test_add_then_remove_stacked_item() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monofluid,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monofluid)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -3400,13 +3161,9 @@ async fn test_add_then_remove_partial_stack() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -3417,13 +3174,9 @@ async fn test_add_then_remove_partial_stack() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monofluid,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monofluid)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -3604,17 +3357,9 @@ async fn test_items_to_trade_data_does_not_match() { |
|
|
|
|
|
|
|
let mut p1_inv = Vec::new();
|
|
|
|
p1_inv.push(entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap());
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap());
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
|
entity_gateway.set_character_inventory(&char2.id, &item::InventoryEntity::new(Vec::<item::InventoryItemEntity>::new())).await.unwrap();
|
|
|
@ -3685,17 +3430,9 @@ async fn test_items_to_trade_id_does_not_match() { |
|
|
|
|
|
|
|
let mut p1_inv = Vec::new();
|
|
|
|
p1_inv.push(entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap());
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap());
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
|
entity_gateway.set_character_inventory(&char2.id, &item::InventoryEntity::new(Vec::<item::InventoryItemEntity>::new())).await.unwrap();
|
|
|
@ -3756,13 +3493,9 @@ async fn test_stack_is_same_amount_in_request_and_items_to_trade() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -3828,13 +3561,9 @@ async fn test_stack_is_same_amount_in_request_and_items_to_trade2() { |
|
|
|
let mut entity_gateway = entity_gateway.clone();
|
|
|
|
async move {
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Tool(
|
|
|
|
item::tool::Tool {
|
|
|
|
tool: item::tool::ToolType::Monomate,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}).await
|
|
|
|
ItemBuilder::tool(item::tool::ToolType::Monomate)
|
|
|
|
.as_new()
|
|
|
|
).await
|
|
|
|
}}))
|
|
|
|
.await
|
|
|
|
.into_iter()
|
|
|
@ -3898,41 +3627,17 @@ async fn test_items_to_trade_count_less_than() { |
|
|
|
|
|
|
|
let p1_inv = vec![
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Saber)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Brand,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Brand)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Buster,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Buster)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
];
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
@ -4000,41 +3705,17 @@ async fn test_items_to_trade_count_greater_than() { |
|
|
|
|
|
|
|
let p1_inv = vec![
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Saber)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Brand,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Brand)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Buster,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Buster)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
];
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
@ -4106,41 +3787,17 @@ async fn test_items_to_trade_count_mismatch_with_meseta() { |
|
|
|
|
|
|
|
let p1_inv = vec![
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Saber,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Saber)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Brand,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Brand)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Buster,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap(),
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Buster)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap(),
|
|
|
|
];
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
@ -4206,17 +3863,9 @@ async fn test_dropping_item_after_trade() { |
|
|
|
|
|
|
|
let mut p1_inv = Vec::new();
|
|
|
|
p1_inv.push(entity_gateway.create_item(
|
|
|
|
item::NewItemEntity {
|
|
|
|
item: item::ItemDetail::Weapon(
|
|
|
|
item::weapon::Weapon {
|
|
|
|
weapon: item::weapon::WeaponType::Handgun,
|
|
|
|
grind: 0,
|
|
|
|
special: None,
|
|
|
|
attrs: [None, None, None],
|
|
|
|
tekked: true,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
}).await.unwrap());
|
|
|
|
ItemBuilder::weapon(item::weapon::WeaponType::Handgun)
|
|
|
|
.as_new()
|
|
|
|
).await.unwrap());
|
|
|
|
|
|
|
|
entity_gateway.set_character_inventory(&char1.id, &item::InventoryEntity::new(p1_inv)).await.unwrap();
|
|
|
|
entity_gateway.set_character_inventory(&char2.id, &item::InventoryEntity::new(Vec::<item::InventoryItemEntity>::new())).await.unwrap();
|
|
|
|