MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / bz_Load

Function bz_Load

plugins/mapchange/mapchange.cpp:209–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209BZ_GET_PLUGIN_VERSION
210
211BZF_PLUGIN_CALL int bz_Load(const char* commandLine) {
212 if (!commandLine || !strlen(commandLine)) {
213 bz_debugMessage(0, "mapchange plugin requires a config file as a param and will not load");
214 return -1;
215 }
216
217 if (!loadGamesFromFile(commandLine)) {
218 bz_debugMessage(0, "mapchange plugin config file failure, aborting load");
219 return -1;
220 }
221
222 bz_debugMessage(4, "mapchange plugin loaded");
223
224 if (anyPlayers()) {
225 startTime = bz_getCurrentTime();
226 }
227
228 bz_registerEvent(bz_ePlayerJoinEvent, &handler);
229 bz_registerEvent(bz_ePlayerDieEvent, &handler);
230 bz_registerEvent(bz_ePlayerPartEvent, &handler);
231 bz_registerEvent(bz_eCaptureEvent, &handler);
232 bz_registerEvent(bz_eGetWorldEvent, &handler);
233 bz_registerEvent(bz_eTickEvent, &handler);
234 bz_registerEvent(bz_eListServerUpdateEvent, &handler);
235
236 bz_registerCustomSlashCommand("mapnext", &slash);
237 bz_registerCustomSlashCommand("mapreset", &slash);
238 bz_registerCustomSlashCommand("mapcyclemode", &slash);
239 bz_registerCustomSlashCommand("mapendmode", &slash);
240 bz_registerCustomSlashCommand("maplist", &slash);
241 bz_registerCustomSlashCommand("maplimit", &slash);
242
243 return 0;
244}
245
246BZF_PLUGIN_CALL int bz_Unload(void) {
247 bz_removeEvent(bz_ePlayerJoinEvent, &handler);

Callers

nothing calls this directly

Calls 6

bz_debugMessageFunction · 0.85
loadGamesFromFileFunction · 0.85
anyPlayersFunction · 0.85
bz_getCurrentTimeFunction · 0.85
bz_registerEventFunction · 0.85

Tested by

no test coverage detected