Crossfire Server, Trunk
main.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "global.h"
#include "maze_gen.h"
#include "random_map.h"
#include "room_gen.h"
#include "rproto.h"
#include "sproto.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Data Structures

struct  layout
 

Macros

#define LO_NEWFILE   2
 

Functions

int apply_auto (object *op)
 
void apply_auto_fix (mapstruct *m)
 
void clean_tmp_files (void)
 
void dragon_ability_gain (object *ob, int x, int y)
 
void draw_ext_info (int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
 
void draw_ext_info_format (int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
 
void emergency_save (int x)
 
void esrv_del_item (player *pl, object *ob)
 
void esrv_send_item (object *ob, object *obx)
 
void esrv_update_item (int flags, object *pl, object *op)
 
void esrv_update_spells (player *pl)
 
void ext_info_map (int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
 
objectfind_skill_by_number (object *who, int skillno)
 
static void generate_map (char *OutFileName)
 
int main (int argc, char *argv[])
 
void move_firewall (object *ob)
 
static void print_map (char **layout, int width, int height)
 
static void print_quickhelp (void)
 
static void print_usage (void)
 
void rod_adjust (object *rod)
 
void set_darkness_map (mapstruct *m)
 
void set_map_timeout (mapstruct *oldmap)
 
static void test_layout (int width, int height, char **(*layout_func)(int, int, int, int))
 

Variables

static layout layout_list [NROFLAYOUTS]
 

Detailed Description

Command-line interface to the map generator used to test layouts.

Definition in file main.cpp.

Macro Definition Documentation

◆ LO_NEWFILE

#define LO_NEWFILE   2

Definition at line 31 of file main.cpp.

Function Documentation

◆ apply_auto()

int apply_auto ( object op)

◆ apply_auto_fix()

◆ clean_tmp_files()

void clean_tmp_files ( void  )

Definition at line 351 of file main.cpp.

◆ dragon_ability_gain()

void dragon_ability_gain ( object ob,
int  x,
int  y 
)

Definition at line 365 of file main.cpp.

References guildjoin::ob, nlohmann::detail::void(), diamondslots::x, and diamondslots::y.

+ Here is the call graph for this function:

◆ draw_ext_info()

void draw_ext_info ( int  flags,
int  pri,
const object pl,
uint8_t  type,
uint8_t  subtype,
const char *  message 
)

Definition at line 308 of file main.cpp.

References flags, logfile, diamondslots::message, altar_valkyrie::pl, is_valid_types_gen::type, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ draw_ext_info_format()

void draw_ext_info_format ( int  flags,
int  pri,
const object pl,
uint8_t  type,
uint8_t  subtype,
const char *  format,
  ... 
)

Definition at line 318 of file main.cpp.

References flags, logfile, altar_valkyrie::pl, is_valid_types_gen::type, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ emergency_save()

void emergency_save ( int  x)

Definition at line 347 of file main.cpp.

References nlohmann::detail::void(), and diamondslots::x.

+ Here is the call graph for this function:

◆ esrv_del_item()

void esrv_del_item ( player pl,
object ob 
)

Definition at line 381 of file main.cpp.

References guildjoin::ob, altar_valkyrie::pl, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ esrv_send_item()

void esrv_send_item ( object ob,
object obx 
)

Definition at line 354 of file main.cpp.

References guildjoin::ob, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ esrv_update_item()

void esrv_update_item ( int  flags,
object pl,
object op 
)

Definition at line 359 of file main.cpp.

References flags, give::op, altar_valkyrie::pl, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ esrv_update_spells()

void esrv_update_spells ( player pl)

Definition at line 386 of file main.cpp.

References altar_valkyrie::pl, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ ext_info_map()

void ext_info_map ( int  color,
const mapstruct map,
uint8_t  type,
uint8_t  subtype,
const char *  str1 
)

Definition at line 334 of file main.cpp.

References smoking_pipe::color, logfile, disinfect::map, is_valid_types_gen::type, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ find_skill_by_number()

object* find_skill_by_number ( object who,
int  skillno 
)

Definition at line 375 of file main.cpp.

References nlohmann::detail::void(), and autojail::who.

+ Here is the call graph for this function:

◆ generate_map()

static void generate_map ( char *  OutFileName)
static

Definition at line 33 of file main.cpp.

References generate_random_map(), init_globals(), init_gods(), init_library(), init_readable(), LO_NEWFILE, load_parameters(), save_map(), SAVE_MODE_INPLACE, RMParms::Xsize, and RMParms::Ysize.

Referenced by main().

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

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 156 of file main.cpp.

References layout::func, generate_map(), make_face_from_files::int, layout_list, give::name, NROFLAYOUTS, print_quickhelp(), print_usage(), roguelike_layout_gen(), and test_layout().

+ Here is the call graph for this function:

◆ move_firewall()

void move_firewall ( object ob)

Definition at line 343 of file main.cpp.

References guildjoin::ob, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ print_map()

static void print_map ( char **  layout,
int  width,
int  height 
)
static

Print the human-readable layout of a map.

Definition at line 60 of file main.cpp.

Referenced by test_layout().

+ Here is the caller graph for this function:

◆ print_quickhelp()

static void print_quickhelp ( void  )
static

Print a message stating how to get help.

Definition at line 128 of file main.cpp.

Referenced by main().

+ Here is the caller graph for this function:

◆ print_usage()

static void print_usage ( void  )
static

Print out usage information.

Definition at line 133 of file main.cpp.

Referenced by main().

+ Here is the caller graph for this function:

◆ rod_adjust()

void rod_adjust ( object rod)

Definition at line 390 of file main.cpp.

References nlohmann::detail::void().

+ Here is the call graph for this function:

◆ set_darkness_map()

void set_darkness_map ( mapstruct m)

Definition at line 371 of file main.cpp.

References m, and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ set_map_timeout()

void set_map_timeout ( mapstruct oldmap)

Definition at line 304 of file main.cpp.

References nlohmann::detail::void().

+ Here is the call graph for this function:

◆ test_layout()

static void test_layout ( int  width,
int  height,
char **(*)(int, int, int, int)  layout_func 
)
static

Test the map layout produced by the specified generator.

Parameters
widthMap width
heightMap height
layout_funcThe layout method to use.

Definition at line 113 of file main.cpp.

References print_map(), and SRANDOM.

Referenced by main().

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

Variable Documentation

◆ layout_list

layout layout_list[NROFLAYOUTS]
static
Initial value:
= {
{ "rogue", &roguelike_layout_gen },
{ "snake", &make_snake_layout },
{ "sspiral", &make_square_spiral_layout },
{ "spiral", &map_gen_spiral },
{ "maze", &maze_gen },
{ "onion", &map_gen_onion }
}

Definition at line 89 of file main.cpp.

Referenced by main().

map_gen_onion
char ** map_gen_onion(int xsize, int ysize, int option, int layers)
Definition: room_gen_onion.cpp:70
roguelike_layout_gen
char ** roguelike_layout_gen(int xsize, int ysize, int options, int _unused_layers)
Definition: rogue_layout.cpp:309
make_square_spiral_layout
char ** make_square_spiral_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
Definition: square_spiral.cpp:80
maze_gen
char ** maze_gen(int xsize, int ysize, int option, int _unused_layers)
Definition: maze_gen.cpp:59
map_gen_spiral
char ** map_gen_spiral(int xsize, int ysize, int option, int _unused_layers)
Definition: room_gen_spiral.cpp:62
make_snake_layout
char ** make_snake_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
Definition: snake.cpp:36