Crossfire Server, Trunk  1.75.0
citylife.cpp File Reference
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <assert.h>
#include "global.h"
#include "object.h"
#include "sproto.h"
#include "server.h"
#include "assets.h"
+ Include dependency graph for citylife.cpp:

Go to the source code of this file.

Data Structures

struct  mapzone
 Options for a map. More...
 
struct  spawn_point
 Point from which a NPC can come when the map is loaded. More...
 
struct  spawn_zone
 Zone in which to add NPCs when the map was just loaded. More...
 

Macros

#define CITYLIFE_NAME   "citylife"
 Module name for the event system. More...
 
#define FIRST_MOVE_KEY   "citylife_first_move"
 Key to contain whether it's the first move of the NPC or not. More...
 

Functions

static void add_npc_to_point (const mapzone *zone, mapstruct *map)
 Add an NPC somewhere at a spawn point. More...
 
static void add_npc_to_random_map (void)
 Find a suitable map loaded and add an NPC to it. More...
 
static void add_npc_to_zone (const mapzone *zone, mapstruct *map)
 Add an NPC somewhere in a spawn zone. More...
 
static void add_npcs_to_map (mapstruct *map)
 Add some NPCs to the map, based on the zone definition. More...
 
static void check_zone (const mapzone *zone, const char *path)
 Check if the zone has valid parameters, LOG() when invalid ones. More...
 
void citylife_close ()
 
static int citylife_globalEventListener (int *type,...)
 
void citylife_init (Settings *, ServerSettings *serverSettings)
 
static int eventListener (int *type,...)
 
static objectget_npc (const mapzone *zone)
 Creates a NPC for the specified zone, and do needed initialization. More...
 
static const mapzoneget_zone_for_map (mapstruct *map)
 Finds if a map has a zone defined. More...
 
static void load_citylife (BufferReader *reader, const char *filename)
 Read a .citylife file. More...
 

Variables

static event_registration c
 
static event_registration m
 
static std::unordered_map< std::string, mapzone * > maps
 All defined maps, with the path as key. More...
 

Detailed Description

This file is part of the city life module. See this page for more information.

Definition in file citylife.cpp.