mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Send commands on client launch, closes #190
This commit is contained in:
parent
81ca86ad06
commit
3a1ae1b361
@ -85,6 +85,13 @@ impl PlayState for SessionState {
|
||||
let mut clock = Clock::start();
|
||||
self.client.borrow_mut().clear_terrain();
|
||||
|
||||
// Send startup commands to the server
|
||||
if global_state.settings.send_logon_commands {
|
||||
for cmd in &global_state.settings.logon_commands {
|
||||
self.client.borrow_mut().send_chat(cmd.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
// Game loop
|
||||
let mut current_client_state = self.client.borrow().get_client_state();
|
||||
while let ClientState::Pending | ClientState::Character | ClientState::Dead =
|
||||
|
@ -176,6 +176,9 @@ pub struct Settings {
|
||||
pub graphics: GraphicsSettings,
|
||||
pub audio: AudioSettings,
|
||||
pub show_disclaimer: bool,
|
||||
pub send_logon_commands: bool,
|
||||
// TODO: Remove at a later date, for dev testing
|
||||
pub logon_commands: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for Settings {
|
||||
@ -188,6 +191,8 @@ impl Default for Settings {
|
||||
graphics: GraphicsSettings::default(),
|
||||
audio: AudioSettings::default(),
|
||||
show_disclaimer: true,
|
||||
send_logon_commands: false,
|
||||
logon_commands: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user