diff --git src/map/clif.c src/map/clif.c
index d913047..be805cf 100644
--- src/map/clif.c
+++ src/map/clif.c
@@ -9920,6 +9920,8 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
char *target, *message;
int namelen, messagelen;
+ char fake_output[254]; // Fake name support [Digos]
+
// validate packet and retrieve name and message
if( !clif_process_message(sd, 1, &target, &namelen, &message, &messagelen) )
return;
@@ -10005,6 +10007,16 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
// searching destination character
dstsd = map_nick2sd(target);
+
+ // If no name was found check for a fake name [Digos]
+ if (dstsd == NULL) {
+ dstsd = map_fakename2sd(target);
+ // player found
+ if (dstsd != NULL) {
+ // update target with the real player name
+ strcpy(target,dstsd->status.name);
+ }
+ }
if (dstsd == NULL || strcmp(dstsd->status.name, target) != 0)
{
@@ -11531,6 +11547,11 @@ void clif_parse_PartyInvite2(int fd, struct map_session_data *sd)
t_sd = map_nick2sd(name);
+ // If no name was found check for a fake name [Digos]
+ if (t_sd == NULL) {
+ t_sd = map_fakename2sd(name);
+ }
+
if(t_sd && t_sd->state.noask)
{// @noask [LuzZza]
clif_noask_sub(sd, t_sd, 1);
@@ -12714,6 +12735,12 @@ void clif_parse_GMRc(int fd, struct map_session_data* sd)
struct map_session_data* dstsd;
name[23] = '0';
dstsd = map_nick2sd(name);
+
+ // If no name was found check for a fake name [Digos]
+ if (dstsd == NULL) {
+ dstsd = map_fakename2sd(name);
+ }
+
if( dstsd == NULL )
return;
@@ -13079,6 +13106,11 @@ void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd)
f_sd = map_nick2sd((char*)RFIFOP(fd,2));
+ // If no name was found check for a fake name [Digos]
+ if (f_sd == NULL) {
+ f_sd = map_fakename2sd((char*)RFIFOP(fd,2));
+ }
+
// Friend doesn't exist (no player with this name)
if (f_sd == NULL) {
clif_displaymessage(fd, msg_txt(3));
@@ -13637,7 +13669,14 @@ void clif_parse_Check(int fd, struct map_session_data *sd)
safestrncpy(charname, (const char*)RFIFOP(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]), sizeof(charname));
- if( ( pl_sd = map_nick2sd(charname) ) == NULL || pc_isGM(sd) < pc_isGM(pl_sd) )
+ pl_sd = map_nick2sd(charname);
+
+ // If no name was found check for a fake name [Digos]
+ if (pl_sd == NULL) {
+ pl_sd = map_fakename2sd(charname);
+ }
+
+ if( pl_sd == NULL || pc_isGM(sd) < pc_isGM(pl_sd) )
{
return;
}
diff --git src/map/intif.c src/map/intif.c
index 92deeec..16ce227 100644
--- src/map/intif.c
+++ src/map/intif.c
@@ -823,6 +823,12 @@ int intif_parse_WisMessage(int fd)
safestrncpy(name, (char*)RFIFOP(fd,32), NAME_LENGTH);
sd = map_nick2sd(name);
+
+ // If no name was found check for a fake name [Digos]
+ if (sd == NULL) {
+ sd = map_fakename2sd(name);
+ }
+
if(sd == NULL || strcmp(sd->status.name, name) != 0)
{ //Not found
intif_wis_replay(id,1);
@@ -857,6 +863,12 @@ int intif_parse_WisEnd(int fd)
if (battle_config.etc_log)
ShowInfo("intif_parse_wisend: player: %s, flag: %dn", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
sd = (struct map_session_data *)map_nick2sd((char *) RFIFOP(fd,2));
+
+ // If no name was found check for a fake name [Digos]
+ if (sd == NULL) {
+ sd = (struct map_session_data *)map_fakename2sd((char *) RFIFOP(fd,2));
+ }
+
if (sd != NULL)
clif_wis_end(sd->fd, RFIFOB(fd,26));
diff --git src/map/map.c src/map/map.c
index 9616b15..2b97b99 100644
--- src/map/map.c
+++ src/map/map.c
@@ -1748,6 +1748,56 @@ struct map_session_data * map_nick2sd(const char *nick)
}
/*==========================================
+ * copy of the above function to search
+ * for a fake name [Digos]
+ *------------------------------------------*/
+struct map_session_data * map_fakename2sd(const char *fakenick)
+{
+ struct map_session_data* sd;
+ struct map_session_data* found_sd;
+ struct s_mapiterator* iter;
+ size_t fakenicklen;
+ int qty = 0;
+
+ if( fakenick == NULL )
+ return NULL;
+
+ fakenicklen = strlen(fakenick);
+ iter = mapit_getallusers();
+
+ found_sd = NULL;
+ for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
+ {
+ if( battle_config.partial_name_scan )
+ {// partial name search
+ if( strnicmp(sd->fakename, fakenick, fakenicklen) == 0 )
+ {
+ found_sd = sd;
+
+ if( strcmp(sd->fakename, fakenick) == 0 )
+ {// Perfect Match
+ qty = 1;
+ break;
+ }
+
+ qty++;
+ }
+ }
+ else if( strcasecmp(sd->fakename, fakenick) == 0 )
+ {// exact search only
+ found_sd = sd;
+ break;
+ }
+ }
+ mapit_free(iter);
+
+ if( battle_config.partial_name_scan && qty != 1 )
+ found_sd = NULL;
+
+ return found_sd;
+}
+
+/*==========================================
* id”Ô?‚Ì•¨‚ð’T‚·
* ˆêŽObject‚Ìꇂ͔z—ñ‚ðˆø‚‚Ì‚Ý
*------------------------------------------*/
diff --git src/map/map.h src/map/map.h
index 93b9697..6fc64e4 100644
--- src/map/map.h
+++ src/map/map.h
@@ -617,6 +617,7 @@ void map_foreachnpc(int (*func)(struct npc_data* nd, va_list args), ...);
void map_foreachregen(int (*func)(struct block_list* bl, va_list args), ...);
void map_foreachiddb(int (*func)(struct block_list* bl, va_list args), ...);
struct map_session_data * map_nick2sd(const char*);
+struct map_session_data * map_fakename2sd(const char *fakenick); // For fakename extended support [Digos]
struct mob_data * map_getmob_boss(int m);
struct mob_data * map_id2boss(int id);