From df3d031612763c91564bbe0026a3498789056683 Mon Sep 17 00:00:00 2001 From: Jake Probst Date: Fri, 6 Sep 2019 17:02:14 -0700 Subject: [PATCH] start character server --- src/login/character.rs | 2 +- src/login/main.rs | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/login/character.rs b/src/login/character.rs index fbf2eff..386bd9d 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -78,7 +78,7 @@ pub struct CharacterServerState { } impl CharacterServerState { - fn new(data_access: DA) -> CharacterServerState { + pub fn new(data_access: DA) -> CharacterServerState { CharacterServerState { //shared_state: shared_state, data_access: data_access, diff --git a/src/login/main.rs b/src/login/main.rs index 95fea19..c064a4f 100644 --- a/src/login/main.rs +++ b/src/login/main.rs @@ -95,6 +95,15 @@ fn main() { println!("[login+character] starting server"); // TODO: character mainloop - let auth_state = LoginServerState::new(LoginStubData {}); - elseware::common::mainloop::mainloop(auth_state, login::LOGIN_PORT); + let auth_thread = thread::spawn(|| { + let auth_state = LoginServerState::new(LoginStubData {}); + elseware::common::mainloop::mainloop(auth_state, login::LOGIN_PORT); + }); + let char_thread = thread::spawn(|| { + let char_state = CharacterServerState::new(LoginStubData {}); + elseware::common::mainloop::mainloop(char_state, character::CHARACTER_PORT); + }); + + auth_thread.join(); + char_thread.join(); }