gboolean update (TBUnreadCount *tbunreadcount) { int newDelay = tbunreadcount->prefs->delay; if(newDelay > 0 && newDelay != tbunreadcount->currentDelay) { start_update(tbunreadcount); return FALSE; } load_prefs(tbunreadcount->applet, tbunreadcount->prefs); update_display(tbunreadcount->hud, tbunreadcount->prefs); return TRUE; }
//***************************************************************************** // initialization //***************************************************************************** void init_persistent(void) { p_to_save = newList(); auxiliariesInstall("persistent_data", newAuxiliaryFuncs(AUXILIARY_TYPE_ROOM, newPersistentData, deletePersistentData, persistentDataCopyTo, persistentDataCopy, persistentDataStore,persistentDataRead)); // start our flushing of persistent rooms that need to be saved start_update(NULL, 1, flush_persistent_rooms_event, NULL,NULL,NULL); // // disabled until a better implementation is written. // // start_update(NULL, 1, close_unused_rooms_event, NULL,NULL,NULL); // listen for objects and characters entering // or leaving rooms. Update those rooms' statuses hookAdd("char_to_room", update_persistent_char_to_room); hookAdd("char_from_room", update_persistent_char_from_room); hookAdd("obj_to_room", update_persistent_obj_to_room); hookAdd("obj_from_room", update_persistent_obj_from_room); hookAdd("obj_from_obj", update_persistent_obj_from_obj); hookAdd("obj_to_obj", update_persistent_obj_to_obj); hookAdd("room_from_game", update_persistent_room_from_game); hookAdd("room_change", update_persistent_room_change); // add accessibility to Python /* PyRoom_addMethod("add_activity", PyRoom_addActivity, METH_NOARGS, NULL); PyRoom_addMethod("rem_activity", PyRoom_remActivity, METH_NOARGS, NULL); */ PyRoom_addMethod("dirty", PyRoom_dirtyPersistence, METH_NOARGS,NULL); PyRoom_addMethod("unload", PyRoom_unloadPersistence, METH_NOARGS,NULL); PyRoom_addGetSetter("persistent", PyRoom_getpersistent, PyRoom_setpersistent, NULL); }
gboolean tbunreadcount_applet_fill (PanelApplet *applet, const gchar *iid, gpointer data) { if (strcmp (iid, "OAFIID:TBUnreadCountApplet") != 0) return FALSE; initialize_prefs(applet); TBUnreadCount *tbunreadcount = g_new0(TBUnreadCount, 1); tbunreadcount->applet = applet; tbunreadcount->hud = malloc(sizeof(HUD)); init_display(tbunreadcount->hud, applet); tbunreadcount->prefs = malloc(sizeof(Prefs)); load_prefs(tbunreadcount->applet, tbunreadcount->prefs); start_update(tbunreadcount); return TRUE; }
void regenStartHook(const char *hook_info) { CHAR_DATA *ch = NULL; hookParseInfo(hook_info, &ch); //log_string("Hooked character entry, starting regen for %s.", charGetName(ch)); start_update(ch, HEAL_PULSE_RATE SECONDS, event_heal, NULL, NULL, NULL); }