Crossfire Server, Trunk
City bell module

Rings the temple bells in the main cities. More...

Files

file  cfcitybell.cpp
 

Data Structures

struct  Region
 

Functions

void cfcitybell_close ()
 
void cfcitybell_init (Settings *settings)
 
static int clock_listener (int *type,...)
 
static void load_bells (BufferReader *reader, const char *filename)
 
static void ring_bell (void)
 

Variables

std::unordered_map< std::string, std::string > Region::bells
 
std::string Region::fallback
 
static event_registration global_handler
 
static int last_hr
 
static std::unordered_map< std::string, Region * > regions
 

Detailed Description

Rings the temple bells in the main cities.

Function Documentation

◆ cfcitybell_close()

void cfcitybell_close ( )

Definition at line 164 of file cfcitybell.cpp.

References all_regions, EVENT_CLOCK, events_unregister_global_handler(), global_handler, and regions.

+ Here is the call graph for this function:

◆ cfcitybell_init()

void cfcitybell_init ( Settings settings)

Citybells module initialisation.

Parameters
settingsserver settings.

Definition at line 152 of file cfcitybell.cpp.

References Settings::add_hook(), clock_listener(), Settings::disabled_plugins, EVENT_CLOCK, events_register_global_handler(), get_tod(), global_handler, timeofday_t::hour, last_hr, load_bells(), and settings.

+ Here is the call graph for this function:

◆ clock_listener()

static int clock_listener ( int *  type,
  ... 
)
static

Global event handling, only uses EVENT_CLOCK.

Parameters
typeThe event type.
Returns
0.

Definition at line 123 of file cfcitybell.cpp.

References make_face_from_files::args, EVENT_CLOCK, get_tod(), timeofday_t::hour, last_hr, ring_bell(), and is_valid_types_gen::type.

Referenced by cfcitybell_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_bells()

static void load_bells ( BufferReader reader,
const char *  filename 
)
static

Load a .bells file.

Parameters
readerreader.
filenamefile name.

Definition at line 50 of file cfcitybell.cpp.

References bufferreader_current_line(), bufferreader_next_line(), disinfect::count, replace::current, npc_dialog::filename, is_valid_types_gen::line, llevError, LOG(), regions, split(), and split_string().

Referenced by cfcitybell_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ring_bell()

static void ring_bell ( void  )
static

Ring the city bells for each player.

Definition at line 90 of file cfcitybell.cpp.

References determine_god(), draw_ext_info(), first_player, is_valid_types_gen::found, get_region_by_map(), navar-midane_pickup::msg, MSG_SUBTYPE_NONE, MSG_TYPE_MISC, region::name, NDI_ORANGE, NDI_UNIQUE, player::ob, altar_valkyrie::pl, ring_occidental_mages::r, and regions.

Referenced by clock_listener().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ bells

std::unordered_map<std::string, std::string> Region::bells

Map between a god's name and the message to display.

Definition at line 38 of file cfcitybell.cpp.

◆ fallback

std::string Region::fallback

Message if the god's name is not in Region::bells.

Definition at line 39 of file cfcitybell.cpp.

◆ global_handler

event_registration global_handler
static

Definition at line 146 of file cfcitybell.cpp.

Referenced by cfcitybell_close(), and cfcitybell_init().

◆ last_hr

int last_hr
static

Definition at line 34 of file cfcitybell.cpp.

Referenced by cfcitybell_init(), and clock_listener().

◆ regions

std::unordered_map<std::string, Region *> regions
static

All defined regions.

Definition at line 43 of file cfcitybell.cpp.

Referenced by cfcitybell_close(), getRegions(), load_bells(), and ring_bell().