| 207 | } |
| 208 | |
| 209 | BZ_GET_PLUGIN_VERSION |
| 210 | |
| 211 | BZF_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 | |
| 246 | BZF_PLUGIN_CALL int bz_Unload(void) { |
| 247 | bz_removeEvent(bz_ePlayerJoinEvent, &handler); |
nothing calls this directly
no test coverage detected