[CF-Devel] Improvements to 'tell' and 'reply' commands
crossfire-devel at archives.real-time.com
crossfire-devel at archives.real-time.com
Wed Aug 25 13:03:06 CDT 2004
Here are two small improvements to the commands 'tell' and 'reply':
The patch tell.diff enables you to talk to players with ambiguous names:
Currently you can't talk to (for example) 'abc' if both 'abc' and
'abcII' are currently logged in. This patch prefers exact matches over
prefix/case-folded matches.
The patch reply.diff allows you to reply to players that logged out but
did not yet drop the connection. (The current situation is somewhat
inconsistent: 'talk' does work but 'reply' does not work.)
-------------- next part --------------
Index: server/player.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/player.c,v
retrieving revision 1.151
diff -w -c -5 -r1.151 player.c
*** server/player.c 13 Jun 2004 17:30:38 -0000 1.151
--- server/player.c 25 Aug 2004 17:47:53 -0000
***************
*** 59,68 ****
--- 59,71 ----
for ( pl = first_player; pl != NULL; pl = pl->next )
{
if ( strlen( pl->ob->name ) < namelen )
continue;
+ if ( !strcmp( pl->ob->name, plname) )
+ return pl;
+
if ( !strncasecmp( pl->ob->name, plname, namelen ) )
{
if ( found )
return NULL;
-------------- next part --------------
Index: server/player.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/player.c,v
retrieving revision 1.151
diff -w -c -5 -r1.151 player.c
*** server/player.c 13 Jun 2004 17:30:38 -0000 1.151
--- server/player.c 25 Aug 2004 17:47:53 -0000
***************
*** 43,53 ****
player *find_player(char *plname)
{
player *pl;
for(pl=first_player;pl!=NULL;pl=pl->next)
{
! if(pl->ob != NULL && !QUERY_FLAG(pl->ob,FLAG_REMOVED) && !strcmp(query_name(pl->ob),plname))
return pl;
};
return NULL;
}
--- 43,53 ----
player *find_player(char *plname)
{
player *pl;
for(pl=first_player;pl!=NULL;pl=pl->next)
{
! if(pl->ob != NULL && !strcmp(query_name(pl->ob),plname))
return pl;
};
return NULL;
}
-------------- next part --------------
_______________________________________________
crossfire-devel mailing list
crossfire-devel at lists.real-time.com
https://mailman.real-time.com/mailman/listinfo/crossfire-devel
More information about the crossfire
mailing list