You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
990 B
31 lines
990 B
use elseware::common::serverstate::{ClientId, ServerState};
|
|
use elseware::entity::gateway::{EntityGateway, InMemoryGateway};
|
|
use elseware::ship::ship::{ShipServerState, RecvShipPacket};
|
|
|
|
use libpso::packet::ship::*;
|
|
|
|
#[path = "common.rs"]
|
|
mod common;
|
|
use common::*;
|
|
|
|
#[async_std::test]
|
|
async fn test_save_options() {
|
|
let mut entity_gateway = InMemoryGateway::default();
|
|
|
|
let (user1, _char1) = new_user_character(&mut entity_gateway, "a1", "a").await;
|
|
|
|
let mut ship = Box::new(ShipServerState::builder()
|
|
.gateway(entity_gateway.clone())
|
|
.build());
|
|
log_in_char(&mut ship, ClientId(1), "a1", "a").await;
|
|
join_lobby(&mut ship, ClientId(1)).await;
|
|
|
|
ship.handle(ClientId(1), &RecvShipPacket::SaveOptions(SaveOptions{
|
|
options: 12345,
|
|
})).await.unwrap().for_each(drop);
|
|
|
|
let characters = entity_gateway.get_characters_by_user(&user1).await.unwrap();
|
|
let char = characters[0].as_ref().unwrap();
|
|
|
|
assert!(char.option_flags == 12345);
|
|
}
|