home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sources / games / 282 / patches01
Encoding:
Text File  |  1992-12-16  |  17.7 KB  |  667 lines

  1. diff -c -w ./oldxtb/Makefile ./newxtb/Makefile
  2. *** ./oldxtb/Makefile    Mon Dec 14 12:13:16 1992
  3. --- ./newxtb/Makefile    Wed Dec 16 11:08:33 1992
  4. ***************
  5. *** 6,24 ****
  6.   CC = cc
  7.   # wherever your X11 include files are 
  8.   XINCS = -I/usr/openwin/include
  9.   
  10.   SOURCES =  xtb.c rtb.c xtbd.c dgram.c common.c
  11.   INCLUDES = defs.h comms.h
  12.   MISC = xtb.6 README TODO
  13.   
  14.   rtb    : rtb.o dgram.o common.o
  15. !     $(CC) -o rtb rtb.o dgram.o common.o -lm
  16.   
  17.   xtb    : xtb.o dgram.o common.o
  18. !     $(CC) -o xtb xtb.o dgram.o common.o -lX11 -lm
  19.   
  20.   xtbd    : xtbd.o dgram.o common.o
  21. !     $(CC) -o xtbd  xtbd.o dgram.o common.o -lm
  22.   
  23.   xtb.o : xtb.c $(INCLUDES)
  24.       cc -c xtb.c $(XINCS)
  25. --- 6,29 ----
  26.   CC = cc
  27.   # wherever your X11 include files are 
  28.   XINCS = -I/usr/openwin/include
  29. + XLIBS = -L/usr/openwin/lib
  30.   
  31. + # HP-UX users may want to add -lBSD to the next line.
  32. + LDOPTS = -lm
  33. + #LDOPTS = -lm -lBSD
  34.   SOURCES =  xtb.c rtb.c xtbd.c dgram.c common.c
  35.   INCLUDES = defs.h comms.h
  36.   MISC = xtb.6 README TODO
  37.   
  38.   rtb    : rtb.o dgram.o common.o
  39. !     $(CC) -o rtb rtb.o dgram.o common.o $(LDOPTS)
  40.   
  41.   xtb    : xtb.o dgram.o common.o
  42. !     $(CC) -o xtb xtb.o dgram.o common.o $(XLIBS) -lX11 $(LDOPTS)
  43.   
  44.   xtbd    : xtbd.o dgram.o common.o
  45. !     $(CC) -o xtbd  xtbd.o dgram.o common.o $(LDOPTS)
  46.   
  47.   xtb.o : xtb.c $(INCLUDES)
  48.       cc -c xtb.c $(XINCS)
  49. diff -c -w ./oldxtb/README ./newxtb/README
  50. *** ./oldxtb/README    Mon Dec 14 12:13:05 1992
  51. --- ./newxtb/README    Wed Dec 16 16:31:29 1992
  52. ***************
  53. *** 1,3 ****
  54. --- 1,4 ----
  55. + README FILE FOR XTANKBATTLE                             15th Dec 1992
  56.   
  57.   WHAT YOU NEED TO HAVE
  58.   =====================
  59. ***************
  60. *** 9,15 ****
  61.   
  62.   A three button mouse (It's playable with a two button mouse). 
  63.   
  64. ! A fastish (and unloaded) CPU and reasonable drawing speed.
  65.   
  66.   A fastish network.
  67.   
  68. --- 10,17 ----
  69.   
  70.   A three button mouse (It's playable with a two button mouse). 
  71.   
  72. ! A fastish (and unloaded) CPU and reasonable drawing speed. (X terminals
  73. ! may have problems)
  74.   
  75.   A fastish network.
  76.   
  77. ***************
  78. *** 40,45 ****
  79. --- 42,50 ----
  80.   COMPILING
  81.   =========
  82.   
  83. + You may need to edit the Makefile to point to where your X11 include files
  84. + and X11 librarys live.
  85.   Type
  86.       make
  87.   
  88. ***************
  89. *** 57,67 ****
  90.       workstation% xtb -h hostname
  91.       (ignore messages about datagrams and fielddata)
  92.       
  93.   RUNNING TWO (OR MORE) PLAYERS ON THE SAME NODE
  94.   ==============================================
  95.   
  96. ! The second and further players, should pick different port numbers to
  97. ! the default (and each other).  eg the second player might type
  98.   
  99.       workstation% xtb -h hostname -i 1624
  100.   
  101. --- 62,76 ----
  102.       workstation% xtb -h hostname
  103.       (ignore messages about datagrams and fielddata)
  104.       
  105. + (It seems that on HP-UX if you want to refer to your own host, you must
  106. + use the hostname 'localhost')
  107.   RUNNING TWO (OR MORE) PLAYERS ON THE SAME NODE
  108.   ==============================================
  109.   
  110. ! For second and further players *on the same workstation*, should pick
  111. ! different port numbers to the default (and each other).  eg the second
  112. ! player might type
  113.   
  114.       workstation% xtb -h hostname -i 1624
  115.   
  116. ***************
  117. *** 182,187 ****
  118. --- 191,220 ----
  119.   
  120.   The program comes with no warranty.  I would like the conditions that
  121.   apply to GNU software to apply to this software.
  122. + Bugs fixed in version 8
  123. + =======================
  124. + Now works on hosts with hostnames of up to 63 chars.
  125. + xtbd now works on HP-UX, (used to fail with 'Alarm clock')
  126. + You are now notified immediatly when your damage is zeroed when you kill
  127. +     another player (Fixed by Jonathan Bayer (jbayer@ispi.COM))
  128. + Now works properly on NCD X terminuals (Fixed by Martin Boyer
  129. +     (mboyer@ireq-robot.hydro.qc.ca))
  130. + There is a work around (in this REAME file) for the problem with using
  131. + your own host for xtb and xtbd on HP-UX. 
  132. + I have now changed the README file to make it more obvious when you need
  133. + to specify port numbers to xtb/rtb/xtbd.  (ie.  you shouldn't need to in
  134. + most cases)
  135. + Note that version 7 programs won't work with version 8 programs.
  136. + If you mail me about problems/bug-reports/suggestions for improvement,
  137. + please say what type of machine you are using, which revision of the
  138. + operating system, and what verson of X-windows you are using. 
  139.   
  140.   Good Luck!
  141.   
  142. diff -c -w ./oldxtb/comms.h ./newxtb/comms.h
  143. *** ./oldxtb/comms.h    Mon Dec 14 12:13:18 1992
  144. --- ./newxtb/comms.h    Wed Dec 16 11:08:17 1992
  145. ***************
  146. *** 1,7 ****
  147.   /* comms and common data structures */
  148.   
  149.   /*
  150. !  * $Header: /morpork/home/bmh/xtest2/RCS/comms.h,v 1.18 92/10/19 15:34:38 bmh Exp Locker: bmh $
  151.    *
  152.    * Bernard Hatt
  153.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  154. --- 1,7 ----
  155.   /* comms and common data structures */
  156.   
  157.   /*
  158. !  * $Header: /morpork/home/bmh/xtest2/RCS/comms.h,v 1.19 92/12/16 11:08:14 bmh Exp Locker: bmh $
  159.    *
  160.    * Bernard Hatt
  161.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  162. ***************
  163. *** 34,39 ****
  164. --- 34,45 ----
  165.       char hostname[HOSTLEN];        /* sending hostname */
  166.   } USER;
  167.   
  168. + typedef struct struct_ip
  169. + {
  170. +     int len;
  171. +     char addr[8];    /* no one should have an IP address longer than this! */
  172. + } IP;
  173.   typedef struct struct_position
  174.   {
  175.       int x;        /* x position on battlefield */
  176. ***************
  177. *** 47,54 ****
  178.   {
  179.       int port;    /* callback port no. */
  180.       int version;    /* program version */
  181. !     char hostname[HOSTLEN];    /* sending hostname */
  182. !     char username[NAMELEN];
  183.   } SIGNON;
  184.   
  185.   typedef struct accept_struct
  186. --- 53,61 ----
  187.   {
  188.       int port;    /* callback port no. */
  189.       int version;    /* program version */
  190. !     char hostname[FULLHOSTLEN];    /* sending hostname */
  191. !     char username[FULLNAMELEN];
  192. !     IP ip;
  193.   } SIGNON;
  194.   
  195.   typedef struct accept_struct
  196. diff -c -w ./oldxtb/defs.h ./newxtb/defs.h
  197. *** ./oldxtb/defs.h    Mon Dec 14 12:13:21 1992
  198. --- ./newxtb/defs.h    Wed Dec 16 11:08:20 1992
  199. ***************
  200. *** 1,6 ****
  201.   /* common defines */
  202.   /*
  203. !  * $Header: /morpork/home/bmh/xtest2/RCS/defs.h,v 1.20 92/10/19 15:34:40 bmh Exp Locker: bmh $
  204.    *
  205.    * Bernard Hatt
  206.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  207. --- 1,6 ----
  208.   /* common defines */
  209.   /*
  210. !  * $Header: /morpork/home/bmh/xtest2/RCS/defs.h,v 1.21 92/12/16 11:08:16 bmh Exp Locker: bmh $
  211.    *
  212.    * Bernard Hatt
  213.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  214. ***************
  215. *** 10,16 ****
  216.   
  217.       /* increment this version no. if the client/server protocol is */
  218.       /* changed in any way */
  219. ! #define VERSION        7
  220.   
  221.   #define DEFSPORT    1622    /* default server UDP port no. */
  222.   #define DEFCPORT    1623    /* default client UDP port no. */
  223. --- 10,16 ----
  224.   
  225.       /* increment this version no. if the client/server protocol is */
  226.       /* changed in any way */
  227. ! #define VERSION        8
  228.   
  229.   #define DEFSPORT    1622    /* default server UDP port no. */
  230.   #define DEFCPORT    1623    /* default client UDP port no. */
  231. ***************
  232. *** 31,38 ****
  233.   #define MAINX   768      /* X and Y of main battlefield */
  234.   #define MAINY   768   
  235.   
  236. ! #define HOSTLEN    16    /* max chars in hostname */
  237. ! #define NAMELEN    16    /* max chars in username */
  238.   #define BUFLEN    128    /* general purpose char buffer */
  239.   
  240.   #define MAINSIZE    2048    /* size of field in pixels */
  241. --- 31,41 ----
  242.   #define MAINX   768      /* X and Y of main battlefield */
  243.   #define MAINY   768   
  244.   
  245. ! #define HOSTLEN    10    /* max chars in hostname */
  246. ! #define FULLHOSTLEN    64    /* length of full hostname */
  247. ! #define NAMELEN    10    /* max chars in username */
  248. ! #define FULLNAMELEN    64
  249.   #define BUFLEN    128    /* general purpose char buffer */
  250.   
  251.   #define MAINSIZE    2048    /* size of field in pixels */
  252. diff -c -w ./oldxtb/dgram.c ./newxtb/dgram.c
  253. *** ./oldxtb/dgram.c    Mon Dec 14 12:13:22 1992
  254. --- ./newxtb/dgram.c    Wed Dec 16 11:07:48 1992
  255. ***************
  256. *** 1,7 ****
  257.   /*
  258.    * Comms.
  259.    *
  260. !  * $Header: /morpork/home/bmh/xtest2/RCS/dgram.c,v 1.10 92/10/19 15:34:27 bmh Exp Locker: bmh $
  261.    *
  262.    * Bernard Hatt
  263.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  264. --- 1,7 ----
  265.   /*
  266.    * Comms.
  267.    *
  268. !  * $Header: /morpork/home/bmh/xtest2/RCS/dgram.c,v 1.11 92/12/16 11:07:35 bmh Exp Locker: bmh $
  269.    *
  270.    * Bernard Hatt
  271.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  272. ***************
  273. *** 56,64 ****
  274.   }
  275.   
  276.   int
  277. ! opensend(host,port)
  278.   char *host;
  279.   int port;
  280.   {
  281.       int ret,sd;
  282.       struct sockaddr_in name;
  283. --- 56,65 ----
  284.   }
  285.   
  286.   int
  287. ! opensend(host,port,ip)
  288.   char *host;
  289.   int port;
  290. + IP *ip;
  291.   {
  292.       int ret,sd;
  293.       struct sockaddr_in name;
  294. ***************
  295. *** 73,81 ****
  296.   
  297.       hent=gethostbyname(host);
  298.       if(hent==NULL)
  299.           return(-1);
  300.       bcopy(hent->h_addr,&name.sin_addr,hent->h_length);
  301.       name.sin_family=AF_INET;
  302.       name.sin_port=htons(port);
  303.   
  304. --- 74,95 ----
  305.   
  306.       hent=gethostbyname(host);
  307.       if(hent==NULL)
  308. +     {
  309. +         if(ip==NULL)
  310. +         {
  311.               return(-1);
  312. !         }
  313. !         else
  314. !         {
  315. !             fprintf(stderr,"Can't find host %s's IP address trying %d.%d.%d.%d\n",host,ip->addr[0]&0xff,ip->addr[1]&0xff,ip->addr[2]&0xff,ip->addr[3]&0xff);
  316. !             bcopy(ip->addr,&name.sin_addr,INSWAP(ip->len));
  317. !         }
  318. !     }
  319. !     else
  320. !     {
  321.           bcopy(hent->h_addr,&name.sin_addr,hent->h_length);
  322. +     }
  323.       name.sin_family=AF_INET;
  324.       name.sin_port=htons(port);
  325.   
  326. ***************
  327. *** 95,98 ****
  328. --- 109,128 ----
  329.   DATA *data;
  330.   {
  331.       return(write(sd,data,sizeof(DATA)));
  332. + }
  333. + int
  334. + getipaddr(host,ip)
  335. + char *host;
  336. + IP *ip;
  337. + {
  338. +     struct hostent *hent;
  339. +     hent=gethostbyname(host);
  340. +     if(hent==NULL)
  341. +         return(-1);
  342. +     bcopy(hent->h_addr,ip->addr,hent->h_length);
  343. +     ip->len=OUTSWAP(hent->h_length);
  344. +     return(0);
  345.   }
  346. diff -c -w ./oldxtb/rtb.c ./newxtb/rtb.c
  347. *** ./oldxtb/rtb.c    Mon Dec 14 12:13:08 1992
  348. --- ./newxtb/rtb.c    Wed Dec 16 11:08:07 1992
  349. ***************
  350. *** 1,7 ****
  351.   /*
  352.    * Robot tank
  353.    *
  354. !  * $Header: /morpork/home/bmh/xtest2/RCS/rtb.c,v 1.7 92/10/19 15:34:30 bmh Exp Locker: bmh $
  355.    *
  356.    * Bernard Hatt
  357.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  358. --- 1,7 ----
  359.   /*
  360.    * Robot tank
  361.    *
  362. !  * $Header: /morpork/home/bmh/xtest2/RCS/rtb.c,v 1.8 92/12/16 11:07:47 bmh Exp Locker: bmh $
  363.    *
  364.    * Bernard Hatt
  365.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  366. ***************
  367. *** 14,20 ****
  368.   #include <sys/ioctl.h>
  369.   #include <sys/time.h>
  370.   #include <netinet/in.h>
  371. - #include <unistd.h>
  372.   #include <fcntl.h>
  373.   #include <signal.h>
  374.   #include <ctype.h>
  375. --- 14,19 ----
  376. ***************
  377. *** 502,508 ****
  378.           exit(1);
  379.       }
  380.       
  381. !     ssd=opensend(server,outport);
  382.       if(ssd==(-1))
  383.       {
  384.           fprintf(stderr,"%s: Connecting to %s/%d failed\n",argv[0],server,outport);
  385. --- 501,507 ----
  386.           exit(1);
  387.       }
  388.       
  389. !     ssd=opensend(server,outport,NULL);
  390.       if(ssd==(-1))
  391.       {
  392.           fprintf(stderr,"%s: Connecting to %s/%d failed\n",argv[0],server,outport);
  393. ***************
  394. *** 515,522 ****
  395.       sdata.type=OUTSWAP(T_SIGNON);
  396.       sdata.extra.signon.version=OUTSWAP(VERSION);
  397.       sdata.extra.signon.port=OUTSWAP(inport);    /* could be different to server port */
  398. !     gethostname(sdata.extra.signon.hostname,HOSTLEN);
  399.       sprintf(sdata.extra.signon.username,"ROBOT%04d",inport);
  400.   
  401.       signal(SIGALRM,timeout);
  402.       alarm(3);
  403. --- 514,529 ----
  404.       sdata.type=OUTSWAP(T_SIGNON);
  405.       sdata.extra.signon.version=OUTSWAP(VERSION);
  406.       sdata.extra.signon.port=OUTSWAP(inport);    /* could be different to server port */
  407. !         gethostname(sdata.extra.signon.hostname,FULLHOSTLEN-1);
  408. !     sdata.extra.signon.hostname[FULLHOSTLEN-1]='\0';
  409.       sprintf(sdata.extra.signon.username,"ROBOT%04d",inport);
  410. +     if(getipaddr(sdata.extra.signon.hostname,&(sdata.extra.signon.ip)))
  411. +     {
  412. +         fprintf(stderr,"%s: Couldn't get my own IP address\n",progname);
  413. +         exit(1);
  414. +     }
  415.   
  416.       signal(SIGALRM,timeout);
  417.       alarm(3);
  418. diff -c -w ./oldxtb/xtb.6 ./newxtb/xtb.6
  419. *** ./oldxtb/xtb.6    Mon Dec 14 12:13:23 1992
  420. --- ./newxtb/xtb.6    Wed Dec 16 11:08:24 1992
  421. ***************
  422. *** 1,4 ****
  423. ! .TH XTB 6 "13 January 1991"
  424.   .SH NAME
  425.   xtb, xtbd \- X11 Tank battle program and server
  426.   .SH SYNOPSIS
  427. --- 1,4 ----
  428. ! .TH XTB 6 "13 January 1992"
  429.   .SH NAME
  430.   xtb, xtbd \- X11 Tank battle program and server
  431.   .SH SYNOPSIS
  432. diff -c -w ./oldxtb/xtb.c ./newxtb/xtb.c
  433. *** ./oldxtb/xtb.c    Mon Dec 14 12:13:09 1992
  434. --- ./newxtb/xtb.c    Wed Dec 16 16:16:50 1992
  435. ***************
  436. *** 1,7 ****
  437.   /*
  438.    * X Client 
  439.    *
  440. !  * $Header: /morpork/home/bmh/xtest2/RCS/xtb.c,v 1.41 92/10/19 15:34:32 bmh Exp Locker: bmh $
  441.    *
  442.    * Bernard Hatt
  443.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  444. --- 1,7 ----
  445.   /*
  446.    * X Client 
  447.    *
  448. !  * $Header: /morpork/home/bmh/xtest2/RCS/xtb.c,v 1.42 92/12/16 11:08:07 bmh Exp Locker: bmh $
  449.    *
  450.    * Bernard Hatt
  451.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  452. ***************
  453. *** 14,20 ****
  454.   #include <sys/ioctl.h>
  455.   #include <sys/time.h>
  456.   #include <netinet/in.h>
  457. - #include <unistd.h>
  458.   #include <fcntl.h>
  459.   #include <signal.h>
  460.   #include <ctype.h>
  461. --- 14,19 ----
  462. ***************
  463. *** 1115,1124 ****
  464.       XSetForeground(Disp,GcB,bg);
  465.       XSetBackground(Disp,GcB,fg);
  466.   
  467. !     gcv.function = GXor;
  468.       GcTF=XCreateGC(Disp,Win,(GCFunction | GCPlaneMask | GCFillStyle),&gcv);
  469.   
  470. !     gcv.function = GXandInverted;
  471.       GcTB=XCreateGC(Disp,Win,(GCFunction | GCPlaneMask | GCFillStyle),&gcv);
  472.   
  473.       XSetForeground(Disp,GcTF,fg);
  474. --- 1114,1123 ----
  475.       XSetForeground(Disp,GcB,bg);
  476.       XSetBackground(Disp,GcB,fg);
  477.   
  478. !     gcv.function = fg > bg ? GXor : GXand;
  479.       GcTF=XCreateGC(Disp,Win,(GCFunction | GCPlaneMask | GCFillStyle),&gcv);
  480.   
  481. !     gcv.function = fg > bg ? GXandInverted : GXorInverted;
  482.       GcTB=XCreateGC(Disp,Win,(GCFunction | GCPlaneMask | GCFillStyle),&gcv);
  483.   
  484.       XSetForeground(Disp,GcTF,fg);
  485. ***************
  486. *** 1258,1264 ****
  487.           exit(1);
  488.       }
  489.       
  490. !     ssd=opensend(server,outport);
  491.       if(ssd==(-1))
  492.       {
  493.           fprintf(stderr,"%s: Connecting to %s/%d failed\n",argv[0],server,outport);
  494. --- 1257,1263 ----
  495.           exit(1);
  496.       }
  497.       
  498. !     ssd=opensend(server,outport,NULL);
  499.       if(ssd==(-1))
  500.       {
  501.           fprintf(stderr,"%s: Connecting to %s/%d failed\n",argv[0],server,outport);
  502. ***************
  503. *** 1274,1283 ****
  504.       sdata.type=OUTSWAP(T_SIGNON);
  505.       sdata.extra.signon.version=OUTSWAP(VERSION);
  506.       sdata.extra.signon.port=OUTSWAP(inport);    /* could be different to server port */
  507. -     gethostname(sdata.extra.signon.hostname,HOSTLEN);
  508. -     strncpy(sdata.extra.signon.username,((struct passwd*)getpwuid(getuid()))->pw_name,NAMELEN-1);
  509. -     sdata.extra.signon.username[NAMELEN]='\0';
  510.   
  511.       signal(SIGALRM,timeout);
  512.       alarm(3);
  513.       senddata(ssd,&sdata);
  514. --- 1273,1292 ----
  515.       sdata.type=OUTSWAP(T_SIGNON);
  516.       sdata.extra.signon.version=OUTSWAP(VERSION);
  517.       sdata.extra.signon.port=OUTSWAP(inport);    /* could be different to server port */
  518.   
  519. +     gethostname(sdata.extra.signon.hostname,FULLHOSTLEN-1);
  520. +     sdata.extra.signon.hostname[FULLHOSTLEN-1]='\0';
  521. +     
  522. +     strncpy(sdata.extra.signon.username,((struct passwd*)getpwuid(getuid()))->pw_name,FULLNAMELEN-1);
  523. +     sdata.extra.signon.username[FULLNAMELEN-1]='\0';
  524. +     if(getipaddr(sdata.extra.signon.hostname,&(sdata.extra.signon.ip)))
  525. +     {
  526. +         fprintf(stderr,"%s: Couldn't get my own IP address\n",progname);
  527. +         exit(1);
  528. +     }
  529.       signal(SIGALRM,timeout);
  530.       alarm(3);
  531.       senddata(ssd,&sdata);
  532. ***************
  533. *** 1284,1290 ****
  534.   
  535.       if(readdata(rsd,&rdata)!=sizeof(DATA))
  536.       {
  537. !         fprintf(stderr,"%s: Recieved bad data\n");
  538.           exit(1);
  539.       }
  540.       alarm(0);
  541. --- 1293,1299 ----
  542.   
  543.       if(readdata(rsd,&rdata)!=sizeof(DATA))
  544.       {
  545. !         fprintf(stderr,"%s: Recieved bad data\n",progname);
  546.           exit(1);
  547.       }
  548.       alarm(0);
  549. diff -c -w ./oldxtb/xtbd.c ./newxtb/xtbd.c
  550. *** ./oldxtb/xtbd.c    Mon Dec 14 12:13:24 1992
  551. --- ./newxtb/xtbd.c    Wed Dec 16 11:08:14 1992
  552. ***************
  553. *** 1,7 ****
  554.   /*
  555.    * Server
  556.    *
  557. !  * $Header: /morpork/home/bmh/xtest2/RCS/xtbd.c,v 1.28 92/10/19 15:34:36 bmh Exp Locker: bmh $
  558.    *
  559.    * Bernard Hatt
  560.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  561. --- 1,7 ----
  562.   /*
  563.    * Server
  564.    *
  565. !  * $Header: /morpork/home/bmh/xtest2/RCS/xtbd.c,v 1.29 92/12/16 11:08:11 bmh Exp Locker: bmh $
  566.    *
  567.    * Bernard Hatt
  568.    * Camtec Electronics (Ericsson), Leicester, England, LE1 4SA
  569. ***************
  570. *** 179,185 ****
  571.       int srot,dist;
  572.       int sx,sy;
  573.       int dx,dy;
  574. !     int hflag=0,kflag=0,killed;
  575.   
  576.       newtime=gettime();
  577.       if((newtime>(250+player[id].firetime))&&(player[id].damage<MAXDAMAGE))
  578. --- 179,185 ----
  579.       int srot,dist;
  580.       int sx,sy;
  581.       int dx,dy;
  582. !     int hflag=0,kflag=0,killed=0;
  583.   
  584.       newtime=gettime();
  585.       if((newtime>(250+player[id].firetime))&&(player[id].damage<MAXDAMAGE))
  586. ***************
  587. *** 239,244 ****
  588. --- 239,245 ----
  589.           if(kflag&&(killed!=id))
  590.           {
  591.               player[id].damage=0;
  592. +             sdata.extra.explosion.damage[id]=OUTSWAP(player[id].damage);
  593.               player[id].kills++;
  594.           }
  595.           
  596. ***************
  597. *** 274,280 ****
  598.           id=i;
  599.           break;
  600.       }
  601. !     ssd=opensend(rdata.extra.signon.hostname,INSWAP(rdata.extra.signon.port));
  602.       if(ssd==(-1))
  603.       {
  604.           fprintf(stderr,"%s: Connecting to %s/%d failed\n",progname,rdata.extra.signon.hostname,INSWAP(rdata.extra.signon.port));
  605. --- 275,281 ----
  606.           id=i;
  607.           break;
  608.       }
  609. !     ssd=opensend(rdata.extra.signon.hostname,INSWAP(rdata.extra.signon.port),&(rdata.extra.signon.ip));
  610.       if(ssd==(-1))
  611.       {
  612.           fprintf(stderr,"%s: Connecting to %s/%d failed\n",progname,rdata.extra.signon.hostname,INSWAP(rdata.extra.signon.port));
  613. ***************
  614. *** 336,343 ****
  615.           player[id].t=gettime();
  616.           player[id].restime=gettime();
  617.           player[id].damage=0;
  618. !         strcpy(player[id].user.username,rdata.extra.signon.username);
  619. !         strcpy(player[id].user.hostname,rdata.extra.signon.hostname);
  620.           getscore(id);
  621.           printf("Sent accept (id=%d)\n",id);
  622.           sdata.extra.accept.id=OUTSWAP(id);
  623. --- 337,346 ----
  624.           player[id].t=gettime();
  625.           player[id].restime=gettime();
  626.           player[id].damage=0;
  627. !         strncpy(player[id].user.username,rdata.extra.signon.username,HOSTLEN);
  628. !         player[id].user.username[NAMELEN-1]='\0';
  629. !         strncpy(player[id].user.hostname,rdata.extra.signon.hostname,NAMELEN);
  630. !         player[id].user.hostname[HOSTLEN-1]='\0';
  631.           getscore(id);
  632.           printf("Sent accept (id=%d)\n",id);
  633.           sdata.extra.accept.id=OUTSWAP(id);
  634. ***************
  635. *** 552,557 ****
  636. --- 555,561 ----
  637.       } 
  638.       moveplayers();
  639.       sendplayers();
  640. +     signal(SIGALRM,doalarm);
  641.       myualarm(100000);    /* reset 1/10th sec alarm */
  642.   }
  643.   
  644.  
  645.