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

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.c.

Macro Definition Documentation

◆ LO_NEWFILE

#define LO_NEWFILE   2

Definition at line 32 of file main.c.

Function Documentation

◆ apply_auto()

int apply_auto ( object op)

Definition at line 212 of file main.c.

References CLEAR_FLAG, create_treasure(), FLAG_AUTO_APPLY, FLAG_CURSED, FLAG_DAMNED, FLAG_UNPAID, generate_treasure(), GT_ENVIRONMENT, HAS_RANDOM_ITEMS, identify(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), give::op, QUERY_FLAG, SET_FLAG, SHOP_FLOOR, Ice::tmp, and TREASURE.

Referenced by apply_auto_fix().

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

◆ apply_auto_fix()

◆ clean_tmp_files()

void clean_tmp_files ( void  )

Definition at line 352 of file main.c.

◆ dragon_ability_gain()

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

Definition at line 366 of file main.c.

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 309 of file main.c.

References flags, logfile, diamondslots::message, 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 319 of file main.c.

References flags, logfile, 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 348 of file main.c.

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 382 of file main.c.

References guildjoin::ob, 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 355 of file main.c.

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 360 of file main.c.

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

+ Here is the call graph for this function:

◆ esrv_update_spells()

void esrv_update_spells ( player pl)

Definition at line 387 of file main.c.

References 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 335 of file main.c.

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 376 of file main.c.

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 34 of file main.c.

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 157 of file main.c.

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 344 of file main.c.

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 61 of file main.c.

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 129 of file main.c.

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 134 of file main.c.

Referenced by main().

+ Here is the caller graph for this function:

◆ rod_adjust()

void rod_adjust ( object rod)

Definition at line 391 of file main.c.

References nlohmann::detail::void().

+ Here is the call graph for this function:

◆ set_darkness_map()

void set_darkness_map ( mapstruct m)

Definition at line 372 of file main.c.

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 305 of file main.c.

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 114 of file main.c.

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 90 of file main.c.

Referenced by main().

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