home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume15 / xtb / patch1 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  19.9 KB

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