mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix swarm binary to use clap
This commit is contained in:
parent
94aa4ce8b1
commit
c7dc51d52b
@ -1,3 +1,4 @@
|
|||||||
|
use clap::Parser;
|
||||||
use common::{
|
use common::{
|
||||||
comp,
|
comp,
|
||||||
terrain::{CoordinateConversions, TerrainChunkSize},
|
terrain::{CoordinateConversions, TerrainChunkSize},
|
||||||
@ -12,29 +13,30 @@ use std::{
|
|||||||
thread,
|
thread,
|
||||||
time::{Duration, SystemTime},
|
time::{Duration, SystemTime},
|
||||||
};
|
};
|
||||||
use structopt::StructOpt;
|
|
||||||
use tokio::runtime::Runtime;
|
use tokio::runtime::Runtime;
|
||||||
use vek::*;
|
use vek::*;
|
||||||
use veloren_client::{addr::ConnectionArgs, Client};
|
use veloren_client::{addr::ConnectionArgs, Client};
|
||||||
|
|
||||||
const CHUNK_SIZE: f32 = TerrainChunkSize::RECT_SIZE.x as f32;
|
const CHUNK_SIZE: f32 = TerrainChunkSize::RECT_SIZE.x as f32;
|
||||||
|
|
||||||
#[derive(Clone, Copy, StructOpt)]
|
#[derive(Clone, Copy, Parser)]
|
||||||
struct Opt {
|
struct Opt {
|
||||||
/// Number of clients to spin up
|
/// Number of clients to spin up
|
||||||
|
#[arg(value_name = "CLIENT_COUNT")]
|
||||||
size: u32,
|
size: u32,
|
||||||
/// View distance of each client
|
/// View distance of each client
|
||||||
|
#[arg(value_name = "VIEW_DISTANCE")]
|
||||||
vd: u32,
|
vd: u32,
|
||||||
/// Distribution of the clients, if not clustered they are dispersed
|
/// Distribution of the clients, if not clustered they are dispersed
|
||||||
#[structopt(short, long)]
|
#[arg(short, long)]
|
||||||
clustered: bool,
|
clustered: bool,
|
||||||
/// Whether the clients should move
|
/// Whether the clients should move
|
||||||
#[structopt(short, long)]
|
#[arg(short, long)]
|
||||||
movement: bool,
|
movement: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let opt = Opt::from_args();
|
let opt = Opt::parse();
|
||||||
// Start logging
|
// Start logging
|
||||||
let _guards = common_frontend::init_stdout(None);
|
let _guards = common_frontend::init_stdout(None);
|
||||||
// Run clients and stuff
|
// Run clients and stuff
|
||||||
|
Loading…
Reference in New Issue
Block a user