diff options
| author | Franklin Wei <git@fwei.tk> | 2016-03-24 21:45:47 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-03-24 21:45:47 -0400 |
| commit | eb8b5907df2cf3c4b593197d40d10e83e6943ee3 (patch) | |
| tree | e19b5d3ee90e7d29b5975ad05496b2ab1385ad15 /src/room.h | |
| parent | a91f858ebaea0f403b2c59773e619086b9198a39 (diff) | |
| download | netcosm-eb8b5907df2cf3c4b593197d40d10e83e6943ee3.zip netcosm-eb8b5907df2cf3c4b593197d40d10e83e6943ee3.tar.gz netcosm-eb8b5907df2cf3c4b593197d40d10e83e6943ee3.tar.bz2 netcosm-eb8b5907df2cf3c4b593197d40d10e83e6943ee3.tar.xz | |
fix for drop bug
Diffstat (limited to 'src/room.h')
| -rw-r--r-- | src/room.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -28,9 +28,9 @@ are added by hooks in rooms, which are provided by the world module. */ -typedef enum room_id { ROOM_NONE = -1 } room_id; +typedef struct child_data user_t; // definition of child_data in server.h -typedef struct child_data user_t; +typedef enum room_id { ROOM_NONE = -1 } room_id; enum direction_t { DIR_N = 0, DIR_NE, DIR_E, DIR_SE, DIR_S, DIR_SW, DIR_W, DIR_NW, DIR_UP, DIR_DN, DIR_IN, DIR_OT, NUM_DIRECTIONS }; @@ -46,8 +46,12 @@ struct roomdata_t { const char * const adjacent[NUM_DIRECTIONS]; void (* const hook_init)(room_id id); - void (* const hook_enter)(room_id room, user_t *user); - void (* const hook_leave)(room_id room, user_t *user); + + /* return values indicate permission to enter/leave, + * setting to NULL defaults to true. + */ + bool (* const hook_enter)(room_id room, user_t *user); + bool (* const hook_leave)(room_id room, user_t *user); void (* const hook_serialize)(room_id room, int fd); void (* const hook_deserialize)(room_id room, int fd); void (* const hook_destroy)(room_id room); @@ -88,6 +92,7 @@ bool room_obj_add_alias(room_id room, struct object_t *obj, char *alias); bool room_obj_del(room_id room, const char *name); bool room_obj_del_alias(room_id room, struct object_t *obj, const char *alias); +bool room_obj_del_by_ptr(room_id room, struct object_t *obj); const struct multimap_list *room_obj_get(room_id room, const char *obj); const struct multimap_list *room_obj_get_size(room_id room, const char *name, size_t *n_objs); |