mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'songtronix/clean-server-and-cli' into 'master'
Clean server and server-cli See merge request veloren/veloren!279
This commit is contained in:
commit
4cba73ff72
@ -149,7 +149,7 @@ fn handle_jump(server: &mut Server, entity: EcsEntity, args: String, action: &Ch
|
||||
fn handle_goto(server: &mut Server, entity: EcsEntity, args: String, action: &ChatCommand) {
|
||||
let (opt_x, opt_y, opt_z) = scan_fmt!(&args, action.arg_fmt, f32, f32, f32);
|
||||
match server.state.read_component_cloned::<comp::Pos>(entity) {
|
||||
Some(mut pos) => match (opt_x, opt_y, opt_z) {
|
||||
Some(_pos) => match (opt_x, opt_y, opt_z) {
|
||||
(Some(x), Some(y), Some(z)) => {
|
||||
server
|
||||
.state
|
||||
@ -232,7 +232,7 @@ fn handle_tp(server: &mut Server, entity: EcsEntity, args: String, action: &Chat
|
||||
.find(|(_, player)| player.alias == alias)
|
||||
.map(|(entity, _)| entity);
|
||||
match server.state.read_component_cloned::<comp::Pos>(entity) {
|
||||
Some(mut pos) => match opt_player {
|
||||
Some(_pos) => match opt_player {
|
||||
Some(player) => match server.state.read_component_cloned::<comp::Pos>(player) {
|
||||
Some(pos) => {
|
||||
server.state.write_component(entity, pos);
|
||||
@ -308,7 +308,7 @@ fn handle_players(server: &mut Server, entity: EcsEntity, _args: String, _action
|
||||
let ecs = server.state.ecs();
|
||||
let players = ecs.read_storage::<comp::Player>();
|
||||
let count = players.join().count();
|
||||
let mut header_message: String = format!("{} online players: \n", count);
|
||||
let header_message: String = format!("{} online players: \n", count);
|
||||
if count > 0 {
|
||||
let mut player_iter = players.join();
|
||||
let first = player_iter.next().unwrap().alias.to_owned();
|
||||
|
@ -20,7 +20,7 @@ use common::{
|
||||
terrain::{TerrainChunk, TerrainChunkSize, TerrainMap},
|
||||
vol::VolSize,
|
||||
};
|
||||
use log::{debug, warn};
|
||||
use log::debug;
|
||||
use specs::{join::Join, world::EntityBuilder as EcsEntityBuilder, Builder, Entity as EcsEntity};
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
@ -177,7 +177,7 @@ impl Server {
|
||||
|
||||
/// Execute a single server tick, handle input and update the game state by the given duration.
|
||||
#[allow(dead_code)]
|
||||
pub fn tick(&mut self, input: Input, dt: Duration) -> Result<Vec<Event>, Error> {
|
||||
pub fn tick(&mut self, _input: Input, dt: Duration) -> Result<Vec<Event>, Error> {
|
||||
// This tick function is the centre of the Veloren universe. Most server-side things are
|
||||
// managed from here, and as such it's important that it stays organised. Please consult
|
||||
// the core developers before making significant changes to this code. Here is the
|
||||
@ -442,7 +442,7 @@ impl Server {
|
||||
}
|
||||
}
|
||||
// Invalid player
|
||||
ClientMsg::Register { player } => {
|
||||
ClientMsg::Register { .. } => {
|
||||
client.error_state(RequestStateError::Impossible)
|
||||
}
|
||||
ClientMsg::SetViewDistance(view_distance) => match client.client_state {
|
||||
|
Loading…
Reference in New Issue
Block a user