Browse Source

null free roam maps by default

pull/141/head
jake 1 year ago
parent
commit
3cd4e9db10
  1. 9
      maps/src/maps.rs
  2. 4
      src/bin/main.rs
  3. 2
      src/bin/ship.rs
  4. 4
      src/ship/ship.rs

9
maps/src/maps.rs

@ -376,3 +376,12 @@ pub fn generate_free_roam_maps(room_mode: RoomMode, event: Holiday) -> Maps {
map_variants, map_variants,
} }
} }
pub fn null_free_roam_maps(_room_mode: RoomMode, _event: Holiday) -> Maps {
Maps {
enemy_data: Default::default(),
object_data: Default::default(),
map_variants: Default::default(),
}
}

4
src/bin/main.rs

@ -8,6 +8,7 @@ use elseware::patch::{PatchServerState, generate_patch_tree, load_config, load_m
use elseware::ship::ship::ShipServerStateBuilder; use elseware::ship::ship::ShipServerStateBuilder;
use maps::Holiday; use maps::Holiday;
use maps::maps::generate_free_roam_maps;
use entity::gateway::{EntityGateway, InMemoryGateway}; use entity::gateway::{EntityGateway, InMemoryGateway};
use entity::account::{NewUserAccountEntity, NewUserSettingsEntity}; use entity::account::{NewUserAccountEntity, NewUserSettingsEntity};
use entity::character::NewCharacterEntity; use entity::character::NewCharacterEntity;
@ -369,6 +370,7 @@ fn main() {
.standard_quest_builder(Box::new(quests::load_standard_quests)) .standard_quest_builder(Box::new(quests::load_standard_quests))
.government_quest_builder(Box::new(quests::load_government_quests)) .government_quest_builder(Box::new(quests::load_government_quests))
.drop_table_builder(Box::new(StandardDropTable::new)) .drop_table_builder(Box::new(StandardDropTable::new))
.map_builder(Box::new(generate_free_roam_maps))
.gateway(entity_gateway.clone()) .gateway(entity_gateway.clone())
.build(); .build();
let sub_ship_state = ship_state.clone(); let sub_ship_state = ship_state.clone();
@ -388,6 +390,7 @@ fn main() {
.standard_quest_builder(Box::new(quests::load_standard_quests)) .standard_quest_builder(Box::new(quests::load_standard_quests))
.government_quest_builder(Box::new(quests::load_government_quests)) .government_quest_builder(Box::new(quests::load_government_quests))
.drop_table_builder(Box::new(StandardDropTable::new)) .drop_table_builder(Box::new(StandardDropTable::new))
.map_builder(Box::new(generate_free_roam_maps))
.gateway(entity_gateway.clone()) .gateway(entity_gateway.clone())
.build(); .build();
let sub_ship_state = ship_state.clone(); let sub_ship_state = ship_state.clone();
@ -406,6 +409,7 @@ fn main() {
.standard_quest_builder(Box::new(quests::load_standard_quests)) .standard_quest_builder(Box::new(quests::load_standard_quests))
.government_quest_builder(Box::new(quests::load_government_quests)) .government_quest_builder(Box::new(quests::load_government_quests))
.drop_table_builder(Box::new(StandardDropTable::new)) .drop_table_builder(Box::new(StandardDropTable::new))
.map_builder(Box::new(generate_free_roam_maps))
.gateway(entity_gateway.clone()) .gateway(entity_gateway.clone())
.build(); .build();
let sub_ship_state = ship_state.clone(); let sub_ship_state = ship_state.clone();

2
src/bin/ship.rs

@ -3,6 +3,7 @@ use entity::gateway::postgres::PostgresGateway;
use elseware::ship::ship::ShipServerStateBuilder; use elseware::ship::ship::ShipServerStateBuilder;
use networking::interserver::AuthToken; use networking::interserver::AuthToken;
use drops::StandardDropTable; use drops::StandardDropTable;
use maps::maps::generate_free_roam_maps;
fn main() { fn main() {
let colors = fern::colors::ColoredLevelConfig::new() let colors = fern::colors::ColoredLevelConfig::new()
@ -47,6 +48,7 @@ fn main() {
.standard_quest_builder(Box::new(quests::load_standard_quests)) .standard_quest_builder(Box::new(quests::load_standard_quests))
.government_quest_builder(Box::new(quests::load_government_quests)) .government_quest_builder(Box::new(quests::load_government_quests))
.drop_table_builder(Box::new(StandardDropTable::new)) .drop_table_builder(Box::new(StandardDropTable::new))
.map_builder(Box::new(generate_free_roam_maps))
.build(); .build();
let shipgate_ip = std::env::var("SHIPGATE_IP").unwrap().parse().unwrap(); let shipgate_ip = std::env::var("SHIPGATE_IP").unwrap().parse().unwrap();

4
src/ship/ship.rs

@ -30,7 +30,7 @@ use maps::room::{RoomMode, Episode, Difficulty};
use quests::{QuestList, QuestLoadError}; use quests::{QuestList, QuestLoadError};
use maps::Holiday; use maps::Holiday;
use maps::area::MapAreaError; use maps::area::MapAreaError;
use maps::maps::{Maps, MapsError, generate_free_roam_maps};
use maps::maps::{Maps, MapsError, null_free_roam_maps};
use crate::ship::packet::handler; use crate::ship::packet::handler;
use shops::{WeaponShop, ToolShop, ArmorShop}; use shops::{WeaponShop, ToolShop, ArmorShop};
use trade::TradeState; use trade::TradeState;
@ -434,7 +434,7 @@ impl<EG: EntityGateway + Clone + 'static> ShipServerStateBuilder<EG> {
shops: ItemShops::default(), shops: ItemShops::default(),
blocks: Blocks(blocks), blocks: Blocks(blocks),
event: self.event.unwrap_or(Holiday::None), event: self.event.unwrap_or(Holiday::None),
map_builder: Arc::new(self.map_builder.unwrap_or(Box::new(generate_free_roam_maps))),
map_builder: Arc::new(self.map_builder.unwrap_or(Box::new(null_free_roam_maps))),
drop_table_builder: Arc::new(self.drop_table_builder.unwrap_or(Box::new(null_drop_table))), drop_table_builder: Arc::new(self.drop_table_builder.unwrap_or(Box::new(null_drop_table))),
standard_quest_builder: Arc::new(self.standard_quest_builder.unwrap_or(Box::new(|_| Ok(QuestList::new())))), standard_quest_builder: Arc::new(self.standard_quest_builder.unwrap_or(Box::new(|_| Ok(QuestList::new())))),
government_quest_builder: Arc::new(self.government_quest_builder.unwrap_or(Box::new(|_| Ok(QuestList::new())))), government_quest_builder: Arc::new(self.government_quest_builder.unwrap_or(Box::new(|_| Ok(QuestList::new())))),

Loading…
Cancel
Save