(List<String> args)
| 1387 | Resets server to host a given map, moves all clients to it (via reconnect) |
| 1388 | */ |
| 1389 | void SV_Map_f(List<String> args) { |
| 1390 | //char expanded[MAX_QPATH]; |
| 1391 | if (args.size() < 2) { |
| 1392 | Com.Printf("usage: map <map_name>\n"); |
| 1393 | return; |
| 1394 | } |
| 1395 | |
| 1396 | // if not a pcx, demo, or cinematic, check to make sure the level exists |
| 1397 | String mapName = args.get(1); |
| 1398 | if (!mapName.contains(".")) { |
| 1399 | String mapPath = "maps/" + mapName + ".bsp"; |
| 1400 | if (FS.LoadFile(mapPath) == null) { |
| 1401 | Com.Printf("Can't find " + mapPath + "\n"); |
| 1402 | return; |
| 1403 | } |
| 1404 | } |
| 1405 | var game = games.get("default"); |
| 1406 | |
| 1407 | if (game != null) |
| 1408 | game.sv.state = ServerStates.SS_DEAD; // don't save current level when changing |
| 1409 | |
| 1410 | SV_WipeSavegame("current"); |
| 1411 | |
| 1412 | // init mode & maxclients cvar |
| 1413 | boolean multiplayer = initializeServerCvars(); |
| 1414 | NET.Config(multiplayer); |
| 1415 | resetClients(); |
| 1416 | SV_GameMap_f(args); |
| 1417 | } |
| 1418 | |
| 1419 | } |
nothing calls this directly
no test coverage detected