[CF-Devel] CVS update: crossfire/server

Crossfire CVS devel mwedel at scruznet.com
Mon Aug 7 00:16:34 CDT 2000


Date:	Sunday August 6, 2000 @ 22:16
Author:	cvs

Update of /home/cvs/CVS/crossfire/server
In directory boltzmann.eecs.berkeley.edu:/tmp/cvs-serv6595/server

Modified Files:
	c_object.c shop.c 
Log Message:
The following change basically does the following:  When the server sends an
item name to the client, this item name is now two pieces - the first piece
of the name is its singular form, the second piece is the plural name.  This
now makes items in the inventory appear more proper in terms of pluralization
and just normal English.  I did notice that the server does not know how
to properly make 'torch' plural - it turns it into torchs.  A matching
check in for the client has also been done.
include/newserver.h:  Update VERSION_SC to 1024
common/item.c: Change query_base_name to take a second option on whether
  we should generate a plural version of the name or not.
socket/item.c: Modify functions to use second argument on the query_base_name
  function.  Update item commands to send two part names (singular & plural).
  Modify esrv_send_look to use item1 protocol command instead of item command.
server/c_object.c: Update item_matched_string to use second option to
  query_base_name.  Modify function to check against both singular and
  plural versions of name.
server/shop.c: Modify shop_listing command usage in query_basename to use
  second option.  It will also generate the singular name, but that is only
  used on sorting, so I don't think it will generally cause any problems.
include/libproto.h:  rebuilt because query_base_name has an addition opt.
Mark Wedel 8/13/2000




****************************************

Index: crossfire/server/c_object.c
diff -u crossfire/server/c_object.c:1.9 crossfire/server/c_object.c:1.10
--- crossfire/server/c_object.c:1.9	Tue Jun 27 21:53:58 2000
+++ crossfire/server/c_object.c	Sun Aug  6 22:16:34 2000
@@ -1,10 +1,11 @@
 /*
  * static char *rcsid_c_object_c =
- *   "$Id: c_object.c,v 1.9 2000/06/28 04:53:58 cvs Exp $";
+ *   "$Id: c_object.c,v 1.10 2000/08/07 05:16:34 cvs Exp $";
  */
 /*
     CrossFire, A Multiplayer game for X-windows
 
+    Copyright (C) 2000 Mark Wedel
     Copyright (C) 1992 Frank Tore Johansen
 
     This program is free software; you can redistribute it and/or modify
@@ -116,9 +117,12 @@
 	}
 	if (!strcasecmp(cp,query_name(op))) retval=20;
 	else if (!strcasecmp(cp,query_short_name(op))) retval=18;
-	else if (!strcasecmp(cp,query_base_name(op))) retval=16;
-	else if (!strncasecmp(cp,query_base_name(op),
-		MIN(strlen(cp),strlen(query_base_name(op))))) retval=14;
+	else if (!strcasecmp(cp,query_base_name(op,0))) retval=16;
+	else if (!strcasecmp(cp,query_base_name(op,1))) retval=16;
+	else if (!strncasecmp(cp,query_base_name(op,0),
+		MIN(strlen(cp),strlen(query_base_name(op,0))))) retval=14;
+	else if (!strncasecmp(cp,query_base_name(op,1),
+		MIN(strlen(cp),strlen(query_base_name(op,1))))) retval=14;
 	if (retval) {
 	    pl->contr->count=count;
 	    return retval;
Index: crossfire/server/shop.c
diff -u crossfire/server/shop.c:1.5 crossfire/server/shop.c:1.6
--- crossfire/server/shop.c:1.5	Thu Jun  8 09:08:41 2000
+++ crossfire/server/shop.c	Sun Aug  6 22:16:34 2000
@@ -1,12 +1,12 @@
 /*
  * static char *rcsid_shop_c =
- *   "$Id: shop.c,v 1.5 2000/06/08 16:08:41 jec Exp $";
+ *   "$Id: shop.c,v 1.6 2000/08/07 05:16:34 cvs Exp $";
  */
 
 /*
     CrossFire, A Multiplayer game for X-windows
 
-    Copyright (C) 1994 Mark Wedel
+    Copyright (C) 2000 Mark Wedel
     Copyright (C) 1992 Frank Tore Johansen
 
     This program is free software; you can redistribute it and/or modify
@@ -23,7 +23,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    The author can be reached via e-mail to 
     
     master at rahul.net
     
     
+    The author can be reached via e-mail to 
     
     mwedel at scruz.net
     
     
 
 */
 
@@ -654,14 +654,14 @@
 	    case BOOTS:
 	    case GLOVES:
 	    case GIRDLE:
-		sprintf(buf,"%s %s",query_base_name(tmp),describe_item(tmp));
+		sprintf(buf,"%s %s",query_base_name(tmp,0),describe_item(tmp));
 	        items[numitems].item_sort = strdup_local(buf);
 		sprintf(buf,"%s %s",query_name(tmp),describe_item(tmp));
 	        items[numitems++].item_real = strdup_local(buf);
 		break;
 
 	    default:
-	        items[numitems].item_sort = strdup_local(query_base_name(tmp));
+	        items[numitems].item_sort = strdup_local(query_base_name(tmp, 0));
 	        items[numitems++].item_real = strdup_local(query_name(tmp));
 		break;
 	}

    
    


More information about the crossfire mailing list