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

Method Create_Savestrings

client/src/main/java/jake2/client/Menu.java:2100–2123  ·  view source on GitHub ↗

Search the save dir for saved games and their names.

()

Source from the content-addressed store, hash-verified

2098
2099 /** Search the save dir for saved games and their names. */
2100 private static void Create_Savestrings() {
2101 int i;
2102 QuakeFile f;
2103 String name;
2104
2105 for (i = 0; i < MAX_SAVEGAMES; i++) {
2106
2107 m_savestrings[i] = "<EMPTY>";
2108 name = FS.getWriteDir() + "/save/save" + i + "/server_mapcmd.ssv";
2109
2110 try {
2111 f = new QuakeFile(name, "r", false, -1);
2112 String str = f.readString();
2113 if (str != null)
2114 m_savestrings[i] = str;
2115 f.close();
2116 m_savevalid[i] = true;
2117 } catch (Exception e) {
2118 m_savestrings[i] = "<EMPTY>";
2119 m_savevalid[i] = false;
2120 }
2121 ;
2122 }
2123 }
2124
2125 private static void LoadGameCallback(Object self) {
2126 menuaction_s a = (menuaction_s) self;

Callers 3

LoadGame_MenuInitMethod · 0.95
SaveGame_MenuInitMethod · 0.95
Menu_SaveGame_fMethod · 0.95

Calls 2

getWriteDirMethod · 0.95
readStringMethod · 0.95

Tested by

no test coverage detected