00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <eggdrop/eggdrop.h>
00021 #include "core_binds.h"
00022
00042 static bind_table_t *BT_time = NULL;
00043
00059 static bind_table_t *BT_secondly = NULL;
00060
00075 static bind_table_t *BT_status = NULL;
00076
00090 static bind_table_t *BT_init = NULL;
00091
00105 static bind_table_t *BT_shutdown = NULL;
00106
00107 int core_binds_init(void)
00108 {
00109 BT_init = bind_table_add (BTN_CORE_INIT, 0, "", MATCH_NONE, BIND_STACKABLE);
00110 BT_shutdown = bind_table_add (BTN_CORE_SHUTDOWN, 0, "", MATCH_NONE, BIND_STACKABLE);
00111 BT_time = bind_table_add(BTN_CORE_TIME, 5, "iiiii", MATCH_MASK, BIND_STACKABLE);
00112 BT_secondly = bind_table_add(BTN_CORE_SECONDLY, 0, "", MATCH_NONE, BIND_STACKABLE);
00113 BT_status = bind_table_add(BTN_CORE_STATUS, 2, "Ps", MATCH_NONE, BIND_STACKABLE);
00114
00115 return (0);
00116 }
00117
00118 int core_binds_shutdown(void)
00119 {
00120 bind_table_del(BT_status);
00121 bind_table_del(BT_secondly);
00122 bind_table_del(BT_time);
00123 bind_table_del(BT_shutdown);
00124 bind_table_del(BT_init);
00125
00126 return (0);
00127 }
00128
00129 void check_bind_init(void)
00130 {
00131 egg_assert(BT_init != NULL);
00132
00133 bind_check (BT_init, NULL, NULL);
00134 }
00135
00136 void check_bind_shutdown (void)
00137 {
00138 egg_assert(BT_shutdown != NULL);
00139
00140 bind_check (BT_shutdown, NULL, NULL);
00141 }
00142
00143 void check_bind_time(struct tm *tm)
00144 {
00145 char full[32];
00146
00147 sprintf(full, "%02d %02d %02d %02d %04d", tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900);
00148 bind_check(BT_time, NULL, full, tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900);
00149 }
00150
00151 void check_bind_secondly()
00152 {
00153 bind_check(BT_secondly, NULL, NULL);
00154 }
00155
00156 void check_bind_status(partymember_t *p, const char *text)
00157 {
00158 bind_check(BT_status, NULL, NULL, p, text);
00159 }