home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / vmsnet.sources.games / vmsnetrek / part36 < prev    next >
Internet Message Format  |  1992-11-20  |  15KB

  1. Path: uunet!usc!sol.ctr.columbia.edu!destroyer!cs.ubc.ca!bcsystems!spruce.pfc.forestry.ca!news.u.washington.edu!raven.alaska.edu!acad2.alaska.edu!asdmf
  2. Newsgroups: vmsnet.sources.games
  3. Subject: Vmsnetrek 36/47
  4. Message-ID: <1992Nov20.201846.1@acad2.alaska.edu>
  5. From: asdmf@acad2.alaska.edu
  6. Date: Sat, 21 Nov 1992 00:18:46 GMT
  7. Sender: news@raven.alaska.edu (USENET News System)
  8. Organization: University of Alaska
  9. Nntp-Posting-Host: acad2.alaska.edu
  10. Lines: 460
  11. Xref: uunet vmsnet.sources.games:535
  12.  
  13. -+-+-+-+-+-+-+-+ START OF PART 36 -+-+-+-+-+-+-+-+
  14. X    stline(1);`009/* This is for refresh.  We redraw player stats too */
  15. X    sprintf(buf,`032
  16. X`009"Flags        Warp Dam Shd Torps  Kills Armies   Fuel  Wtemp Etemp");
  17. X    W_WriteText(tstatw, 50, 5, textColor, buf, strlen(buf), W_RegularFont);
  18. X    sprintf(buf,
  19. X`009   "Maximum:      %2d  %3d %3d               %3d   %6d   %3d   %3d",
  20. X`009   me->p_ship.s_maxspeed, me->p_ship.s_maxdamage,
  21. X`009   me->p_ship.s_maxshield, me->p_ship.s_maxarmies,`032
  22. X`009   me->p_ship.s_maxfuel, me->p_ship.s_maxwpntemp/10,`032
  23. X`009   me->p_ship.s_maxegntemp/10);
  24. X    W_WriteText(tstatw, 50, 27, textColor, buf, strlen(buf), W_RegularFont);
  25. X`125
  26. $ CALL UNPACK REDRAW.C;1 119804609
  27. $ create/nolog 'f'
  28. X/* reserved.c
  29. X *`032
  30. X * Kevin P. Smith   7/3/89
  31. X */
  32. X#include "copyright2.h"
  33. X#include <stdio.h>
  34. X#include <types.h>
  35. X#include <socket.h>
  36. X#include <in.h>
  37. X#include <netdb.h>
  38. X#include "packets.h"
  39. X
  40. XmakeReservedPacket(packet)
  41. Xstruct reserved_spacket *packet;
  42. X`123
  43. X    int i;
  44. X
  45. X    for (i=0; i<16; i++) `123
  46. X`009packet->data`091i`093=random() % 256;
  47. X    `125
  48. X    packet->type = SP_RESERVED;
  49. X`125
  50. X
  51. XencryptReservedPacket(spacket, cpacket, server, pno)
  52. Xstruct reserved_spacket *spacket;
  53. Xstruct reserved_cpacket *cpacket;
  54. Xchar *server;
  55. Xint pno;
  56. X`123
  57. X    struct hostent *hp;
  58. X    struct in_addr address;
  59. X    unsigned char mixin1, mixin2, mixin3, mixin4, mixin5;
  60. X    int i,j,k;
  61. X    char buf`09116`093;
  62. X    unsigned char *s;
  63. X   `032
  64. X    bcopy(spacket->data, cpacket->data, 16);
  65. X    bcopy(spacket->data, cpacket->resp, 16);
  66. X    cpacket->type=CP_RESERVED;
  67. X
  68. X/*
  69. X    if ((address.s_addr = inet_addr(server)) == -1) `123
  70. X`009if ((hp = gethostbyname(server)) == NULL) `123
  71. X`009    fprintf(stderr, "I don't know any %s!\n", server);
  72. X`009    exit(1);
  73. X`009`125 else `123
  74. X`009    address.s_addr = *(long *) hp->h_addr;
  75. X`009`125
  76. X    `125
  77. X
  78. X    mixin1 = address.s_net;
  79. X    mixin2 = pno;
  80. X    mixin3 = address.s_host;
  81. X    mixin4 = address.s_lh;
  82. X    mixin5 = address.s_impno;
  83. X */
  84. X
  85. X    /* Now you've got 5 random bytes to play with (mixin`0911-5`093), to`032
  86. X     *  help in coming up with an encryption of your data.
  87. X     */
  88. X
  89. X    /* Encryption algorithm goes here.
  90. X     * Take the 16 bytes in cpacket->data, and create cpacket->resp,
  91. X     *   which you require the client to also do.  If he fails, he
  92. X     *   gets kicked out.
  93. X     */
  94. X
  95. X`125
  96. $ CALL UNPACK RESERVED.C;1 2065895101
  97. $ create/nolog 'f'
  98. X/*
  99. X * scan.c
  100. X */
  101. X#include "copyright.h"
  102. X
  103. X#include <stdio.h>
  104. X#include "Wlib.h"
  105. X#include "defs.h"
  106. X#include "struct.h"
  107. X#include "data.h"
  108. X#include "packets.h"
  109. X
  110. X/* ATM - scanner stuff */
  111. Xstatic W_Window scanww;
  112. Xstatic int scanmx, scanmy;
  113. X
  114. Xscan(ww, x, y)
  115. XW_Window ww;
  116. Xint x, y;
  117. X`123
  118. X    struct obtype *gettarget(), *target;
  119. X
  120. X    scanww = ww;`009/* remember these for later */
  121. X    scanmx = x;
  122. X    scanmy = y;
  123. X
  124. X    /* find player nearest to mouse */
  125. X    target = gettarget(ww, x, y, TARG_PLAYER);
  126. X
  127. X    /* don't scan myself */
  128. X    if (target->o_num == me->p_no) `123
  129. X`009warning("Nobody to scan");
  130. X`009return;
  131. X    `125
  132. X
  133. X    /* send the request to the server */
  134. X    sendScanReq(target->o_num);
  135. X`125
  136. X
  137. XinformScan(pnum)
  138. Xint pnum;
  139. X`123
  140. X    scanplayer = pnum;
  141. X    W_MapWindow(scanwin);
  142. X    scanmapped = 1;
  143. X    redrawScan();
  144. X    calibrate_scan();
  145. X    updateScan();
  146. X`125
  147. X
  148. X
  149. X/* from here on it's from stats.c */
  150. X
  151. X#define`009MIN(a,b)`009(((a) < (b)) ? (a) : (b))
  152. X
  153. X#define`009BX_OFF()`009((textWidth + 1) * W_Textwidth + S_IBORDER)
  154. X#define`009BY_OFF(line)`009((line) * (W_Textheight + S_IBORDER) + S_IBORDER)
  155. X#define`009TX_OFF(len)`009((textWidth - len) * W_Textwidth + S_IBORDER)
  156. X#define`009TY_OFF(line)`009BY_OFF(line)
  157. X
  158. X#define SCAN_WIDTH`009`009160
  159. X#define SCAN_HEIGHT`009`009BY_OFF(NUM_SLIDERS)
  160. X#define SCAN_BORDER`009`0092
  161. X#define S_IBORDER`009`0095
  162. X#define SCAN_X`009`009`009422
  163. X#define SCAN_Y`009`009`00913
  164. X
  165. X#define SL_WID`009`009`009\
  166. X`009(SCAN_WIDTH - 2 * S_IBORDER - (textWidth + 1) * W_Textwidth)
  167. X#define SL_HEI`009`009`009(W_Textheight)
  168. X
  169. X#define NUM_ELS(a)`009`009(sizeof (a) / sizeof (*(a)))
  170. X#define NUM_SLIDERS`009`009NUM_ELS(scanners)
  171. X
  172. Xtypedef struct slider `123
  173. X`009char`009*label;
  174. X`009int`009min, max;
  175. X`009int`009low_red, high_red;
  176. X`009int`009label_length;
  177. X`009int`009diff;
  178. X`009int`009*var;
  179. X`009int`009lastVal;
  180. X`125 SLIDER;
  181. X
  182. Xtypedef struct record `123
  183. X`009int`009*data;
  184. X`009int`009last_value;
  185. X`125 RECORD;
  186. X
  187. Xstatic SLIDER`009scanners`091`093 = `123
  188. X`009`123 "Shields",`009`0090,`009100,`00920,`009100`009`125,
  189. X`009`123 "Damage",`009`0090,`009100,`0090,`0090`009`125,
  190. X`009`123 "Fuel",`009`0090,`00910000,`0092000,`00910000`009`125,
  191. X`009`123 "Warp",`009`0090,`0099,`0090,`0099`009`125,
  192. X`009`123 "Weapon Temp",`0090,`0091200,`0090,`009800`009`125,
  193. X`009`123 "Engine Temp",`0090,`0091200,`0090,`009800`009`125,
  194. X`125;
  195. X
  196. Xstatic int`009`009textWidth = 0;
  197. Xstatic int `009`009initialized = 0;
  198. X
  199. XinitScan()
  200. X`123
  201. X    int`009i;
  202. X    /*char`009*str;*/
  203. X    scanners`0910`093.var = &(players`091scanplayer`093.p_shield);
  204. X    scanners`0911`093.var = &(players`091scanplayer`093.p_damage);
  205. X    scanners`0912`093.var = &(players`091scanplayer`093.p_fuel);
  206. X    scanners`0913`093.var = &(players`091scanplayer`093.p_speed);
  207. X    scanners`0914`093.var = &(players`091scanplayer`093.p_wtemp);
  208. X    scanners`0915`093.var = &(players`091scanplayer`093.p_etemp);
  209. X    for (i = 0; i < NUM_SLIDERS; i++) `123
  210. X`009scanners`091i`093.label_length = strlen(scanners`091i`093.label);
  211. X`009textWidth = MAX(textWidth, scanners`091i`093.label_length);
  212. X`009scanners`091i`093.diff = scanners`091i`093.max - scanners`091i`093.min;
  213. X`009scanners`091i`093.lastVal=0;
  214. X    `125
  215. X`125
  216. X
  217. XredrawScan()
  218. X`123
  219. X    int`009i;
  220. X    char tempstr`091128`093;
  221. X
  222. X    W_ClearWindow(scanwin);
  223. X    initScan();
  224. X    for (i=0; i<NUM_SLIDERS; i++) `123
  225. X`009scanners`091i`093.lastVal=0;
  226. X    `125
  227. X
  228. X    sprintf(tempstr,"SCAN of %s(%c%d)",players`091scanplayer`093.p_name,
  229. X`009teamlet`091players`091scanplayer`093.p_team`093,players`091scanplayer`09
  230. V3.p_no);
  231. X    W_WriteText(scanwin, 0, TY_OFF(0),
  232. X`009textColor, tempstr, strlen(tempstr), W_RegularFont);
  233. X    for (i = 0; i < NUM_SLIDERS; i++) `123
  234. X`009W_WriteText(scanwin, TX_OFF(scanners`091i`093.label_length), TY_OFF(i+1)
  235. V,
  236. X`009    textColor, scanners`091i`093.label, scanners`091i`093.label_length,
  237. X`009    W_RegularFont);
  238. X`009drwbox(0, BX_OFF() - 1, BY_OFF(i+1) - 1, SL_WID+2, SL_HEI+2, borderColor
  239. V);
  240. X`009scanners`091i`093.lastVal=0;
  241. X    `125
  242. X    W_WriteText(scanwin, TX_OFF(strlen("Armies:")), TY_OFF(NUM_SLIDERS+1),
  243. X`009textColor, "Armies:", strlen("Armies:"), W_RegularFont);
  244. X    sprintf(tempstr,"%d",players`091scanplayer`093.p_armies);
  245. X    W_WriteText(scanwin, BX_OFF()-1, TY_OFF(NUM_SLIDERS+1),
  246. X`009textColor, tempstr, strlen(tempstr), W_RegularFont);
  247. X`125
  248. X
  249. XupdateScan()
  250. X`123
  251. X    int`009i, value, diff, old_x, new_x;
  252. X    W_Color color;
  253. X    SLIDER`009*s;
  254. X
  255. X    initScan();
  256. X    for (i = 0; i < NUM_SLIDERS; i++) `123
  257. X`009s = &scanners`091i`093;
  258. X`009value= *(s->var);
  259. X`009if (value < s->min)
  260. X`009    value = s->min;
  261. X`009else if (value > s->max)
  262. X`009    value = s->max;
  263. X`009if (value == s->lastVal)
  264. X`009    continue;
  265. X`009diff = value - s->lastVal;
  266. X`009if (diff < 0) `123
  267. X`009    old_x = s->lastVal * SL_WID / s->diff;
  268. X`009    new_x = value * SL_WID / s->diff;
  269. X`009    drwbox(1, BX_OFF()+new_x, BY_OFF(i+1), old_x-new_x, SL_HEI, backColo
  270. Vr);
  271. X
  272. X`009    if (s->lastVal >= s->low_red && value < s->low_red)`032
  273. X`009`009drwbox(1, BX_OFF(), BY_OFF(i+1), new_x, SL_HEI, warningColor);
  274. X`009    else if (s->lastVal > s->high_red && value <= s->high_red)`032
  275. X`009`009drwbox(1, BX_OFF(), BY_OFF(i+1), new_x, SL_HEI, myColor);
  276. X`009`125 else `123
  277. X`009    if (value < s->low_red)
  278. X`009`009color = warningColor;
  279. X`009    else if (value > s->high_red) `123
  280. X`009`009color = warningColor;
  281. X`009`009if (s->lastVal <= s->high_red)
  282. X`009`009    s->lastVal = 0;
  283. X`009    `125 else `123
  284. X`009`009color = myColor;
  285. X`009`009if (s->lastVal < s->low_red)
  286. X`009`009    s->lastVal = 0;
  287. X`009    `125
  288. X`009    old_x = s->lastVal * SL_WID / s->diff;
  289. X`009    new_x = value * SL_WID / s->diff;
  290. X`009    drwbox(1, BX_OFF() + old_x, BY_OFF(i+1), new_x - old_x, SL_HEI, colo
  291. Vr);
  292. X`009`125
  293. X`009s->lastVal=value;
  294. X    `125
  295. X`125
  296. X
  297. Xdrwbox(filled, x, y, wid, hei, color)
  298. Xint filled, x, y, wid, hei;
  299. XW_Color color;
  300. X`123
  301. X    if (wid==0) return;
  302. X    if (filled) `123
  303. X`009W_ClearArea(scanwin, x, y, wid+1, hei+1, color);
  304. X`009return;
  305. X    `125
  306. X
  307. X    W_MakeLine(scanwin,x,y,x+wid,y,color);
  308. X    W_MakeLine(scanwin,x+wid,y,x+wid,y+hei,color);
  309. X    W_MakeLine(scanwin,x+wid,y+hei,x,y+hei,color);
  310. X    W_MakeLine(scanwin,x,y+hei,x,y,color);
  311. X`125
  312. X
  313. X
  314. Xcalibrate_scan()
  315. X`123
  316. X    register int i;
  317. X
  318. X    scanners`0910`093.max = players`091scanplayer`093.p_ship.s_maxshield;
  319. X    scanners`0910`093.low_red = .20 * ((double) scanners`0910`093.max);
  320. X    scanners`0910`093.high_red = scanners`0910`093.max;
  321. X
  322. X    scanners`0911`093.max = players`091scanplayer`093.p_ship.s_maxdamage;
  323. X
  324. X    scanners`0912`093.max = players`091scanplayer`093.p_ship.s_maxfuel;
  325. X    scanners`0912`093.low_red = .20 * ((double) scanners`0912`093.max);
  326. X    scanners`0912`093.high_red = scanners`0912`093.max;
  327. X
  328. X    scanners`0913`093.max = players`091scanplayer`093.p_ship.s_maxspeed;
  329. X    scanners`0913`093.high_red = scanners`0913`093.max;
  330. X
  331. X    scanners`0914`093.max = 1.2 * ((double) players`091scanplayer`093.p_ship
  332. V.s_maxwpntemp);
  333. X    scanners`0914`093.high_red = .667 * ((double) scanners`0914`093.max);
  334. X
  335. X    scanners`0915`093.max = 1.2 * ((double) players`091scanplayer`093.p_ship
  336. V.s_maxegntemp);
  337. X    scanners`0915`093.high_red = .667 * ((double) scanners`0915`093.max);
  338. X
  339. X    for (i=0; i<NUM_SLIDERS; i++)`032
  340. X`009scanners`091i`093.diff = scanners`091i`093.max - scanners`091i`093.min;
  341. X
  342. X`125
  343. X
  344. $ CALL UNPACK SCAN.C;1 1076648455
  345. $ create/nolog 'f'
  346. XFrom: tom@ocf.berkeley.edu (Tom Holub)
  347. XNewsgroups: rec.games.netrek,alt.games.xtrek,news.answers
  348. XSubject: Netrek Server List
  349. XSupersedes: <netreklist_706850674@ocf.berkeley.edu>
  350. XFollowup-To: rec.games.netrek
  351. XDate: 20 Jun 1992 03:09:03 GMT
  352. XOrganization: University of California, Berkeley
  353. XReply-To: tom@ocf.berkeley.edu
  354. XNNTP-Posting-Host: sandstorm.berkeley.edu
  355. XOriginator: tom@sandstorm.berkeley.edu
  356. X
  357. XLast-Updated: 19 Jun 1992
  358. XArchive-Name: netrek/server-list
  359. XChanges: Many servers not responding or down.
  360. X
  361. X
  362. XThis is a list of all known public Netrek servers.  If you know of any`032
  363. Xothers, or if any of my information is wrong, please mail
  364. Xtom@ocf.Berkeley.EDU.
  365. X `032
  366. X
  367. XServer name`009`009`009INET address`009Port`009Notes
  368. X
  369. Xbezier.berkeley.edu`009`009128.32.150.109`0092592`009Biggest western, UDP.
  370. X
  371. Xsickdog.cs.berkeley.edu`009`009128.32.240.135`0092592`009Replaces bigdog, UD
  372. VP.
  373. X
  374. Xbronco.ece.cmu.edu`009`009128.2.210.65`0092592`009Biggest eastern, UDP.
  375. X
  376. Xrwd4.mach.cs.cmu.edu`009`009128.2.209.169`0092592`009Robot-oriented, UDP.
  377. X
  378. Xauk.warp.cs.cmu.edu`009`009128.2.242.102`0092592`009Clue-only
  379. X
  380. Xhydrus.ece.cmu.edu`009`009128.2.236.147`0092592`009Bronco clone.
  381. X
  382. Xneedmore.cs.utexas.edu`009`009128.83.138.122`0093737`009Apparently down.
  383. X
  384. Xgrit.cs.utexas.edu`009`009128.83.138.115`0092592`009Chaos, UDP.
  385. X
  386. Xhpserv.math.tamu.edu`009`009128.194.7.8`0092592`009Texas A&M, UDP.
  387. X
  388. Xmatt.ksu.ksu.edu`009`009129.130.1.64`0095854`009KSU chaos server.
  389. X
  390. Xnetrek.cis.ksu.edu`009`009129.130.10.87`0095855`009KSU chaos, UDP.
  391. X
  392. Xpeanuts.informatik.uni-tuebingen.de 134.2.14.1`0092592`009Germany.
  393. X
  394. Xbayes.ibr.cs.tu-bs.de`009`009134.169.34.33`0095855`009Germany, UDP.
  395. X
  396. Xmelmac.risc.uni-linz.ac.at`009140.78.140.60`0092592`009Austria, UDP.
  397. X
  398. Xiacrs2.unibe.ch`009`009`009130.92.11.4`009592`009Swiss server, UDP.
  399. X
  400. Xuhura.fmi.uni-passau.de`009`009132.231.51.224`00921212`009Germany.
  401. X
  402. Xlegend.cma.fr`009`009`009192.33.149.15`0092592`009France, UDP.
  403. X
  404. Xcalvin.usc.edu`009`009`009128.125.62.143`0092592`009USC server, UDP.
  405. X
  406. Xscws9.harvard.edu`009`009128.103.25.59`0092592`009Harvard server, UDP.
  407. X
  408. Xtbird.cc.iastate.edu`009`009129.186.140.11`0092592`009Iowa State, UDP.
  409. X
  410. Xpanther.ecss.iastate.edu`009129.186.141.248`0092592`009Iowa State, UDP.
  411. X
  412. Xultrix.csc.usf.edu`009`009131.247.31.1`0092592`009South Florida.
  413. X
  414. Xfife.ecn.purdue.edu`009`009128.46.130.169`0092592`009Purdue, UDP.
  415. X
  416. Xsturgeon.cs.washington.edu`009128.95.1.58`0092592`009U Washington, UDP.
  417. X
  418. Xsturgeon.cs.washington.edu`009128.95.1.58`0093592`009Scrod's new home, UDP.
  419. X
  420. Xharvey.cs.umd.edu`009`009128.8.128.178`0092592`009Maryland, UDP.
  421. X
  422. Xdiscovery.cl.msu.edu`009`00935.8.1.220`0092592`009Michigan, UDP.
  423. X
  424. Xesrg.ucsb.edu`009`009`009128.111.228.1`0092592`009UC Santa Barbara.
  425. X
  426. Xnewton.physics.ucla.edu`009`009128.97.23.41`0092592`009Apparently down.
  427. X
  428. Xnetrek.atd.ucar.edu`009`009128.117.80.14`0092592`009Colorado, UDP.
  429. X
  430. Xpanda.lpl.arizona.edu`009`009128.196.64.154`0092592`009Down for good.
  431. X
  432. Xflint.cs.brown.edu`009`009128.148.37.33`0092592`009User's choice, UDP.
  433. X
  434. Xghost.dsi.unimi.it`009`009149.132.1.2`0092592`009Italy, UDP.
  435. X
  436. Xnetrek.cs.mcgill.ca`009`009132.206.51.3`0092592`009Canada.
  437. X
  438. Xbigmax.ulowell.edu`009`009129.63.32.1`0092592`009Mass., UDP.
  439. X
  440. Xalia.cs.umn.edu`009`009`009128.101.229.22`0092592`009New chaos, UDP.
  441. X
  442. XComments and server configurations:
  443. X
  444. XNOTE: It is an excellent idea to read the MOTD when you first log
  445. Xon to a server (use 'f' and 'b' to move forwards and backwards through
  446. Xthe news).
  447. X
  448. X
  449. Xbezier.berkeley.edu
  450. XServer source: from scam.berkeley.edu.
  451. XUDP: version 1.0.
  452. XHours: 5PM to 8AM Pacific time Monday-Friday, all day on weekends.
  453. XT-mode: 4 on 4.
  454. XCyborgs: Allowed Sunday, Monday, and Tuesday.
  455. XTheme nights: Wednesday, vector torps.
  456. XPing time from ocf.Berkeley.edu: 20-40.
  457. XPing time from ccon.hl.andrew.cmu.edu: 180-190.
  458. XPing time from utexas: 100-270.
  459. XMaintainer: sfd@miro.berkeley.edu.
  460. XComments: The biggest West Coast server, t-mode nearly every night.
  461. X
  462. Xsuckdog.cs.berkeley.edu
  463. XServer source: Scam.
  464. XUDP: version 1.0
  465. XHours: 5PM to 8AM Pacific time Monday-Friday, all day on weekends.
  466. XT-mode: 4 on 4.
  467. XCyborgs: Never allowed.  Blessed binaries required.
  468. XTheme nights: Friday, three-race war.
  469. X`009      Monday and Tuesday, hockey.
  470. XPing time from ocf: 15-30.
  471. XMaintainer: jh@bigdog.berkeley.edu.
  472. +-+-+-+-+-+-+-+-  END  OF PART 36 +-+-+-+-+-+-+-+-
  473.