MCPcopy Create free account
hub / github.com/demoth/jake2 / SV_Map_f

Method SV_Map_f

server/src/main/java/jake2/server/SV_MAIN.java:1389–1417  ·  view source on GitHub ↗
(List<String> args)

Source from the content-addressed store, hash-verified

1387Resets 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}

Callers

nothing calls this directly

Calls 9

PrintfMethod · 0.95
LoadFileMethod · 0.95
initializeServerCvarsMethod · 0.95
ConfigMethod · 0.95
resetClientsMethod · 0.95
SV_GameMap_fMethod · 0.95
sizeMethod · 0.80
SV_WipeSavegameMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected