|
@ -2,10 +2,10 @@ use std::net::Ipv4Addr; |
|
|
use log::{info};
|
|
|
use log::{info};
|
|
|
|
|
|
|
|
|
use networking::interserver::AuthToken;
|
|
|
use networking::interserver::AuthToken;
|
|
|
use elseware::login::login::LoginServerState;
|
|
|
|
|
|
use elseware::login::character::CharacterServerState;
|
|
|
|
|
|
use elseware::patch::{PatchServerState, generate_patch_tree, load_config, load_motd};
|
|
|
|
|
|
use elseware::ship::ship::ShipServerStateBuilder;
|
|
|
|
|
|
|
|
|
use login_server::login::LoginServerState;
|
|
|
|
|
|
use login_server::character::CharacterServerState;
|
|
|
|
|
|
use patch_server::{PatchServerState, generate_patch_tree, load_config, load_motd};
|
|
|
|
|
|
use ship_server::ShipServerStateBuilder;
|
|
|
|
|
|
|
|
|
use maps::Holiday;
|
|
|
use maps::Holiday;
|
|
|
use entity::gateway::{EntityGateway, InMemoryGateway};
|
|
|
use entity::gateway::{EntityGateway, InMemoryGateway};
|
|
@ -344,67 +344,67 @@ fn main() { |
|
|
info!("[auth] starting server");
|
|
|
info!("[auth] starting server");
|
|
|
let login_state = LoginServerState::new(entity_gateway.clone(), "127.0.0.1".parse().unwrap());
|
|
|
let login_state = LoginServerState::new(entity_gateway.clone(), "127.0.0.1".parse().unwrap());
|
|
|
let login_loop = async_std::task::spawn(async move {
|
|
|
let login_loop = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_server(login_state, elseware::login::login::LOGIN_PORT).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_server(login_state, login_server::login::LOGIN_PORT).await;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
info!("[character] starting server");
|
|
|
info!("[character] starting server");
|
|
|
let char_state = CharacterServerState::new(entity_gateway.clone(), AuthToken("".into()));
|
|
|
let char_state = CharacterServerState::new(entity_gateway.clone(), AuthToken("".into()));
|
|
|
let sub_char_state = char_state.clone();
|
|
|
let sub_char_state = char_state.clone();
|
|
|
let character_loop = async_std::task::spawn(async move {
|
|
|
let character_loop = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_server(sub_char_state, elseware::login::character::CHARACTER_PORT).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_server(sub_char_state, login_server::character::CHARACTER_PORT).await;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
let sub_char_state = char_state.clone();
|
|
|
let sub_char_state = char_state.clone();
|
|
|
let inter_character_loop = async_std::task::spawn(async move {
|
|
|
let inter_character_loop = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_interserver_listen(sub_char_state, elseware::login::login::COMMUNICATION_PORT).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_interserver_listen(sub_char_state, login_server::login::COMMUNICATION_PORT).await;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
info!("[ship] starting servers");
|
|
|
info!("[ship] starting servers");
|
|
|
let ship_state = ShipServerStateBuilder::default()
|
|
|
let ship_state = ShipServerStateBuilder::default()
|
|
|
.name("US/Sona-Nyl".into())
|
|
|
.name("US/Sona-Nyl".into())
|
|
|
.ip(Ipv4Addr::new(127,0,0,1))
|
|
|
.ip(Ipv4Addr::new(127,0,0,1))
|
|
|
.port(elseware::ship::ship::SHIP_PORT)
|
|
|
|
|
|
|
|
|
.port(ship_server::SHIP_PORT)
|
|
|
.event(Holiday::Halloween)
|
|
|
.event(Holiday::Halloween)
|
|
|
.gateway(entity_gateway.clone())
|
|
|
.gateway(entity_gateway.clone())
|
|
|
.build();
|
|
|
.build();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let ship_loop1 = async_std::task::spawn(async move {
|
|
|
let ship_loop1 = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_server(sub_ship_state, elseware::ship::ship::SHIP_PORT).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_server(sub_ship_state, ship_server::SHIP_PORT).await;
|
|
|
});
|
|
|
});
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let inter_ship_loop1 = async_std::task::spawn(async move {
|
|
|
let inter_ship_loop1 = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_interserver_connect(sub_ship_state, std::net::Ipv4Addr::new(127, 0, 0, 1), elseware::login::login::COMMUNICATION_PORT).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_interserver_connect(sub_ship_state, std::net::Ipv4Addr::new(127, 0, 0, 1), login_server::login::COMMUNICATION_PORT).await;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
let ship_state = ShipServerStateBuilder::default()
|
|
|
let ship_state = ShipServerStateBuilder::default()
|
|
|
.name("EU/Dylath-Leen".into())
|
|
|
.name("EU/Dylath-Leen".into())
|
|
|
.ip(Ipv4Addr::new(127,0,0,1))
|
|
|
.ip(Ipv4Addr::new(127,0,0,1))
|
|
|
.port(elseware::ship::ship::SHIP_PORT+2000)
|
|
|
|
|
|
|
|
|
.port(ship_server::SHIP_PORT+2000)
|
|
|
.event(Holiday::Christmas)
|
|
|
.event(Holiday::Christmas)
|
|
|
.gateway(entity_gateway.clone())
|
|
|
.gateway(entity_gateway.clone())
|
|
|
.build();
|
|
|
.build();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let ship_loop2 = async_std::task::spawn(async move {
|
|
|
let ship_loop2 = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_server(sub_ship_state, elseware::ship::ship::SHIP_PORT+2000).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_server(sub_ship_state, ship_server::SHIP_PORT+2000).await;
|
|
|
});
|
|
|
});
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let inter_ship_loop2 = async_std::task::spawn(async move {
|
|
|
let inter_ship_loop2 = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_interserver_connect(sub_ship_state, std::net::Ipv4Addr::new(127, 0, 0, 1), elseware::login::login::COMMUNICATION_PORT).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_interserver_connect(sub_ship_state, std::net::Ipv4Addr::new(127, 0, 0, 1), login_server::login::COMMUNICATION_PORT).await;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
let ship_state = ShipServerStateBuilder::default()
|
|
|
let ship_state = ShipServerStateBuilder::default()
|
|
|
.name("JP/Thalarion".into())
|
|
|
.name("JP/Thalarion".into())
|
|
|
.ip(Ipv4Addr::new(127,0,0,1))
|
|
|
.ip(Ipv4Addr::new(127,0,0,1))
|
|
|
.port(elseware::ship::ship::SHIP_PORT+3000)
|
|
|
|
|
|
|
|
|
.port(ship_server::SHIP_PORT+3000)
|
|
|
.gateway(entity_gateway.clone())
|
|
|
.gateway(entity_gateway.clone())
|
|
|
.build();
|
|
|
.build();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let ship_loop3 = async_std::task::spawn(async move {
|
|
|
let ship_loop3 = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_server(sub_ship_state, elseware::ship::ship::SHIP_PORT+3000).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_server(sub_ship_state, ship_server::SHIP_PORT+3000).await;
|
|
|
});
|
|
|
});
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let sub_ship_state = ship_state.clone();
|
|
|
let inter_ship_loop3 = async_std::task::spawn(async move {
|
|
|
let inter_ship_loop3 = async_std::task::spawn(async move {
|
|
|
networking::mainloop::run_interserver_connect(sub_ship_state, std::net::Ipv4Addr::new(127, 0, 0, 1), elseware::login::login::COMMUNICATION_PORT).await;
|
|
|
|
|
|
|
|
|
networking::mainloop::run_interserver_connect(sub_ship_state, std::net::Ipv4Addr::new(127, 0, 0, 1), login_server::login::COMMUNICATION_PORT).await;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
futures::future::join_all(vec![patch_loop, login_loop, character_loop, inter_character_loop,
|
|
|
futures::future::join_all(vec![patch_loop, login_loop, character_loop, inter_character_loop,
|
|
|