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

Method WriteConfiguration

client/src/main/java/jake2/client/CL.java:1333–1359  ·  view source on GitHub ↗

WriteConfiguration Writes key bindings and archived cvars to config.cfg.

()

Source from the content-addressed store, hash-verified

1331 * Writes key bindings and archived cvars to config.cfg.
1332 */
1333 public static void WriteConfiguration() {
1334 RandomAccessFile f;
1335 String path;
1336
1337// if (Globals.cls.state == Defines.ca_uninitialized)
1338// return;
1339
1340 path = FS.getWriteDir() + "/config.cfg";
1341 f = Lib.fopen(path, "rw");
1342 if (f == null) {
1343 Com.Printf("Couldn't write config.cfg.\n");
1344 return;
1345 }
1346 try {
1347 f.seek(0);
1348 f.setLength(0);
1349 } catch (IOException e1) {
1350 }
1351 try {
1352 f.writeBytes("// generated by quake, do not modify\n");
1353 } catch (IOException e) {
1354 }
1355
1356 Key.WriteBindings(f);
1357 Lib.fclose(f);
1358 Cvar.getInstance().writeArchiveVariables(path);
1359 }
1360
1361 /**
1362 * FixCvarCheats

Callers 2

InitMethod · 0.95
ShutdownMethod · 0.95

Calls 8

getWriteDirMethod · 0.95
fopenMethod · 0.95
PrintfMethod · 0.95
WriteBindingsMethod · 0.95
fcloseMethod · 0.95
getInstanceMethod · 0.95
writeBytesMethod · 0.80
writeArchiveVariablesMethod · 0.80

Tested by

no test coverage detected