Crossfire Server, Branches 1.12
R18729
|
#include "includes.h"
#include "face.h"
#include "attack.h"
#include "material.h"
#include "living.h"
#include "object.h"
#include "map.h"
#include "tod.h"
#include "skills.h"
#include "newserver.h"
#include "player.h"
#include "treasure.h"
#include "commands.h"
#include "book.h"
#include "ob_methods.h"
#include "ob_types.h"
#include "artifact.h"
#include "god.h"
#include "race.h"
#include "recipe.h"
#include "spells.h"
#include "stringbuffer.h"
#include "libproto.h"
#include "sockproto.h"
#include "typesproto.h"
#include "plugin.h"
Go to the source code of this file.
Data Structures | |
struct | linked_char |
struct | Settings |
struct | Statistics |
Macros | |
#define | CALLOC(x, y) calloc(x, y) |
#define | CFREE(x) free(x) |
#define | decrease_ob(xyz) decrease_ob_nr(xyz, 1) |
#define | dirent direct |
#define | EXTERN extern |
#define | FREE_AND_CLEAR(xyz) { free((void *)xyz); xyz = NULL; } |
#define | FREE_AND_CLEAR_STR(xyz) { free_string(xyz); xyz = NULL; } |
#define | FREE_AND_COPY(sv, nv) { if (sv) free_string(sv); sv = add_string(nv); } |
#define | GET_ANIM_ID(ob) (ob->temp_animation_id ? ob->temp_animation_id : ob->animation_id) |
#define | GET_ANIMATION(ob, anim) (ob->temp_animation_id ? animations[ob->temp_animation_id].faces[anim] : animations[ob->animation_id].faces[anim]) |
#define | GETTIMEOFDAY(last_time) gettimeofday(last_time); |
#define | NAMLEN(dirent) (dirnet)->d_namlen |
#define | NROF_COMPRESS_METHODS 4 |
#define | NUM_ANIMATIONS(ob) (ob->temp_animation_id ? animations[ob->temp_animation_id].num_animations : animations[ob->animation_id].num_animations) |
#define | NUM_FACINGS(ob) (ob->temp_animation_id ? animations[ob->temp_animation_id].facings : animations[ob->animation_id].facings) |
#define | ROTATE_RIGHT(c) if ((c)&01) (c) = ((c)>>1)+0x80000000; else (c) >>= 1; |
#define | SCRIPT_FIX_ACTIVATOR 2 |
#define | SCRIPT_FIX_ALL 1 |
#define | SCRIPT_FIX_NOTHING 0 |
#define | SET_ANIMATION(ob, newanim) { if (ob->temp_animation_id) { ob->face = &new_faces[animations[ob->temp_animation_id].faces[newanim]]; } else { ob->face = &new_faces[animations[ob->animation_id].faces[newanim]]; } } |
#define | SINT16_MAX 32767 |
#define | SINT32_MAX 2147483647 |
#define | SINT8_MAX 127 |
#define | UINT16_MAX 65535 |
#define | UINT32_MAX 4294967295U |
#define | UINT8_MAX 255 |
Typedefs | |
typedef unsigned short | Fontindex |
typedef struct linked_char | linked_char |
typedef struct Settings | Settings |
typedef signed short | sint16 |
typedef signed int | sint32 |
typedef signed char | sint8 |
typedef const char * | sstring |
typedef struct Statistics | Statistics |
typedef unsigned short | uint16 |
typedef unsigned int | uint32 |
typedef unsigned char | uint8 |
Global definitions: u/sint8, things like that.
Definition in file global.h.
#define CALLOC | ( | x, | |
y | |||
) | calloc(x, y) |
Definition at line 295 of file global.h.
Referenced by expand_objects(), get_archetype_struct(), get_objectlink(), get_region_struct(), and parse_shop_string().
#define CFREE | ( | x | ) | free(x) |
Definition at line 296 of file global.h.
Referenced by free_player().
#define decrease_ob | ( | xyz | ) | decrease_ob_nr(xyz, 1) |
Definition at line 276 of file global.h.
Referenced by apply_map_builder(), check_inv(), command_use(), deep_swamp_type_process(), food_type_apply(), improve_armour(), improve_weapon(), improve_weapon_stat(), player_attack_door(), poison_type_apply(), potion_type_apply(), scroll_type_apply(), skillscroll_type_apply(), spellbook_type_apply(), treasure_type_apply(), write_note(), and write_scroll().
#define FREE_AND_CLEAR | ( | xyz | ) | { free((void *)xyz); xyz = NULL; } |
Definition at line 282 of file global.h.
Referenced by clear_object(), copy_object(), free_experience(), free_globals(), free_map(), free_newsocket(), free_object2(), merge_spell(), and metaserver2_init().
#define FREE_AND_CLEAR_STR | ( | xyz | ) | { free_string(xyz); xyz = NULL; } |
Definition at line 283 of file global.h.
Referenced by cast_invisible(), clear_object(), command_follow(), command_nowiz(), command_rename_item(), explode_bullet(), fix_stopped_arrow(), free_globals(), free_key_values(), free_object2(), make_visible(), process_players1(), receive_play_again(), sell_item(), set_ob_key_value_s(), set_spell_skill(), and summon_golem().
#define FREE_AND_COPY | ( | sv, | |
nv | |||
) | { if (sv) free_string(sv); sv = add_string(nv); } |
Definition at line 288 of file global.h.
Referenced by cast_create_town_portal(), cfapi_object_set_property(), change_treasure(), command_rename_item(), copy_message(), do_symptoms(), fix_flesh_item(), fix_generated_item(), kill_player(), move_creator(), move_symptom(), receive_player_name(), START_TEST(), tailor_god_spell(), use_oratory(), and wrong_password().
#define GET_ANIM_ID | ( | ob | ) | (ob->temp_animation_id ? ob->temp_animation_id : ob->animation_id) |
Definition at line 249 of file global.h.
Referenced by apply_changes_to_player(), common_process_projectile(), do_throw(), fix_generated_item(), and tear_down_wall().
#define GET_ANIMATION | ( | ob, | |
anim | |||
) | (ob->temp_animation_id ? animations[ob->temp_animation_id].faces[anim] : animations[ob->animation_id].faces[anim]) |
Definition at line 248 of file global.h.
Referenced by common_process_projectile(), and trap_show().
#define GETTIMEOFDAY | ( | last_time | ) | gettimeofday(last_time); |
Definition at line 442 of file global.h.
Referenced by animate(), enough_elapsed_time(), load_archetypes(), reset_sleep(), seconds(), and sleep_delta().
#define NAMLEN | ( | dirent | ) | (dirnet)->d_namlen |
Definition at line 308 of file global.h.
Referenced by help_topics().
#define NROF_COMPRESS_METHODS 4 |
Definition at line 201 of file global.h.
Referenced by check_path(), and open_and_uncompress().
#define NUM_ANIMATIONS | ( | ob | ) | (ob->temp_animation_id ? animations[ob->temp_animation_id].num_animations : animations[ob->animation_id].num_animations) |
Definition at line 255 of file global.h.
Referenced by animate_bomb(), animate_object(), animate_trigger(), animate_turning(), check_trigger(), do_throw(), fix_generated_item(), gate_type_process(), map2_add_ob(), move_hole(), tear_down_wall(), and trigger_type_process().
#define NUM_FACINGS | ( | ob | ) | (ob->temp_animation_id ? animations[ob->temp_animation_id].facings : animations[ob->animation_id].facings) |
Definition at line 256 of file global.h.
Referenced by animate_object().
#define ROTATE_RIGHT | ( | c | ) | if ((c)&01) (c) = ((c)>>1)+0x80000000; else (c) >>= 1; |
Definition at line 245 of file global.h.
Referenced by read_bmap_names(), and read_client_images().
#define SCRIPT_FIX_ACTIVATOR 2 |
Definition at line 449 of file global.h.
Referenced by do_throw().
#define SCRIPT_FIX_ALL 1 |
Definition at line 450 of file global.h.
Referenced by apply_container(), attack_ob_simple(), cftimer_process_event(), common_pre_ob_move_on(), drop_object(), hit_with_arrow(), kill_object(), kill_player(), manual_apply(), move_teleporter(), pick_up_object(), pray_at_altar(), talk_to_npc(), trigger_connected(), and write_note().
#define SCRIPT_FIX_NOTHING 0 |
Definition at line 451 of file global.h.
Referenced by free_object2(), player_changer_type_process(), process_object(), and stop_projectile().
#define SET_ANIMATION | ( | ob, | |
newanim | |||
) | { if (ob->temp_animation_id) { ob->face = &new_faces[animations[ob->temp_animation_id].faces[newanim]]; } else { ob->face = &new_faces[animations[ob->animation_id].faces[newanim]]; } } |
Definition at line 247 of file global.h.
Referenced by animate_bomb(), animate_object(), animate_trigger(), animate_turning(), cf_handle_type_apply(), cfapi_object_set_property(), check_trigger(), common_process_projectile(), do_throw(), fire_arch_from_position(), fire_bolt(), fire_bow(), fire_bullet(), fix_generated_item(), gate_type_process(), key_change_class(), key_roll_stat(), move_missile(), shuffle_attack(), tear_down_wall(), trapdoor_type_move_on(), trigger_connected(), trigger_type_process(), update_button(), and update_turn_face().
#define UINT32_MAX 4294967295U |
Definition at line 61 of file global.h.
Referenced by cost_string_from_value().
typedef struct linked_char linked_char |
typedef const char* sstring |
Strings that should be manipulated through add_string() and free_string().
typedef struct Statistics Statistics |
This is used for various performance tracking statistics, or just how often certain events are done. It is much better to use a common structure then variables about. Note that since these are often counters, I'm using uint64s - this may be overkill, but it is just a couple extra bytes. This is initialized/declared in common/init.c. Note that if it only contains integer values, very easy to initialize/clear it - just a memset.
Definition at line 238 of file global.h.
Referenced by fix_generated_item(), init_archetype_pointers(), and init_globals().
EXTERN Animations* animations |
Definition at line 241 of file global.h.
Referenced by apply_anim_suffix(), apply_changes_to_player(), esrv_send_animation(), CREResourcesWindow::fillAnimations(), free_all_anim(), init_anim(), init_globals(), malloc_info(), map2_add_ob(), CREFacePanel::setFace(), and try_find_animation().
EXTERN int animations_allocated |
Definition at line 242 of file global.h.
Referenced by init_anim(), and init_globals().
New_Face* blank_face |
Following can just as easily be pointers, but it is easier to keep them like this.
Definition at line 66 of file image.c.
Referenced by add_abilities(), animate_object(), CREUtils::artifactNode(), clear_object(), magic_mapping_mark(), magic_mapping_mark_recursive(), tear_down_wall(), update_position(), and write_rune().
EXTERN int bmaps_checksum |
Definition at line 242 of file global.h.
Referenced by read_bmap_names(), and send_image_info().
Definition at line 238 of file global.h.
Referenced by fix_generated_item(), and init_archetype_pointers().
New_Face * empty_face |
Definition at line 66 of file image.c.
Referenced by esrv_draw_look().
short freearr_x[SIZEOFFREE] |
X offset when searching around a spot.
Definition at line 75 of file object.c.
Referenced by animate_bomb(), animate_weapon(), apply_builder_floor(), apply_builder_remove(), apply_map_builder(), attempt_jump(), can_see_monsterP(), cast_cause_disease(), cast_cone(), cast_create_obj(), cast_light(), cast_polymorph(), cast_raise_dead_spell(), cast_spell(), cast_transfer(), change_object(), command_summon(), command_teleport(), common_process_projectile(), communicate(), compute_path(), counterspell(), CREAnimationControl::CREAnimationControl(), create_bomb(), dimension_door(), dispel_rune(), do_harvest(), do_skill_ident(), do_throw(), enter_map(), expand_sight(), explosion(), find_closest_monster(), find_dir(), find_doors_in_room_recursive(), find_enclosed_spot(), find_first_free_spot(), find_free_spot(), find_monster_in_room_recursive(), find_nearest_living_creature(), find_spot_in_room_recursive(), find_target_for_friendly_spell(), find_traps(), fire_bullet(), fix_summon_pet(), follow_owner(), forklightning(), free_object2(), gate_type_process(), get_pet_enemy(), get_pointed_target(), hideability(), hit_map(), hit_player(), keyplace(), magic_wall(), monster_use_bow(), move_aura(), move_ball_spell(), move_bolt(), move_cone(), move_golem(), move_ob(), move_player_attack(), move_player_mover(), move_swarm_spell(), path_to_player(), pet_move(), pick_arrow_target(), pick_lock(), place_chest(), place_exits(), place_fountain_with_specials(), place_monsters(), place_special_exit(), player_fire_bow(), probe(), process_players1(), push_ob(), put_a_monster(), remove_adjacent_doors(), remove_door(), remove_locked_door(), remove_trap(), roll_ob(), shop_mat_type_move_on(), singing(), skill_attack(), spell_find_dir(), stand_near_hostile(), steal(), summon_golem(), summon_object(), surround_by_doors(), teleport(), transfer_ob(), turn_one_transport(), use_oratory(), and write_rune().
short freearr_y[SIZEOFFREE] |
Y offset when searching around a spot.
Definition at line 81 of file object.c.
Referenced by animate_weapon(), apply_builder_floor(), apply_builder_remove(), apply_map_builder(), attempt_jump(), can_see_monsterP(), cast_cause_disease(), cast_cone(), cast_create_obj(), cast_light(), cast_polymorph(), cast_raise_dead_spell(), cast_spell(), cast_transfer(), change_object(), command_summon(), command_teleport(), common_process_projectile(), communicate(), compute_path(), counterspell(), CREAnimationControl::CREAnimationControl(), create_bomb(), dimension_door(), dispel_rune(), do_harvest(), do_skill_ident(), do_throw(), enter_map(), expand_sight(), explosion(), find_closest_monster(), find_dir(), find_doors_in_room_recursive(), find_enclosed_spot(), find_first_free_spot(), find_free_spot(), find_monster_in_room_recursive(), find_nearest_living_creature(), find_spot_in_room_recursive(), find_target_for_friendly_spell(), find_traps(), fire_bullet(), fix_summon_pet(), follow_owner(), forklightning(), free_object2(), gate_type_process(), get_pet_enemy(), get_pointed_target(), hideability(), hit_map(), hit_player(), keyplace(), magic_wall(), monster_use_bow(), move_aura(), move_ball_spell(), move_bolt(), move_cone(), move_golem(), move_ob(), move_player_attack(), move_player_mover(), move_swarm_spell(), path_to_player(), pet_move(), pick_arrow_target(), pick_lock(), place_chest(), place_exits(), place_fountain_with_specials(), place_monsters(), place_special_exit(), player_fire_bow(), probe(), process_players1(), push_ob(), put_a_monster(), remove_adjacent_doors(), remove_door(), remove_locked_door(), remove_trap(), roll_ob(), shop_mat_type_move_on(), singing(), skill_attack(), spell_find_dir(), stand_near_hostile(), steal(), summon_golem(), summon_object(), surround_by_doors(), teleport(), transfer_ob(), turn_one_transport(), use_oratory(), and write_rune().
int freedir[SIZEOFFREE] |
Direction we're pointing on this spot.
Definition at line 93 of file object.c.
Referenced by find_dir(), spell_find_dir(), and summon_object().
EXTERN long init_done |
Ignores signals until init_done is true.
Definition at line 210 of file global.h.
Referenced by fatal_signal(), init(), and init_races().
socket_struct* init_sockets |
Established connections for clients not yet playing. See the page on the login process for a description of its use.
Definition at line 68 of file init.c.
Referenced by block_until_new_connection(), and do_server().
int leftof_x[9] |
int leftof_y[9] |
uint32 max_time |
Gloabal variables:
Definition at line 46 of file time.c.
Referenced by command_speed(), enough_elapsed_time(), set_max_time(), sleep_delta(), and time_info().
int maxfree[SIZEOFFREE] |
Number of spots around a location, including that location (except for 0)
Definition at line 87 of file object.c.
Referenced by find_dir(), and find_free_spot().
New_Face* new_faces |
Definition at line 38 of file image.c.
Referenced by cfapi_object_set_property(), common_process_projectile(), esrv_send_face(), CREResourcesWindow::fillFaces(), send_image_sums(), set_object_face_main(), set_object_face_other(), transport_type_apply(), and trap_show().
EXTERN long nroferrors |
If it exceeds MAX_ERRORS, call fatal()
Definition at line 212 of file global.h.
Referenced by init_defaults(), LOG(), and server_main().
EXTERN int num_animations |
Definition at line 242 of file global.h.
Referenced by esrv_send_animation(), CREResourcesWindow::fillAnimations(), free_all_anim(), init_anim(), init_globals(), malloc_info(), CREFacePanel::setFace(), and try_find_animation().
uint32 pticks |
Used by various function to determine how often to save the character
?
Definition at line 56 of file time.c.
Referenced by check_login(), check_output_buffers(), do_some_living(), do_specials(), get_tod(), handle_newcs_player(), key_change_class(), log_time(), process_players1(), reset_sleep(), send_tick(), and time_info().
int rightof_x[9] |
int rightof_y[9] |
Definition at line 238 of file global.h.
Referenced by fix_generated_item(), init_archetype_pointers(), and init_globals().
Settings settings |
You unforunately need to looking in include/global.h to see what these correspond to.
Definition at line 48 of file init.c.
Referenced by add_me_cmd(), add_player_exp(), add_score(), apply_death_exp_penalty(), apply_special(), attack_ob_simple(), attempt_steal(), block_until_new_connection(), calc_perm_exp(), calc_skill_exp(), cast_create_town_portal(), cast_spell(), cctk_init_std_archetypes(), cctk_setdatadir(), cctk_setlog(), cfapi_system_directory(), check_exp_loss(), check_login(), check_pick(), checkbanned(), checkdm(), clean_tmp_files(), clear_object(), command_abil(), command_addexp(), command_banish(), command_create(), command_debug(), command_explore(), command_help(), command_loadtest(), command_nowiz(), command_patch(), command_players(), command_search_items(), command_title(), compile_info(), convert_item(), create_items_path(), create_overlay_pathname(), create_pathname(), create_template_pathname(), dead_player(), delete_character(), display_high_score(), display_motd(), dragon_eat_flesh(), dump_experience(), enter_exit(), enter_player_savebed(), enter_unique_map(), find_maps(), find_style(), fix_object(), forbid_play(), god_enchants_weapon(), help_topics(), hit_player(), i18n_init(), improve_armour(), improve_weapon(), init(), init_anim(), init_artifacts(), init_beforeplay(), init_book_archive(), init_experience(), init_formulae(), init_msgfile(), init_races(), init_regions(), init_server(), init_startup(), is_legal_2ways_exit(), key_change_class(), key_confirm_quit(), kill_object(), kill_player(), level_exp(), list_players(), load_archetypes(), load_materials(), load_settings(), load_treasures(), LOG(), main(), metaserver2_init(), metaserver_init(), metaserver_update(), pay_for_item(), pick_up_object(), player_lvl_adj(), process_events(), process_players1(), query_cost(), rangetostring(), read_bmap_names(), read_client_images(), read_face_data(), read_map_log(), read_smooth(), resurrect_player(), save_map(), save_player(), scroll_failure(), scroll_type_apply(), send_exp_table(), send_news(), send_rules(), server_main(), set_archetypes(), set_confdir(), set_csport(), set_daemon(), set_datadir(), set_debug(), set_dumpmon1(), set_dumpmon2(), set_dumpmon3(), set_dumpmon4(), set_dumpmon5(), set_dumpmon6(), set_dumpmon7(), set_dumpmon8(), set_dumpmon9(), set_dumpmont(), set_localdir(), set_logfile(), set_mapdir(), set_mondebug(), set_playerdir(), set_regions(), set_templatedir(), set_tmpdir(), set_treasures(), set_uniquedir(), show_skills(), SP_level_spellpoint_cost(), spell_failure(), spellbook_type_apply(), swap_map(), unset_debug(), verify_player(), write_book_archive(), write_map_log(), and write_scroll().
New_Face* smooth_face |
Definition at line 66 of file image.c.
Referenced by send_smooth().
Definition at line 238 of file global.h.
Referenced by init_archetype_pointers(), and init_globals().
Statistics statistics |
Definition at line 119 of file init.c.
Referenced by init_globals(), main(), merge_spell(), and ok_to_put_more().
EXTERN long trying_emergency_save |
True when emergency_save() is reached.
Definition at line 211 of file global.h.
Referenced by emergency_save(), init_globals(), and LOG().
const char* uncomp[NROF_COMPRESS_METHODS][3] |
This is a list of the suffix, uncompress and compress functions. Thus, if you have some other compress program you want to use, the only thing that needs to be done is to extended this. The first entry must be NULL - this is what is used for non compressed files.
Definition at line 593 of file porting.c.
Referenced by check_path(), and save_map().
EXTERN const char* undead_name |
Definition at line 239 of file global.h.
Referenced by deathstrike_living(), free_globals(), hit_player(), hit_with_one_attacktype(), init_globals(), and is_susceptible_to_disease().
EXTERN long warn_archetypes |
If true, write warnings when failing to find archetypes when loading from file.
Definition at line 208 of file global.h.
Referenced by arch_to_object(), find_archetype(), init_archetype_pointers(), init_globals(), and load_archetypes().