Fakename /[TAG]

@stiflerxx - Like I said, hercules and *athena handle fake names differently. In that diff, they are pulling the fakename as session data, where as hercules stores fakenames as a char.

I don't know the proper way to convert it as such so that " dstsd = fakename " in clif_process_WisProcess (I think thats the clif name).

 
But, I don't recommend editing char.h or char.c for this fix. The potential dmg far out weighs the gain :/
Thats it what fear come from.. well it will less trouble when money involved
default_heh.gif
since im have less on it i will take my time learning on it at least i have a good internet to put in good use
default_heh.gif
even if failing come to much to handle
default_pif.gif


Good with this diff I got through to the guild and party up!
just missing the PM researched a lot about and found nothing except this topic on eAthena
link:
http://eathena.ws/fo...-pm-and-others/
can you take the diff from ther an upload it here, im kind of forgot what email used when register there i have forgoten my password
default_swt3.gif


 
But, I don't recommend editing char.h or char.c for this fix. The potential dmg far out weighs the gain :/
Thats it what fear come from.. well it will less trouble when money involved
default_heh.gif
since im have less on it i will take my time learning on it at least i have a good internet to put in good use
default_heh.gif
even if failing come to much to handle
default_pif.gif


> 

Good with this diff I got through to the guild and party up!
just missing the PM researched a lot about and found nothing except this topic on eAthena
link:
http://eathena.ws/fo...-pm-and-others/
can you take the diff from ther an upload it here, im kind of forgot what email used when register there i have forgoten my password
default_swt3.gif
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);
 
sorry stupid browser make my post tripled please kindly delete it
errors in diff:
map.c:
c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(1810): warning C4013: 'mapit_first' undefined; assuming extern returning int

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(1810): warning C4013: 'mapit_exists' undefined; assuming extern returning int

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(1810): warning C4013: 'mapit_next' undefined; assuming extern returning int

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(1833): warning C4013: 'mapit_free' undefined; assuming extern returning int

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(2200): error C2371: 'mapit_free' : redefinition; different basic types

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(2212): error C2040: 'mapit_first' : 'block_list *(s_mapiterator *)' differs in levels of indirection from 'int ()'

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(2246): error C2040: 'mapit_next' : 'block_list *(s_mapiterator *)' differs in levels of indirection from 'int ()'

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(2287): error C2371: 'mapit_exists' : redefinition; different basic types

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(6214): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(s_mapiterator *)'

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(6215): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'block_list *(__cdecl *)(s_mapiterator *)'

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(6215): warning C4047: '=' : 'block_list *(__cdecl *)(s_mapiterator *)' differs in levels of indirection from 'int (__cdecl *)()'

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(6217): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'block_list *(__cdecl *)(s_mapiterator *)'

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(6217): warning C4047: '=' : 'block_list *(__cdecl *)(s_mapiterator *)' differs in levels of indirection from 'int (__cdecl *)()'

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(6219): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'bool (__cdecl *)(s_mapiterator *)'

c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.c(6219): warning C4133: '=' : incompatible types - from 'int (__cdecl *)()' to 'bool (__cdecl *)(s_mapiterator *)'
 
map.h:
c:usersjonhdownloadshercules-master (1)hercules-mastersrcmapmap.h(991): error C2032: 'map_fakename2sd' : function cannot be member of struct 'map_interface'
 
 site with error:
 
map.h:
struct map_session_data * map_fakename2sd(const char *fakenick); // For fakename extended support [Digos]
 
map.c:
line(1810):
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;

}

}
 
I help?
 
Ahh see, this was the part I was missing, the decleration of a session data fake name @.@; I'll try this again.

 
Back
Top