From 71627e92fbe36c23993456486a308acd0428fd3d Mon Sep 17 00:00:00 2001 From: Susu Date: Tue, 25 Jun 2013 14:12:21 +0200 Subject: - Added chrif interface --- src/map/map.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index 74e2c74e0..ee56f140f 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1566,7 +1566,7 @@ void map_reqnickdb(struct map_session_data * sd, int charid) CREATE(req, struct charid_request, 1); req->next = p->requests; p->requests = req; - chrif_searchcharid(charid); + chrif->searchcharid(charid); } /*========================================== @@ -1629,11 +1629,11 @@ int map_quit(struct map_session_data *sd) { int i; if(!sd->state.active) { //Removing a player that is not active. - struct auth_node *node = chrif_search(sd->status.account_id); + struct auth_node *node = chrif->search(sd->status.account_id); if (node && node->char_id == sd->status.char_id && node->state != ST_LOGOUT) //Except when logging out, clear the auth-connect data immediately. - chrif_auth_delete(node->account_id, node->char_id, node->state); + chrif->auth_delete(node->account_id, node->char_id, node->state); //Non-active players should not have loaded any data yet (or it was cleared already) so no additional cleanups are needed. return 0; } @@ -1728,7 +1728,7 @@ int map_quit(struct map_session_data *sd) { party->booking_delete(sd); // Party Booking [Spiria] pc->makesavestatus(sd); pc->clean_skilltree(sd); - chrif_save(sd,1); + chrif->save(sd,1); unit_free_pc(sd); return 0; } @@ -1790,7 +1790,7 @@ const char* map_charid2nick(int charid) if( *p->nick ) return p->nick;// name in nick_db - chrif_searchcharid(charid);// request the name + chrif->searchcharid(charid);// request the name return NULL; } @@ -3354,13 +3354,13 @@ int map_config_read(char *cfgName) { if( msg_silent ) // only bother if its actually enabled ShowInfo("Console Silent Setting: %d\n", atoi(w2)); } else if (strcmpi(w1, "userid")==0) - chrif_setuserid(w2); + chrif->setuserid(w2); else if (strcmpi(w1, "passwd") == 0) - chrif_setpasswd(w2); + chrif->setpasswd(w2); else if (strcmpi(w1, "char_ip") == 0) - char_ip_set = chrif_setip(w2); + char_ip_set = chrif->setip(w2); else if (strcmpi(w1, "char_port") == 0) - chrif_setport(atoi(w2)); + chrif->setport(atoi(w2)); else if (strcmpi(w1, "map_ip") == 0) map_ip_set = clif->setip(w2); else if (strcmpi(w1, "bind_ip") == 0) @@ -5018,12 +5018,12 @@ void do_final(void) ShowStatus("Cleaned up %d maps."CL_CLL"\n", iMap->map_num); id_db->foreach(id_db,cleanup_db_sub); - chrif_char_reset_offline(); - chrif_flush_fifo(); + chrif->char_reset_offline(); + chrif->flush_fifo(); atcommand->final(); battle->final(); - do_final_chrif(); + chrif->do_final_chrif(); ircbot->final();/* before clif. */ clif->final(); do_final_npc(); @@ -5075,7 +5075,7 @@ void do_final(void) static int map_abort_sub(struct map_session_data* sd, va_list ap) { - chrif_save(sd,1); + chrif->save(sd,1); return 1; } @@ -5093,7 +5093,7 @@ void do_abort(void) return; } run = 1; - if (!chrif_isconnected()) + if (!chrif->isconnected()) { if (pc_db->size(pc_db)) ShowFatalError("Server has crashed without a connection to the char-server, %u characters can't be saved!\n", pc_db->size(pc_db)); @@ -5101,7 +5101,7 @@ void do_abort(void) } ShowError("Server received crash signal! Attempting to save all online characters!\n"); iMap->map_foreachpc(map_abort_sub); - chrif_flush_fifo(); + chrif->flush_fifo(); } /*====================================================== @@ -5161,7 +5161,7 @@ void do_shutdown(void) mapit->free(iter); flush_fifos(); } - chrif_check_shutdown(); + chrif->check_shutdown(); } } @@ -5233,6 +5233,7 @@ void map_hp_symbols(void) { HPM->share(bg,"battlegrounds"); HPM->share(buyingstore,"buyingstore"); HPM->share(clif,"clif"); + HPM->share(chrif,"chrif"); HPM->share(guild,"guild"); HPM->share(gstorage,"gstorage"); HPM->share(homun,"homun"); @@ -5266,6 +5267,7 @@ void load_defaults(void) { battleground_defaults(); buyingstore_defaults(); clif_defaults(); + chrif_defaults(); guild_defaults(); gstorage_defaults(); homunculus_defaults(); @@ -5398,7 +5400,7 @@ int do_init(int argc, char *argv[]) // loads npcs iMap->reloadnpc(false); - chrif_checkdefaultlogin(); + chrif->checkdefaultlogin(); if (!map_ip_set || !char_ip_set) { char ip_str[16]; @@ -5416,7 +5418,7 @@ int do_init(int argc, char *argv[]) if (!map_ip_set) clif->setip(ip_str); if (!char_ip_set) - chrif_setip(ip_str); + chrif->setip(ip_str); } battle->config_read(iMap->BATTLE_CONF_FILENAME); @@ -5461,7 +5463,7 @@ int do_init(int argc, char *argv[]) atcommand->init(); battle->init(); instance->init(); - do_init_chrif(); + chrif->do_init_chrif(); clif->init(); ircbot->init(); script->init(); -- cgit v1.2.3-60-g2f50