--- deliantra/server/include/sproto.h 2006/05/06 13:16:06 1.5 +++ deliantra/server/include/sproto.h 2006/12/19 15:30:01 1.30 @@ -1,4 +1,9 @@ /* alchemy.c */ +int need_identify (const object *obj); +int apply_shop_mat (object *shop_mat, object *op); +const char *cost_string_from_value(sint64 cost, int approx); +void pay_player (object *pl, sint64 amount); +sint64 pay_player_arch (object *pl, const char *arch, sint64 amount); void attempt_do_alchemy(object *caster, object *cauldron); int content_recipe_value(object *op); int numb_ob_inside(object *op); @@ -38,7 +43,7 @@ int apply_special(object *who, object *op, int aflags); int monster_apply_special(object *who, object *op, int aflags); int auto_apply(object *op); -void fix_auto_apply(mapstruct *m); +void fix_auto_apply(maptile *m); void eat_special_food(object *who, object *food); void apply_lighter(object *who, object *lighter); void scroll_failure(object *op, int failure, int power); @@ -76,7 +81,8 @@ object *get_connection_rune(object *pl, short x, short y); object *get_msg_book(object *pl, short x, short y); object *get_wall(struct mapdef *map, int x, int y); -void fix_walls(struct mapdef *map, int x, int y); +void fix_walls(maptile *map, int x, int y); +void fix_walls_around(maptile *map, int x, int y); void apply_builder_floor(object *pl, object *material, short x, short y); void apply_builder_wall(object *pl, object *material, short x, short y); void apply_builder_item(object *pl, object *item, short x, short y); @@ -155,9 +161,6 @@ void current_region_info(object *op); void current_map_info(object *op); int command_whereabouts(object *op, char *params); -int command_who(object *op, char *params); -void display_who_entry(object *op, player *pl, const char *format); -void get_who_escape_code_value(char *return_val, const char letter, player *pl); int command_afk(object *op, char *params); int command_malloc(object *op, char *params); int command_mapinfo(object *op, char *params); @@ -223,7 +226,7 @@ int command_west(object *op, char *params); int command_stay(object *op, char *params); /* c_new.c */ -int execute_newserver_command(object *pl, char *command); +void execute_newserver_command(object *pl, char *command); int command_run(object *op, char *params); int command_run_stop(object *op, char *params); int command_fire(object *op, char *params); @@ -258,9 +261,11 @@ int command_search_items(object *op, char *params); int command_rename_item(object *op, char *params); /* c_party.c */ +int same_party(partylist *a, partylist *b); partylist *get_firstparty(void); void remove_party(partylist *target_party); void obsolete_parties(void); +void add_kill_to_party(partylist *party, char *killer, char *dead, long exp); int confirm_party_password(object *op); void receive_party_password(object *op, char k); void send_party_message(object *op, char *msg); @@ -284,8 +289,6 @@ int command_save_overlay(object *op, char *params); int command_toggle_shout(object *op, char *params); int command_shutdown(object *op, char *params); -int command_goto(object *op, char *params); -int command_generate(object *op, char *params); int command_freeze(object *op, char *params); int command_arrest(object *op, char *params); int command_summon(object *op, char *params); @@ -329,10 +332,8 @@ void init_commands(void); CommFunc find_oldsocket_command(char *cmd); CommFunc find_oldsocket_command2(char *cmd); -int parse_string(object *op, char *str); -int parse_command(object *op, char *str); /* daemon.c */ -FILE *BecomeDaemon(char *filename); +FILE *BecomeDaemon(const char *filename); /* disease.c */ int move_disease(object *disease); int remove_symptoms(object *disease); @@ -422,7 +423,7 @@ racelink *find_racelink(const char *name); /* login.c */ void emergency_save(int flag); -void delete_character(const char *name, int new); +void delete_character(const char *name, int); int verify_player(const char *name, char *password); int check_name(player *me, const char *name); int create_savedir_if_needed(char *savedir); @@ -431,6 +432,7 @@ void copy_file(const char *filename, FILE *fpout); void check_login(object *op); /* main.c */ +void server_tick (); void version(object *op); void info_keys(object *op); void start_info(object *op); @@ -438,17 +440,14 @@ int check_password(char *typed, char *crypted); void enter_player_savebed(object *op); void leave_map(object *op); -void set_map_timeout(mapstruct *oldmap); +void set_map_timeout(maptile *oldmap); char *clean_path(const char *file); char *unclean_path(const char *src); void enter_exit(object *op, object *exit_ob); -void process_active_maps(void); -void process_players1(mapstruct *map); -void process_players2(mapstruct *map); -void process_events(mapstruct *map); +void process_events(); void clean_tmp_files(void); void cleanup(void); -void leave(player *pl, int draw_exit); +void leave(player *pl,int draw_exit); int forbid_play(void); void do_specials(void); int main(int argc, char **argv); @@ -486,8 +485,8 @@ void pace2_movev(object *ob); void pace2_moveh(object *ob); void rand_move(object *ob); -void check_earthwalls(object *op, mapstruct *m, int x, int y); -void check_doors(object *op, mapstruct *m, int x, int y); +void check_earthwalls(object *op, maptile *m, int x, int y); +void check_doors(object *op, maptile *m, int x, int y); void communicate(object *op, const char *txt); int talk_to_npc(object *op, object *npc, const char *txt); int talk_to_wall(object *pl, object *npc, const char *txt); @@ -501,14 +500,14 @@ int transfer_ob(object *op, int x, int y, int randomly, object *originator); int teleport(object *teleporter, uint8 tele_type, object *user); void recursive_roll(object *op, int dir, object *pusher); -int try_fit(object *op, mapstruct *m, int x, int y); +int try_fit(object *op, maptile *m, int x, int y); int roll_ob(object *op, int dir, object *pusher); int push_ob(object *who, int dir, object *pusher); /* pets.c */ object *get_pet_enemy(object *pet, rv_vector *rv); void terminate_all_pets(object *owner); -void remove_all_pets(mapstruct *map); -void follow_owner(object *ob, object *owner); +void remove_all_pets(maptile *map); +int follow_owner(object *ob, object *owner); void pet_move(object *ob); object *fix_summon_pet(archetype *at, object *op, int dir, int is_golem); void move_golem(object *op); @@ -525,7 +524,7 @@ void send_rules(const object *op); void send_news(const object *op); int playername_ok(const char *cp); -int add_player(NewSocket *ns); +int add_player(client *ns); archetype *get_player_archetype(archetype *at); object *get_nearest_player(object *mon); int path_to_player(object *mon, object *pl, unsigned mindiff); @@ -584,11 +583,9 @@ crossfire_plugin *plugins_find_plugin(const char *id); void plugins_display_list(object *op); void *cfapi_system_find_animation(int *type, ...); -void *cfapi_system_strdup_local(int *type, ...); +void *cfapi_system_strdup(int *type, ...); void *cfapi_system_register_global_event(int *type, ...); void *cfapi_system_unregister_global_event(int *type, ...); -void *cfapi_system_add_string(int *type, ...); -void *cfapi_system_remove_string(int *type, ...); void *cfapi_system_check_path(int *type, ...); void *cfapi_system_re_cmp(int *type, ...); void *cfapi_system_directory(int *type, ...); @@ -676,17 +673,19 @@ int trap_disarm(object *disarmer, object *trap, int risk, object *skill); void trap_adjust(object *trap, int difficulty); /* shop.c */ -double shopkeeper_approval(const mapstruct *map, const object *player); -uint64 query_cost(const object *tmp, object *who, int flag); +int get_payment(object *pl); +sint64 query_cost(const object *tmp, object *who, int flag); const char *query_cost_string(const object *tmp, object *who, int flag); -uint64 query_money(const object *op); -int pay_for_amount(uint64 to_pay, object *pl); +sint64 query_money(const object *op); +int pay_for_amount(sint64 to_pay, object *pl); int pay_for_item(object *op, object *pl); int can_pay(object *pl); -int get_payment(object *pl, object *op); void sell_item(object *op, object *pl); +double shopkeeper_approval(const maptile *map, const object *player); int describe_shop(const object *op); void shop_listing(object *op); +bool is_in_shop (object *o); +bool is_in_shop (maptile *map, int x, int y); /* skills.c */ int steal(object *op, int dir, object *skill); int pick_lock(object *pl, int dir, object *skill); @@ -715,8 +714,6 @@ void show_skills(object *op, const char *search); int use_skill(object *op, const char *string); int skill_attack(object *tmp, object *pl, int dir, const char *string, object *skill); -static int attack_hth(object *pl, int dir, const char *string, object *skill); -static int attack_melee_weapon(object *op, int dir, const char *string, object *skill); /* spell_attack.c */ void check_spell_knockback(object *op); void forklightning(object *op, object *tmp); @@ -786,7 +783,7 @@ void set_spell_skill(object *op, object *caster, object *spob, object *dest); void init_spells(void); void dump_spells(void); -void spell_effect(object *spob, int x, int y, mapstruct *map, object *originator); +void spell_effect(object *spob, int x, int y, maptile *map, object *originator); int min_casting_level(object *caster, object *spell); int caster_level(object *caster, object *spell); sint16 SP_level_spellpoint_cost(object *caster, object *spell, int flags); @@ -795,14 +792,14 @@ int SP_level_range_adjust(object *caster, object *spob); object *check_spell_known(object *op, const char *name); object *lookup_spell_by_name(object *op, const char *spname); -int reflwall(mapstruct *m, int x, int y, object *sp_op); +int reflwall(maptile *m, int x, int y, object *sp_op); int cast_create_obj(object *op, object *caster, object *new_op, int dir); -int ok_to_put_more(mapstruct *m, sint16 x, sint16 y, object *op, int immune_stop); +int ok_to_put_more(maptile *m, sint16 x, sint16 y, object *op, int immune_stop); int fire_arch_from_position(object *op, object *caster, sint16 x, sint16 y, int dir, object *spell); void regenerate_rod(object *rod); void drain_rod_charge(object *rod); object *find_target_for_friendly_spell(object *op, int dir); -int spell_find_dir(mapstruct *m, int x, int y, object *exclude); +int spell_find_dir(maptile *m, int x, int y, object *exclude); void put_a_monster(object *op, const char *monstername); int summon_hostile_monsters(object *op, int n, const char *monstername); void shuffle_attack(object *op, int change_face); @@ -818,11 +815,11 @@ void move_deep_swamp(object *op); /* swap.c */ void read_map_log(void); -void swap_map(mapstruct *map); +void swap_map(maptile *map); void check_active_maps(void); -mapstruct *map_least_timeout(char *except_level); +maptile *map_least_timeout(char *except_level); void swap_below_max(char *except_level); -int players_on_map(mapstruct *m, int show_all); +int players_on_map(maptile *m, int show_all); void flush_old_maps(void); /* time.c */ void remove_door(object *op); @@ -839,7 +836,7 @@ void animate_trigger(object *op); void move_hole(object *op); object *stop_item(object *op); -void fix_stopped_item(object *op, mapstruct *map, object *originator); +void fix_stopped_item(object *op, maptile *map, object *originator); object *fix_stopped_arrow(object *op); void move_arrow(object *op); void change_object(object *op); @@ -858,10 +855,10 @@ int cftimer_destroy(int id); int cftimer_find_free_id(void); /* weather.c */ -void set_darkness_map(mapstruct *m); +void set_darkness_map(maptile *m); void tick_the_clock(void); void init_weather(void); void weather_effect(const char *filename); -int worldmap_to_weathermap(int x, int y, int *wx, int *wy, mapstruct *m); -int real_world_temperature(int x, int y, mapstruct *m); +int worldmap_to_weathermap(int x, int y, int *wx, int *wy, maptile *m); +int real_world_temperature(int x, int y, maptile *m); int similar_direction(int a, int b);