mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add basic server-only player harness
This commit is contained in:
1 parent
94d247f8f4
commit
05bf4a097a
20 files changed
+304
-21
No files matched your search
@@ -418,4 +418,13 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
wiki_url: self.settings.server.wiki_url.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
fn fake_players(&self) -> Vec<super::FakePlayer> {
|
||||
self.battle.multiplayer.fakes.iter().map(|player| super::FakePlayer {
|
||||
public_id: player.public_id.clone(),
|
||||
display_name: player.display_name.clone(),
|
||||
team: player.team,
|
||||
implementation: player.implementation.clone().to_config(),
|
||||
}).collect()
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ mod cubes_json;
|
||||
pub use cubes_json::CubeConfig;
|
||||
|
||||
mod traits;
|
||||
pub use traits::{ConfigProvider, CompleteCampaignProvider, DevMessageProvider, ServerConfig, GarageUpgrades, GarageUpgradeIncrement, ChatSystemConfig, GameEventSequence, GameEvents, GameRotationStrategy, GameEvent, GameMap, GameVisibility, GameType, SingleplayerConfig, VehicleInfo, VehicleDescriptor, QueueChangeMode, Point, Sphere, MapConfig, LinksConfig};
|
||||
pub use traits::{ConfigProvider, CompleteCampaignProvider, DevMessageProvider, ServerConfig, GarageUpgrades, GarageUpgradeIncrement, ChatSystemConfig, GameEventSequence, GameEvents, GameRotationStrategy, GameEvent, GameMap, GameVisibility, GameType, SingleplayerConfig, VehicleInfo, VehicleDescriptor, QueueChangeMode, Point, Sphere, MapConfig, LinksConfig, FakePlayer, ClientEmulator};
|
||||
|
||||
pub type ConfigImpl = CubeConfig;
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ pub trait ConfigProvider<C: Clone> {
|
||||
fn network_config(&self) -> crate::persist::NetworkConf;
|
||||
fn maps(&self) -> std::collections::HashMap<GameMap, MapConfig>;
|
||||
fn url_links(&self) -> LinksConfig;
|
||||
fn fake_players(&self) -> Vec<FakePlayer>;
|
||||
}
|
||||
|
||||
pub struct CompleteCampaignProvider {
|
||||
@@ -365,3 +366,16 @@ pub struct LinksConfig {
|
||||
pub support_url: String,
|
||||
pub wiki_url: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct FakePlayer {
|
||||
pub public_id: String,
|
||||
pub display_name: String,
|
||||
pub team: u8,
|
||||
pub implementation: ClientEmulator,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum ClientEmulator {
|
||||
Experiment,
|
||||
}
|
||||
Reference in new issue
Block a user