Vanilla Development Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS update: Vanilla/ntserv



Date:	Friday March 24, 2000 @ 13:55
Author:	karthik

Update of /home/netrek/cvsroot/Vanilla/ntserv
In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv23781

Modified Files:
	commands.c genspkt.c ntscmds.c proto.h 
Log Message:
Changes to support a 'whois' command.


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

Index: Vanilla/ntserv/commands.c
diff -u Vanilla/ntserv/commands.c:1.4 Vanilla/ntserv/commands.c:1.5
--- Vanilla/ntserv/commands.c:1.4	Thu Jun 17 01:45:53 1999
+++ Vanilla/ntserv/commands.c	Fri Mar 24 13:55:15 2000
@@ -159,6 +159,7 @@
 int do_client_query();
 int do_ping_query();
 int do_stats_query();
+int do_whois_query();
 #endif
 
 #if (defined(AUTO_INL) && defined(INL)) || (defined(BASEP) && defined(AUTO_PRACTICE)) || (defined(AUTO_HOCKEY) && defined(PUCK)) || (defined(AUTO_DOGFIGHT) && defined (DOG))
@@ -192,6 +193,10 @@
 		C_PLAYER,
 		"Show player's stats during t-mode. Ex: 'STATS 0'",
 		do_stats_query },		/* STATS */
+    { "WHOIS",
+		C_PLAYER,
+		"Show a player's login info. Ex: 'WHOIS 0'",
+		do_whois_query },		/* WHOIS */
 #endif
 
 #if defined (DOG) || defined(PUCK)		/***** DOG & PUCK commands */
@@ -1390,6 +1395,15 @@
 int who;
 {
       send_query('?', who, mess->m_from); 
+}
+
+/* ARGSUSED */
+do_whois_query(comm,mess,who)
+char *comm;
+struct message *mess;
+int who;
+{
+      send_query('@', who, mess->m_from);
 }
 
 #ifdef RSA
Index: Vanilla/ntserv/genspkt.c
diff -u Vanilla/ntserv/genspkt.c:1.14 Vanilla/ntserv/genspkt.c:1.15
--- Vanilla/ntserv/genspkt.c:1.14	Sun Mar 19 03:20:02 2000
+++ Vanilla/ntserv/genspkt.c	Fri Mar 24 13:55:15 2000
@@ -1443,7 +1443,8 @@
 #endif
     if (*cchar == '^' && *(cchar+1) == '\0')
 	return bounceSBStats(msg->m_from);
-
+	if (*cchar == '@' && *(cchar+1) == '\0')
+	return bounceWhois(msg->m_from);
 
     /* DEBUG */
     if (strcmp(cchar, "debug")==0){
Index: Vanilla/ntserv/ntscmds.c
diff -u Vanilla/ntserv/ntscmds.c:1.8 Vanilla/ntserv/ntscmds.c:1.9
--- Vanilla/ntserv/ntscmds.c:1.8	Sun Jul 11 22:25:31 1999
+++ Vanilla/ntserv/ntscmds.c	Fri Mar 24 13:55:15 2000
@@ -1,4 +1,4 @@
-/* $Id: ntscmds.c,v 1.8 1999/07/12 03:25:31 cameron Exp $
+/* $Id: ntscmds.c,v 1.9 2000/03/24 19:55:15 karthik Exp $
  */
 
 /*
@@ -68,6 +68,7 @@
 void do_ping_query(char *comm, struct message *mess, int who);
 void do_stats_query(char *comm, struct message *mess, int who);
 void do_sbstats_query(char *comm, struct message *mess, int who);
+void do_whois_query(char *comm, struct message *mess, int who);
 
 /********* COMMANDS LIST ********
 	Note: - The commands *must* be in upper case. All commands are
@@ -98,6 +99,10 @@
 		C_PLAYER,
 		"Show player's stats during t-mode. Ex: 'STATS 0'",
 		do_stats_query },		/* STATS */
+    { "WHOIS",
+		C_PLAYER,
+		"Show a user's player and login info. Ex: 'WHOIS 0'",
+		do_whois_query },		/* WHOIS */
 #ifdef ALLOW_PAUSE
     { "PAUSE",
                 0,
@@ -317,6 +322,12 @@
       send_query('?', who, mess->m_from); 
 }
 
+/* ARGSUSED */
+void do_whois_query(char *comm, struct message *mess, int who)
+{
+      send_query('@', who, mess->m_from); 
+}
+
 #ifdef RSA
 int bounceRSAClientType(int from)
 {
@@ -508,6 +519,12 @@
     return 1;
 }
 #endif
+
+int bounceWhois(int from)
+{
+    bounce(from, "%s is %s (%s@%s)", me->p_mapchars, me->p_name, me->p_login, me->p_full_hostname);
+    return 1;
+}
 
 
 /* ARGSUSED */
Index: Vanilla/ntserv/proto.h
diff -u Vanilla/ntserv/proto.h:1.3 Vanilla/ntserv/proto.h:1.4
--- Vanilla/ntserv/proto.h:1.3	Fri Feb 25 21:44:00 2000
+++ Vanilla/ntserv/proto.h	Fri Mar 24 13:55:15 2000
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.3 2000/02/26 03:44:00 unbelver Exp $
+/* $Id: proto.h,v 1.4 2000/03/24 19:55:15 karthik Exp $
  *
  * Function prototypes for externally accessed functions.
  */
@@ -119,6 +119,7 @@
 #ifdef RSA
 int bounceRSAClientType(int from);
 #endif
+int bounceWhois(int from);
 int check_command(struct message *mess);
 
 /* openmem.c */