- int new_maxaccepts, new_cooldown;
- bool new_override, new_track;
- new_maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true);
- switch (Conf.GetError())
- {
- case 0: break;
- case CONF_VALUE_NOT_FOUND:
- new_maxaccepts = 16;
- break;
- case CONF_NOT_A_NUMBER:
- if (user) user->WriteServ("NOTICE %s :Invalid maxaccepts value '%s', not a number", Conf.ReadValue("callerid", "maxaccepts", "", 0).c_str());
- throw ModuleException("Invalid maxaccepts value, not a number");
- case CONF_INT_NEGATIVE:
- if (user) user->WriteServ("NOTICE %s :Invalid maxaccepts value '%s', negative", Conf.ReadValue("callerid", "maxaccepts", "", 0).c_str());
- throw ModuleException("Invalid maxaccepts value, negative");
- default:
- /* Yikes */
- throw ModuleException("Invalid maxaccepts value, unknown config error");
- }
- new_override = Conf.ReadFlag("callerid", "operoverride", "0", 0);
- if (Conf.GetError() == CONF_VALUE_NOT_FOUND) new_override = false;
- new_track = Conf.ReadFlag("callerid", "tracknick", "0", 0);
- if (Conf.GetError() == CONF_VALUE_NOT_FOUND) new_track = false;
- new_cooldown = Conf.ReadInteger("callerid", "cooldown", "60", 0, true);
- switch (Conf.GetError())
- {
- case 0: break;
- case CONF_VALUE_NOT_FOUND:
- new_cooldown = 16;
- break;
- case CONF_NOT_A_NUMBER:
- if (user) user->WriteServ("NOTICE %s :Invalid cooldown value '%s', not a number", Conf.ReadValue("callerid", "maxaccepts", "", 0).c_str());
- throw ModuleException("Invalid cooldown value, not a number");
- case CONF_INT_NEGATIVE:
- if (user) user->WriteServ("NOTICE %s :Invalid cooldown value '%s', negative", Conf.ReadValue("callerid", "maxaccepts", "", 0).c_str());
- throw ModuleException("Invalid cooldown value, negative");
- default:
- /* Yikes */
- throw ModuleException("Invalid maxaccepts value, unknown config error");
- }
- maxaccepts = new_maxaccepts;
- notify_cooldown = new_cooldown;
- operoverride = new_override;
- tracknick = new_track;
+ maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true);
+ operoverride = Conf.ReadFlag("callerid", "operoverride", "0", 0);
+ tracknick = Conf.ReadFlag("callerid", "tracknick", "0", 0);
+ notify_cooldown = Conf.ReadInteger("callerid", "cooldown", "60", 0, true);