diff options
Diffstat (limited to 'planetwars-server/src/modules/client_api.rs')
-rw-r--r-- | planetwars-server/src/modules/client_api.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/planetwars-server/src/modules/client_api.rs b/planetwars-server/src/modules/client_api.rs index 7026671..3402964 100644 --- a/planetwars-server/src/modules/client_api.rs +++ b/planetwars-server/src/modules/client_api.rs @@ -111,14 +111,23 @@ impl pb::client_api_service_server::ClientApiService for ClientApiServer { db::bots::find_bot_with_version_by_name(&match_request.opponent_name, &conn) .map_err(|_| Status::not_found("opponent not found"))?; + let map_name = match match_request.map_name.as_str() { + "" => "hex", + name => name, + }; + let map = db::maps::find_map_by_name(map_name, &conn) + .map_err(|_| Status::not_found("map not found"))?; + let player_key = gen_alphanumeric(32); let remote_bot_spec = Box::new(RemoteBotSpec { player_key: player_key.clone(), router: self.router.clone(), }); - let run_match = RunMatch::from_players( + let run_match = RunMatch::new( self.runner_config.clone(), + false, + map, vec![ MatchPlayer::BotSpec { spec: remote_bot_spec, |