From bdb77f97d6af5a59e80d2b2552cd6994754cbf29 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sat, 1 Jan 2022 16:32:55 +0100 Subject: minimal port of start_match logic --- planetwars-server/src/routes/bots.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'planetwars-server/src/routes/bots.rs') diff --git a/planetwars-server/src/routes/bots.rs b/planetwars-server/src/routes/bots.rs index 8327443..5f5d8f5 100644 --- a/planetwars-server/src/routes/bots.rs +++ b/planetwars-server/src/routes/bots.rs @@ -1,22 +1,18 @@ -use axum::extract::{Multipart, Path, RawBody}; +use axum::extract::{Multipart, Path}; use axum::http::StatusCode; -use axum::response::IntoResponse; use axum::Json; use rand::distributions::Alphanumeric; use rand::Rng; use serde::{Deserialize, Serialize}; use serde_json::{json, value::Value as JsonValue}; use std::io::Cursor; -use std::path::{self, PathBuf}; +use std::path::PathBuf; use crate::db::bots::{self, CodeBundle}; use crate::db::users::User; -use crate::DatabaseConnection; +use crate::{DatabaseConnection, BOTS_DIR}; use bots::Bot; -// TODO: make this a parameter -const BOTS_DIR: &str = "./data/bots"; - #[derive(Serialize, Deserialize, Debug)] pub struct BotParams { name: String, -- cgit v1.2.3