|
@ -8,16 +8,39 @@ mod login; |
|
|
mod ship;
|
|
|
mod ship;
|
|
|
|
|
|
|
|
|
use std::thread;
|
|
|
use std::thread;
|
|
|
|
|
|
use std::time::SystemTime;
|
|
|
|
|
|
|
|
|
use patch::patch::{PatchServerState, generate_patch_tree};
|
|
|
use patch::patch::{PatchServerState, generate_patch_tree};
|
|
|
use login::login::LoginServerState;
|
|
|
use login::login::LoginServerState;
|
|
|
use login::character::CharacterServerState;
|
|
|
use login::character::CharacterServerState;
|
|
|
use ship::ship::ShipServerState;
|
|
|
use ship::ship::ShipServerState;
|
|
|
|
|
|
|
|
|
|
|
|
use entity::account::{UserAccount, UserSettings};
|
|
|
use entity::gateway::{EntityGateway, InMemoryGateway};
|
|
|
use entity::gateway::{EntityGateway, InMemoryGateway};
|
|
|
|
|
|
//use crate::utf8_to_utf16_array;
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
fn main() {
|
|
|
let entity_gateway = InMemoryGateway::new();
|
|
|
|
|
|
|
|
|
let mut entity_gateway = InMemoryGateway::new();
|
|
|
|
|
|
|
|
|
|
|
|
let fake_user = UserAccount {
|
|
|
|
|
|
id: 1,
|
|
|
|
|
|
username: "hi".to_string(),
|
|
|
|
|
|
password: bcrypt::hash("qwer", 5).unwrap(),
|
|
|
|
|
|
guildcard: None,
|
|
|
|
|
|
team_id: None,
|
|
|
|
|
|
banned: false,
|
|
|
|
|
|
muted_until: SystemTime::now(),
|
|
|
|
|
|
created_at: SystemTime::now(),
|
|
|
|
|
|
flags: 0,
|
|
|
|
|
|
};
|
|
|
|
|
|
entity_gateway.set_user(&fake_user);
|
|
|
|
|
|
entity_gateway.create_user_settings_by_user(&fake_user);
|
|
|
|
|
|
let mut character = entity_gateway.new_character_by_user(&fake_user);
|
|
|
|
|
|
character.character.name = utf8_to_utf16_array!("Test Char 1", 0x10);
|
|
|
|
|
|
entity_gateway.set_character(&character);
|
|
|
|
|
|
let mut character = entity_gateway.new_character_by_user(&fake_user);
|
|
|
|
|
|
character.slot = 2;
|
|
|
|
|
|
character.character.name = utf8_to_utf16_array!("Test Char 2", 0x10);
|
|
|
|
|
|
entity_gateway.set_character(&character);
|
|
|
|
|
|
|
|
|
let patch_thread = thread::spawn(|| {
|
|
|
let patch_thread = thread::spawn(|| {
|
|
|
println!("[patch] starting server");
|
|
|
println!("[patch] starting server");
|
|
|