--- deliantra/server/plugins/common/plugin_common.C 2006/09/03 08:05:39 1.2 +++ deliantra/server/plugins/common/plugin_common.C 2007/03/02 10:15:39 1.8 @@ -37,7 +37,6 @@ static f_plug_api cfapiSystem_register_global_event = NULL; static f_plug_api cfapiSystem_unregister_global_event = NULL; -static f_plug_api cfapiSystem_strdup_local = NULL; static f_plug_api cfapiSystem_find_animation = NULL; static f_plug_api cfapiMap_create_path = NULL; @@ -63,7 +62,7 @@ static f_plug_api cfapiObject_update = NULL; static f_plug_api cfapiObject_clear = NULL; static f_plug_api cfapiObject_reset = NULL; -static f_plug_api cfapiCheck_inventory = NULL; +/* static f_plug_api cfapiCheck_inventory = NULL; */ static f_plug_api cfapiObject_activate_rune = NULL; static f_plug_api cfapiObject_check_trigger = NULL; static f_plug_api cfapiObject_query_money = NULL; @@ -112,7 +111,6 @@ int cf_init_plugin( f_plug_api getHooks ) { int z; - GET_HOOK( cfapiSystem_strdup_local, "cfapi_system_strdup_local", z ); GET_HOOK( cfapiSystem_register_global_event, "cfapi_system_register_global_event", z ); GET_HOOK( cfapiSystem_unregister_global_event, "cfapi_system_unregister_global_event", z ); GET_HOOK( cfapiSystem_find_animation, "cfapi_system_find_animation", z ); @@ -182,13 +180,13 @@ } /* Should get replaced by tons of more explicit wrappers */ -void* cf_map_get_property(mapstruct* map, int propcode) +void* cf_map_get_property(maptile* map, int propcode) { int val; return cfapiMap_get_property(&val, propcode, map); } /* Should get replaced by tons of more explicit wrappers */ -void* cf_map_set_int_property(mapstruct* map, int propcode, int value) +void* cf_map_set_int_property(maptile* map, int propcode, int value) { int val; return cfapiMap_set_property(&val, map, propcode,value); @@ -268,19 +266,19 @@ /* return *(int*)cfapiObject_transfer(&val,op,1,x,y,op->map);*/ return *(int*)cfapiObject_transfer(&val,op,0,x,y,r,orig); } -int cf_object_change_map(object* op, int x, int y, mapstruct* map) +int cf_object_change_map(object* op, int x, int y, maptile* map) { int val; return *(int*)cfapiObject_transfer(&val,op,1,x,y,map); /*cfapiObject_transfer(&val,op,1,x,y,map); return 0;*/ } -object* cf_map_get_object_at(mapstruct* m, int x, int y) +object* cf_map_get_object_at(maptile* m, int x, int y) { int val; return (object*) cfapiMap_get_object_at(&val, m, x, y); } -void cf_map_message(mapstruct* m, char* msg, int color) +void cf_map_message(maptile* m, char* msg, int color) { int val; cfapiMap_message(&val, m, msg, color); @@ -363,15 +361,15 @@ cfapiObject_set_property(&val, op, CFAPI_PLAYER_PROP_PARTY, party); } -mapstruct* cf_map_get_map( char* name ) +maptile* cf_map_get_map( char* name ) { int val; - return (mapstruct*) cfapiMap_get_map( &val, 1, name, 0); + return (maptile*) cfapiMap_get_map( &val, 1, name, 0); } -mapstruct* cf_map_get_first(void) +maptile* cf_map_get_first(void) { int val; - return (mapstruct*) cfapiMap_get_map( &val, 3); + return (maptile*) cfapiMap_get_map( &val, 3); } int cf_object_query_money( object* op) { @@ -396,8 +394,7 @@ } int cf_object_out_of_map( object* op, int x, int y) { - int val; - return *(int*)cfapiObject_out_of_map(&val,op->map,x,y); + abort (); } void cf_object_drop( object* op, object* author) { @@ -567,28 +564,28 @@ return (object*) cfapiObject_insert( &type, ob, 3, where ); } -object* cf_map_insert_object_there(mapstruct* where, object* op, object* originator, int flags) +object* cf_map_insert_object_there(maptile* where, object* op, object* originator, int flags) { int val; return (object*)cfapiObject_insert(&val, op, 1, where, originator, flags); } -object* cf_map_insert_object(mapstruct* where , object* op, int x, int y) +object* cf_map_insert_object(maptile* where , object* op, int x, int y) { int type; return (object*) cfapiObject_insert( &type, op, 0, where, NULL, 0 , x, y); } -int cf_object_teleport( object* op, mapstruct* map, int x, int y ) +int cf_object_teleport( object* op, maptile* map, int x, int y ) { int val; return *( int* )cfapiObject_teleport( &val, op, map, x, y ); } -object* cf_map_present_arch_by_name(const char* str, mapstruct* map, int nx, int ny) +object* cf_map_present_arch_by_name(const char* str, maptile* map, int nx, int ny) { int val; return (object*)cfapiMap_present_arch_by_name(&val, str,map,nx,ny); } -static int cf_get_map_int_property(mapstruct* map, int property) +static int cf_get_map_int_property(maptile* map, int property) { int type; void* rv; @@ -598,87 +595,87 @@ return *(int*)rv; } -int cf_map_get_difficulty(mapstruct* map) +int cf_map_get_difficulty(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_DIFFICULTY); } -int cf_map_get_reset_time(mapstruct* map) +int cf_map_get_reset_time(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_RESET_TIME); } -int cf_map_get_reset_timeout(mapstruct* map) +int cf_map_get_reset_timeout(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_RESET_TIMEOUT); } -int cf_map_get_players(mapstruct* map) +int cf_map_get_players(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_PLAYERS); } -int cf_map_get_darkness(mapstruct* map) +int cf_map_get_darkness(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_DARKNESS); } -int cf_map_get_width(mapstruct* map) +int cf_map_get_width(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_WIDTH); } -int cf_map_get_height(mapstruct* map) +int cf_map_get_height(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_HEIGHT); } -int cf_map_get_enter_x(mapstruct* map) +int cf_map_get_enter_x(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_ENTER_X); } -int cf_map_get_enter_y(mapstruct* map) +int cf_map_get_enter_y(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_ENTER_Y); } -int cf_map_get_temperature(mapstruct* map) +int cf_map_get_temperature(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_TEMPERATURE); } -int cf_map_get_pressure(mapstruct* map) +int cf_map_get_pressure(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_PRESSURE); } -int cf_map_get_humidity(mapstruct* map) +int cf_map_get_humidity(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_HUMIDITY); } -int cf_map_get_windspeed(mapstruct* map) +int cf_map_get_windspeed(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_WINDSPEED); } -int cf_map_get_winddir(mapstruct* map) +int cf_map_get_winddir(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_WINDDIR); } -int cf_map_get_sky(mapstruct* map) +int cf_map_get_sky(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_SKY); } -int cf_map_get_wpartx(mapstruct* map) +int cf_map_get_wpartx(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_WPARTX); } -int cf_map_get_wparty(mapstruct* map) +int cf_map_get_wparty(maptile* map) { return cf_get_map_int_property(map,CFAPI_MAP_PROP_WPARTY); } @@ -693,12 +690,11 @@ int val; cfapiObject_pickup(&val, op, what); } -char* cf_strdup_local(char* txt) +char* cf_strdup(char* txt) { - int val; - return (char*)cfapiSystem_strdup_local(&val, txt); + return (char*)strdup(txt); } -int cf_map_get_flags( mapstruct* map, mapstruct** nmap, sint16 x, sint16 y, sint16* nx, sint16* ny ) +int cf_map_get_flags( maptile* map, maptile** nmap, sint16 x, sint16 y, sint16* nx, sint16* ny ) { int val; return *( int* )cfapiMap_get_flags(&val, map, nmap, x, y, nx, ny); @@ -828,22 +824,3 @@ int val; return (const char*) cfapiRegion_get_property(&val, reg, CFAPI_REGION_PROP_MESSAGE); } - -#ifdef WIN32 -int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info) -{ - /* Get the time, if they want it */ - if (time_Info != NULL) { - time_Info->tv_sec = time(NULL); - time_Info->tv_usec = timeGetTime()*1000; - } - /* Get the timezone, if they want it */ - if (timezone_Info != NULL) { - _tzset(); - timezone_Info->tz_minuteswest = _timezone; - timezone_Info->tz_dsttime = _daylight; - } - /* And return */ - return 0; -} -#endif