tinko Posted April 8, 2013 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 30 Reputation: 3 Joined: 03/15/13 Last Seen: September 9, 2024 Share Posted April 8, 2013 (edited) int atcommand_showip(const int fd, struct map_session_data* sd, const char* command, const char* message) { char temp0[100]; struct map_session_data *pl_sd; struct s_mapiterator* iter; int j, count; int pl_GM_level, GM_level; char match_text[100]; char player_name[NAME_LENGTH]; char ip[16]; uint32 ipl; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(match_text, '\0', sizeof(match_text)); memset(player_name, '\0', sizeof(player_name)); if (sscanf(message, "%99[^\n]", match_text) < 1) strcpy(match_text, ""); for (j = 0; match_text[j]; j++) match_text[j] = TOLOWER(match_text[j]); count = 0; GM_level = pc_isGM(sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { pl_GM_level = pc_isGM(pl_sd); if(!( (battle_config.hide_GM_session || (pl_sd->sc.option & OPTION_INVISIBLE)) && pl_GM_level > GM_level )) { memcpy(player_name, pl_sd->status.name, NAME_LENGTH); for (j = 0; player_name[j]; j++) player_name[j] = TOLOWER(player_name[j]); if (strstr(player_name, match_text) != NULL) { if (battle_config.who_display_aid > 0 && pc_isGM(sd) >= battle_config.who_display_aid) { sprintf(atcmd_output, "(CID:%d/AID:%d) ", pl_sd->status.char_id, pl_sd->status.account_id); } else { atcmd_output[0]=0; } //Player name sprintf(temp0, msg_txt(333), pl_sd->status.name); strcat(atcmd_output,temp0); //Player title, if exists ipl = session[pl_sd->fd]->client_addr; ip2str(ipl, ip); sprintf(temp0, "| IP:%s | ", ip); strcat(atcmd_output,temp0); //Players Location: map x y sprintf(temp0, msg_txt(338), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); strcat(atcmd_output,temp0); clif_displaymessage(fd, atcmd_output); count++; } } } mapit_free(iter); if (count == 0) clif_displaymessage(fd, msg_txt(28)); // No player. else if (count == 1) clif_displaymessage(fd, msg_txt(29)); // 1 player. else { sprintf(atcmd_output, msg_txt(30), count); // %d players. clif_displaymessage(fd, atcmd_output); } return 0; } Can help me to fix it in rathena version? Thank in advance Edited April 8, 2013 by tinko Quote Link to comment Share on other sites More sharing options...
Emistry Posted April 8, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2371 Joined: 10/28/11 Last Seen: 23 hours ago Share Posted April 8, 2013 you can use this to view the IP address. @accinfo <name> or.. *getcharip({"<character name>"|<account id>|<char id>}) This function will return the IP address of the invoking character, or, if a player is specified, of that character. A blank string is returned if no player is attached. Quote Link to comment Share on other sites More sharing options...
Question
tinko
Can help me to fix it in rathena version?
Thank in advance
Edited by tinkoLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.