Example #1
0
/* -------------------------------------------------------------------------- *
 * Module hooks                                                               *
 * -------------------------------------------------------------------------- */
int lc_cookie_load(void)
{
  if(hook_register(lclient_login, HOOK_DEFAULT, lc_cookie_hook) == NULL)
    return -1;

  hook_register(lclient_release, HOOK_DEFAULT, lc_cookie_release);

  lc_cookie_seed = timer_mtime;

  lc_cookie_msg = msg_find("PONG");

  if(lc_cookie_msg == NULL)
  {
    log(lclient_log, L_warning, "You need to load m_pong.so before this module");

    return -1;
  }

  lc_cookie_msg->handlers[MSG_UNREGISTERED] = mr_pong;

  mem_static_create(&lc_cookie_heap, sizeof(struct lc_cookie),
                    LCLIENT_BLOCK_SIZE / 4);
  mem_static_note(&lc_cookie_heap, "cookie heap");

  return 0;
}
Example #2
0
/* -------------------------------------------------------------------------- *
 * Initialize the chanmode module                                             *
 * -------------------------------------------------------------------------- */
void chanmode_init(void)
{
  chanmode_log = log_source_register("chanmode");

  memset(chanmode_table, 0, sizeof(chanmode_table));

  mem_static_create(&chanmode_heap, sizeof(struct chanmodechange),
                    CHANMODE_BLOCK_SIZE);
  mem_static_note(&chanmode_heap, "chanmode change heap");

  mem_static_create(&chanmode_item_heap, sizeof(struct chanmodeitem),
                    CHANMODE_BLOCK_SIZE);
  mem_static_note(&chanmode_item_heap, "chanmode modelist heap");

  ircd_support_set("MAXBANS", "%u", IRCD_MAXBANS);
  ircd_support_set("MODES", "%u", IRCD_MODESPERLINE);

  log(chanmode_log, L_status, "Initialised [chanmode] module.");
}
Example #3
0
File: dlink.c Project: rsenn/tichu
/* -------------------------------------------------------------------------- *
 * Initialize block heap for the dlink nodes                                  *
 * -------------------------------------------------------------------------- */
void dlink_init(void)
{
  dlink_log = log_source_register("dlink");
  
  dlink_count = 0;
  dlink_linked = 0;
  
  mem_static_create(&dlink_heap, sizeof(struct node), DLINK_BLOCK_SIZE);
  mem_static_note(&dlink_heap, "dlink node heap");
  
  log(dlink_log, L_status, "Initialized [dlink] module.");
}
Example #4
0
File: class.c Project: rsenn/tichu
/* -------------------------------------------------------------------------- *
 * Initialize channel heaps and add garbage collect timer.                    *
 * -------------------------------------------------------------------------- */
void class_init(void)
{
  class_log = log_source_register("class");
  
  class_id = 0;
  
  dlink_list_zero(&class_list);
  
  mem_static_create(&class_heap, sizeof(struct class), CLASS_BLOCK_SIZE);
  mem_static_note(&class_heap, "class heap");

  log(class_log, L_status, "Initialized [class] module.");
}
Example #5
0
File: player.c Project: rsenn/tichu
/* -------------------------------------------------------------------------- *
 * Initialize game heaps and add garbage collect timer.                       *
 * -------------------------------------------------------------------------- */
void player_init(void)
{
  player_log = log_source_register("game");

  player_id = 0;
  player_serial = 0;
  
  dlink_list_zero(&player_list);
  
  mem_static_create(&player_heap, sizeof(struct player),
                    PLAYER_BLOCK_SIZE);
  mem_static_note(&player_heap, "game heap");
  
  player_seed = timer_mtime;

  log(player_log, L_status, "Initialised [player] module.");
}