Go to the documentation of this file.
34 #include <unordered_map>
40 std::unordered_map<std::string, std::string>
bells;
45 static std::unordered_map<std::string, Region *>
regions;
58 if (
line[0] ==
'\0' ||
line[0] ==
'#') {
61 char *space = strchr(
line,
' ');
69 if (strcmp(
line,
"region") == 0) {
79 for (
size_t i = 0; i <
count; i++) {
80 if (strcmp(
split[i],
"*") == 0) {
103 auto god =
found->second->bells.find(god_name);
104 std::string
msg = god ==
found->second->bells.end() ?
found->second->fallback : god->second;
105 auto r =
msg.find(
"%god");
106 if (
r != std::string::npos) {
107 msg.replace(
r, 4, god_name);
131 code = va_arg(
args,
int);
168 disable->
name = strdup(
"cfcitybell");
static void ring_bell(void)
char * bufferreader_next_line(BufferReader *br)
size_t bufferreader_current_line(BufferReader *br)
std::unordered_map< std::string, std::string > bells
event_registration events_register_global_handler(int eventcode, f_plug_event hook)
void get_tod(timeofday_t *tod)
const char * determine_god(object *op)
void events_unregister_global_handler(int eventcode, event_registration id)
EXTERN player * first_player
struct linked_char * next
const char * hooks_filename[20]
void cfcitybell_init(Settings *settings)
size_t split_string(char *str, char *array[], size_t array_size, char sep)
linked_char * disabled_plugins
unsigned long event_registration
void LOG(LogLevel logLevel, const char *format,...)
static std::unordered_map< std::string, Region * > regions
static event_registration global_handler
region * get_region_by_map(mapstruct *m)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
static std::vector< std::string > split(const std::string &field, const std::string &by)
static int clock_listener(int *type,...)
static void load_bells(BufferReader *reader, const char *filename)