ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/plugins/cfperl/cfperl.xs
(Generate patch)

Comparing deliantra/server/plugins/cfperl/cfperl.xs (file contents):
Revision 1.9 by root, Sat Feb 4 16:17:47 2006 UTC vs.
Revision 1.10 by root, Sat Feb 4 20:38:29 2006 UTC

51 51
52static f_plug_api gethook; 52static f_plug_api gethook;
53static f_plug_api registerGlobalEvent; 53static f_plug_api registerGlobalEvent;
54static f_plug_api unregisterGlobalEvent; 54static f_plug_api unregisterGlobalEvent;
55static f_plug_api systemDirectory; 55static f_plug_api systemDirectory;
56static f_plug_api object_set_property;
56 57
57typedef struct 58typedef struct
58{ 59{
59 object* who; 60 object* who;
60 object* activator; 61 object* activator;
334 printf (PLUGIN_VERSION " post init\n"); 335 printf (PLUGIN_VERSION " post init\n");
335 336
336 registerGlobalEvent = gethook (&rtype, hooktype, "cfapi_system_register_global_event"); 337 registerGlobalEvent = gethook (&rtype, hooktype, "cfapi_system_register_global_event");
337 unregisterGlobalEvent = gethook (&rtype, hooktype, "cfapi_system_unregister_global_event"); 338 unregisterGlobalEvent = gethook (&rtype, hooktype, "cfapi_system_unregister_global_event");
338 systemDirectory = gethook (&rtype, hooktype, "cfapi_system_directory"); 339 systemDirectory = gethook (&rtype, hooktype, "cfapi_system_directory");
340 object_set_property = gethook (&rtype, hooktype, "cfapi_object_set_property");
339 cf_init_plugin (gethook); 341 cf_init_plugin (gethook);
340 342
341 /* Pick the global events you want to monitor from this plugin */ 343 /* Pick the global events you want to monitor from this plugin */
342 registerGlobalEvent (NULL, EVENT_BORN, PLUGIN_NAME, globalEventListener); 344 registerGlobalEvent (NULL, EVENT_BORN, PLUGIN_NAME, globalEventListener);
343 registerGlobalEvent (NULL, EVENT_CLOCK, PLUGIN_NAME, globalEventListener); 345 registerGlobalEvent (NULL, EVENT_CLOCK, PLUGIN_NAME, globalEventListener);
1067 cf_object_set_int_property (obj, idx, SvIV (newval)); 1069 cf_object_set_int_property (obj, idx, SvIV (newval));
1068 break; 1070 break;
1069 case CFAPI_LONG: 1071 case CFAPI_LONG:
1070 cf_object_set_long_property (obj, idx, SvNV (newval)); 1072 cf_object_set_long_property (obj, idx, SvNV (newval));
1071 break; 1073 break;
1074 case CFAPI_DOUBLE:
1075 {
1076 int unused_type;
1077 object_set_property (&unused_type, obj, idx, (double)SvNV (newval));
1078 }
1079 break;
1072 case CFAPI_STRING: 1080 case CFAPI_STRING:
1073 cf_object_set_string_property (obj, idx, SvPV_nolen (newval)); 1081 cf_object_set_string_property (obj, idx, SvPV_nolen (newval));
1074 break; 1082 break;
1075 default: 1083 default:
1076 croak ("unhandled type '%d' in set_property '%d'", type, idx); 1084 croak ("unhandled type '%d' in set_property '%d'", type, idx);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines