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

Method SV_ReadLevelFile

server/src/main/java/jake2/server/SV_CCMDS.java:206–228  ·  view source on GitHub ↗

SV_ReadLevelFile Read: config strings, portal state, read level_locals and entities

(String saveName, GameImportsImpl gameImports)

Source from the content-addressed store, hash-verified

204 * Read: config strings, portal state, read level_locals and entities
205 */
206 static void SV_ReadLevelFile(String saveName, GameImportsImpl gameImports) {
207
208 Com.DPrintf("SV_ReadLevelFile()\n");
209
210 String name = FS.getWriteDir() + "/save/current/" + saveName + ".sv2";
211 try {
212 QuakeFile f = new QuakeFile(name, "r");
213
214 for (int n = 0; n < Defines.MAX_CONFIGSTRINGS; n++)
215 gameImports.sv.configstrings[n] = f.readString();
216
217 gameImports.cm.CM_ReadPortalState(f);
218
219 f.close();
220 }
221 catch (IOException e1) {
222 Com.Printf("Failed to open " + name + "\n");
223 e1.printStackTrace();
224 }
225
226 name = FS.getWriteDir() + "/save/current/" + saveName + ".sav";
227 gameImports.gameExports.ReadLevel(name);
228 }
229
230
231 //=========================================================

Callers 1

restorePreviousGameMethod · 0.95

Calls 6

DPrintfMethod · 0.95
getWriteDirMethod · 0.95
readStringMethod · 0.95
PrintfMethod · 0.95
CM_ReadPortalStateMethod · 0.80
ReadLevelMethod · 0.65

Tested by

no test coverage detected