diff options
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 2be990025..95db0c2e6 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -58,6 +58,7 @@ #include <string.h> struct atcommand_interface atcommand_s; +struct atcommand_interface *atcommand; static char atcmd_output[CHAT_SIZE_MAX]; static char atcmd_player_name[NAME_LENGTH]; @@ -83,7 +84,7 @@ const char* atcommand_msgsd(struct map_session_data *sd, int msg_number) { } const char* atcommand_msgfd(int fd, int msg_number) { - struct map_session_data *sd = session_isValid(fd) ? session[fd]->session_data : NULL; + struct map_session_data *sd = sockt->session_is_valid(fd) ? sockt->session[fd]->session_data : NULL; if( !(msg_number >= 0 && msg_number < MAX_MSG) ) return "??"; if( !sd || sd->lang_id >= atcommand->max_message_table || !atcommand->msg_table[sd->lang_id][msg_number] ) @@ -3676,7 +3677,7 @@ ACMD(reloadscript) { } mapit->free(iter); - flush_fifos(); + sockt->flush_fifos(); map->reloadnpc(true); // reload config files seeking for npcs script->reload(); npc->reload(); @@ -5244,11 +5245,11 @@ ACMD(skillid) { for (data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key)) { int idx = skill->get_index(DB->data2i(data)); - if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill->db[idx].desc, message, skillen) == 0) { - sprintf(atcmd_output, msg_fd(fd,1164), DB->data2i(data), skill->db[idx].desc, key.str); // skill %d: %s (%s) + if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill->dbs->db[idx].desc, message, skillen) == 0) { + sprintf(atcmd_output, msg_fd(fd,1164), DB->data2i(data), skill->dbs->db[idx].desc, key.str); // skill %d: %s (%s) clif->message(fd, atcmd_output); - } else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill->db[idx].desc,message) ) ) { - snprintf(partials[found], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_fd(fd,1164), DB->data2i(data), skill->db[idx].desc, key.str); + } else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill->dbs->db[idx].desc,message) ) ) { + snprintf(partials[found], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_fd(fd,1164), DB->data2i(data), skill->dbs->db[idx].desc, key.str); found++; } } @@ -5376,7 +5377,7 @@ ACMD(skilltree) { { if( ent->need[j].id && pc->checkskill(sd,ent->need[j].id) < ent->need[j].lv) { - sprintf(atcmd_output, msg_fd(fd,1170), ent->need[j].lv, skill->db[ent->need[j].id].desc); // Player requires level %d of skill %s. + sprintf(atcmd_output, msg_fd(fd,1170), ent->need[j].lv, skill->dbs->db[ent->need[j].id].desc); // Player requires level %d of skill %s. clif->message(fd, atcmd_output); meets = 0; } @@ -9306,7 +9307,7 @@ ACMD(cddebug) { const struct TimerData *td = timer->get(cd->entry[i]->timer); if( !td || td->func != skill->blockpc_end ) { - clif->messages(fd,"Found invalid entry in slot %d for skill %s",i,skill->db[cd->entry[i]->skidx].name); + clif->messages(fd,"Found invalid entry in slot %d for skill %s",i,skill->dbs->db[cd->entry[i]->skidx].name); sd->blockskill[cd->entry[i]->skidx] = false; } } @@ -9316,7 +9317,7 @@ ACMD(cddebug) { if( !cd || (message && *message && !strcmpi(message,"reset")) ) { for(i = 0; i < MAX_SKILL; i++) { if( sd->blockskill[i] ) { - clif->messages(fd,"Found skill '%s', unblocking...",skill->db[i].name); + clif->messages(fd,"Found skill '%s', unblocking...",skill->dbs->db[i].name); sd->blockskill[i] = false; } } @@ -10199,7 +10200,7 @@ bool atcommand_can_use2(struct map_session_data *sd, const char *command, AtComm bool atcommand_hp_add(char *name, AtCommandFunc func) { /* if commands are added after group permissions are thrown in, they end up with no permissions */ /* so we restrict commands to be linked in during boot */ - if( runflag == MAPSERVER_ST_RUNNING ) { + if( core->runflag == MAPSERVER_ST_RUNNING ) { ShowDebug("atcommand_hp_add: Commands can't be added after server is ready, skipping '%s'...\n",name); return false; } @@ -10231,7 +10232,7 @@ void atcommand_db_clear(void) { } void atcommand_doload(void) { - if( runflag >= MAPSERVER_ST_RUNNING ) + if( core->runflag >= MAPSERVER_ST_RUNNING ) atcommand->cmd_db_clear(); if( atcommand->db == NULL ) atcommand->db = stridb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, ATCOMMAND_LENGTH); |