|
|
1.1 ! root 1: /* ! 2: * Hunt ! 3: * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold ! 4: * San Francisco, California ! 5: * ! 6: * Copyright (c) 1985 Regents of the University of California. ! 7: * All rights reserved. The Berkeley software License Agreement ! 8: * specifies the terms and conditions for redistribution. ! 9: */ ! 10: ! 11: # include "hunt.h" ! 12: # include <signal.h> ! 13: ! 14: do_connect(name, team, enter_status) ! 15: char *name; ! 16: char team; ! 17: long enter_status; ! 18: { ! 19: static long uid; ! 20: static long mode; ! 21: extern char *ttyname(); ! 22: ! 23: if (uid == 0) ! 24: uid = htonl(getuid()); ! 25: (void) write(Socket, (char *) &uid, LONGLEN); ! 26: (void) write(Socket, name, NAMELEN); ! 27: (void) write(Socket, &team, 1); ! 28: enter_status = htonl(enter_status); ! 29: (void) write(Socket, (char *) &enter_status, LONGLEN); ! 30: (void) strcpy(Buf, ttyname(fileno(stderr))); ! 31: (void) write(Socket, Buf, NAMELEN); ! 32: # ifdef INTERNET ! 33: if (Send_message != NULL) ! 34: mode = C_MESSAGE; ! 35: else ! 36: # endif ! 37: # ifdef MONITOR ! 38: if (Am_monitor) ! 39: mode = C_MONITOR; ! 40: else ! 41: # endif MONITOR ! 42: mode = C_PLAYER; ! 43: mode = htonl(mode); ! 44: (void) write(Socket, (char *) &mode, sizeof mode); ! 45: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.