diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-08-26 19:21:30 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-08-26 19:21:30 +0200 |
commit | e26f13c8bba24e6f966888d5909f2803665c55a0 (patch) | |
tree | 6d156e0dd18d695103d00d12111ee26e73e8d3a0 /planetwars-server/src/modules/client_api.rs | |
parent | 624fa99fad0d41bfbd0f249ab054745a990a5d8c (diff) | |
download | planetwars.dev-e26f13c8bba24e6f966888d5909f2803665c55a0.tar.xz planetwars.dev-e26f13c8bba24e6f966888d5909f2803665c55a0.zip |
add maps to matches api
Diffstat (limited to 'planetwars-server/src/modules/client_api.rs')
-rw-r--r-- | planetwars-server/src/modules/client_api.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/planetwars-server/src/modules/client_api.rs b/planetwars-server/src/modules/client_api.rs index f960e1b..0efc000 100644 --- a/planetwars-server/src/modules/client_api.rs +++ b/planetwars-server/src/modules/client_api.rs @@ -111,15 +111,20 @@ 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"))?; + // TODO: allow map as parameter here + let map = db::maps::find_map_by_name(&"hex", &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, |