$! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990 $! On 11-NOV-1992 22:08:22.56 By user ST1CK $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $!+ THIS PACKAGE DISTRIBUTED IN 3 PARTS, TO KEEP EACH PART $! BELOW 30 BLOCKS $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. 000READ.ME;2 $! 2. CLIENT.C;1 $! 3. CLIENT.DOCS;2 $! 4. CLIENT.OPTS;1 $! 5. COMPILE.COM;1 $! 6. COMPILING.INFO;1 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$trnlnm("SHARE_LOG") then $ w = "!" $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ if f$search(P1) .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped." $ delete 'f'* $ exit $file_absent: $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:= CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b)); LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1); IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE; MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1; ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")= 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF"; POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r); ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1; COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE, "output_file"));ENDPROCEDURE;Unpacker;QUIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create 'f' XFor the most part this client will do what the Unix Empclient.1.0 will do, w Vith Xa little more. One of these days I will fix the two major bugs I know about V: Xlack of highlighting with the sect command and cannot exec a telegram. X XYou can have pre-defined macros, if you have any questions, please email me. X X XDon Harper Xdon@xray.phys.uh.edu $ CALL UNPACK 000READ.ME;2 991523290 $ create 'f' X/* XCompiles under: Wollengong, Multinet, UCX X ---------------------- X Empire client (VAX/VMS) X by Mike Kienenberger X Wollengong TCP/IP V3 (will work for Multinet with numeric addresses) X (any use of this program is subject to whatever legal whatevers that X Wollengong has chose to implement. I have no idea what legal X nonsense is required for you to be able to use this code for any X particular purpose. Use at your own risk. I've distributed X it solely so that you can see how tcp/ip works :-) X (some ideas borrowed from Dave Pare) X FXMLK@ALASKA.bitnet X FSMLK1%alaska.bitnet@cunyvm.cuny.edu X Version 1.0 X Jan 1st, 1991 X (it was the best I felt like doing in the last few hours. It's X now 2:30 am. Live with it!) X ---------------------- X Jan 3rd, 1991 X X version 1.1 note - fixed problem (I think) that caused X large outputs to be saved in a nonstandard empire-client X format. This should make output files compatible with X any program used to reading the unix format. X ---------------------- X ---------------------- X Version 2.0! X Jun 3rd, 1991 X At long last, I settle down to write the syncronous version. X The asyncronous version wasn't good enough. X Besides, tomorrow a new empire game starts (3rd Banjo) and I want to X ---------------------- X Jan 16th, 1991 X version 2.1 note X Fixed client.opts file so that you can have a lot of games going at X the same time without making a lot of changes. X ---------------------- X Nov 17th, 1991 X version 2.2 note X Finally decided to make it so that game-names don't have to be lowerca Vse X ---------------------- X Dec 6th, 1991 X version 2.3 note X Made it so that it could be compiled under UCX X Changed way that the hostname was looked up (might fix Multinet proble Vm) X (also fixed accvio if hostname was not found) X ---------------------- X Dec 8th, 1991 X version 2.4 note X Made it so that it could be compiled under Multinet since V2.3 won't X work under multinet at all anymore X ---------------------- X Jan 3rd, 1992 X version 2.5 X Weird wollengong gethostbyname doesn't work with numeric addresses. X went back to old rhost for wollengong. X ---------------------- X May 25th, 1992 X version 3.0 X Added ability to spawn a new DCL process. DHarper@uh.edu X ---------------------- X Jun 11th, 1992 X version 3.1 X Fixed all file open errors. Client would leave open files while runni Vng. X DHarper@uh.edu X ---------------------- X Aug 18th, 1992 X version 3.2 X Added predefined macros X DHarper@uh.edu X ---------------------- X Aug 20th, 1992 X version 3.3 X fixed to spawn commands while still running. X DHarper@uh.edu X ---------------------- X Aug 31st, 1992 X version 3.4 X fixed macro returns so that can spawn with macros. X DHArper@uh.edu X*/ X`0C X#ifdef WOLLENGONG X/*`20 X Compiling instructions X`09$ define sys twg$tcp:`5Bnetdist.include.sys`5D X`09$ define vms twg$tcp:`5Bnetdist.include.vms`5D X`09$ cc/define=wollengong client X`09$ link client,tcp$lib:twglib/lib,sys$input/opt X sys$share:vaxcrtl/share X (The sys$share goes on the line immediately after typing the link command. X The entire ",sys$input/optsys$share:vaxcrtl/share" is optional.) X*/ X X#include X#include X#include X X/* End of WOLLENGONG def */ X#elif MULTINET X/*`20 X Compiling instructions X`09$ define sys multinet_root:`5Bmultinet.include.sys`5D X`09$ define vms multinet_root:`5Bmultinet.include.vms`5D X`09$ define multi multinet_root:`5Bmultinet.include`5D X`09$ cc/define=multinet client X`09$ link client,sys$input/opt X sys$share:vaxcrtl/share X multinet:multinet_socket_library/share X X (The sys$share goes on the line immediately after typing the link command. X The entire ",sys$input/optsys$share:vaxcrtl/share" is optional.) X*/ X X#include X#include X#include X X#define netclose socket_close X X/* End of MULTINET def */ X#elif UCX X/*`20 X Compiling instructions X`09$ cc/define=ucx client X`09$ link client,sys$library:ucx$ipc/lib,sys$input/opt X sys$share:vaxcrtl/share X (The sys$share goes on the line immediately after typing the link command. X The entire ",sys$input/optsys$share:vaxcrtl/share" is optional.) X*/ X X#include X#include X#include X X#define netclose close X X/* End of UCX def */ X#else X( Client will not compile at all, unless you define either WOLLENGONG, XMULTINET, or UCX)`09$ cc/define= client X/* End of TCP/IP specifics */ X#endif X`0C X#include X#include X#include X#include X#include X#include X X#define TRUE 1 X#define FALSE 0 X X#define C_CMDOK '0' X#define C_DATA '1' X#define C_INIT '2' X#define C_EXIT '3' X#define C_FLUSH '4' X#define C_NOECHO '5' X#define C_PROMPT '6' X#define C_ABORT '7' X#define C_REDIR '8' X#define C_PIPE '9' X#define C_CMDERR 'a' X#define C_BADCMD 'b' X#define C_EXECUTE 'c' X Xstruct in_addr X`7B X union X `7B X struct X `7B X unsigned char s_b1, X s_b2, X s_b3, X s_b4; X `7D S_un_b; X X struct X `7B X unsigned short s_w1, X s_w2; X `7D S_un_w; X X unsigned long S_addr; X X `7D S_un; X`7D; X X#define s_addr S_un.S_addr X#define NOEXECMACRO "there once was a little pig." X Xstruct sockaddr_in X`7B X short sin_family; X unsigned short sin_port; X struct in_addr sin_addr; X char sin_zero`5B8`5D; X`7D; X X`0C Xvoid callsysspawn (buffer) X char *buffer; X`7B X struct dsc$descriptor_s command_desc; X int rwm, status, i; X char *command; X X status = sys$setrwm (0); X if (status == SS$_WASCLR) rwm = 0; X else rwm = 1; X if (buffer`5B2`5D !=0)`7B X`09command = (char *)malloc(512); X`09for(i=0;i<512;i++) command`5Bi`5D=0; X strncpy (command, buffer,(strlen(buffer)-1)); X`09command_desc.dsc$w_length = (short) strlen(command); X`09command_desc.dsc$a_pointer = command; X`09command_desc.dsc$b_class = DSC$K_CLASS_S; X`09command_desc.dsc$b_dtype = DSC$K_DTYPE_T; X`09lib$spawn(&command_desc,0,0,0,0,0,0,0,0,0,0,0); X `7D else `7B X `09lib$spawn (0,0,0,0,0,0,0,0,0,0,0,0);`7D X status = sys$setrwm (rwm); X`7D X`0C Xchar *macrosend (buffer,macro) X char macro`5B256`5D`5B256`5D; X char *buffer; X`7B X if (macro`5Bbuffer`5B2`5D`5D`5B0`5D != '$') X return macro`5Bbuffer`5B2`5D`5D; X callsysspawn (¯o`5Bbuffer`5B2`5D`5D`5B1`5D); X return macro`5Bbuffer`5B2`5D`5D; X`7D X X`0C Xmain (argc, argv) Xint argc; Xchar *argv`5B`5D; X`7B X struct hostent *hostentry, *gethostbyname(); X unsigned long rhost(); X char *readit(); X X char *strcpy(), *strcat(); X int strcmp(); X size_t strlen(); X X char *cuserid(); X FILE *options, *cheat; X char **hostname; X char hm`5B256`5D, portname`5B6`5D, countryname`5B20`5D, password`5B20`5D V, gamename`5B80`5D; X X char *inbuffer; X int trash, btus, mins,i; X X FILE *redir, *input; X char outfile`5B80`5D,infile`5B80`5D,temp`5B80`5D; X X char linefeed`5B`5D = "\n"; X int server_socket; X int vmserrno, uerrno; X X char output`5B256`5D, userid`5B16`5D; X int l; X char commandchar = '/', commstr`5B5`5D="/"; X char buffer`5B513`5D, macro`5B256`5D`5B256`5D; X char tmp`5B256`5D; X int reading, done, dosend, buflen; X int number; X FILE *oldinput; X char *tempptr; X X int port; X struct sockaddr_in sin; X int status,count; X X redir = stdout; X input = stdin; X X if ((argc != 1) && (argc != 2)) X `7B X printf ("\nempire :== $:`5B`5Dclient.exe"); X printf ("\nUsage: `5Bgame-name`5D "); X exit (1); X `7D X X printf ("\nVMS Empire Client V3.3\n"); X`0C X cheat = fopen ("empiredir:client.MACRO","r"); X if ( cheat != (FILE *) 0) X `7B X`09while (fgets(hm,256,cheat) != 0) X`09 strcpy(macro`5Bhm`5B0`5D`5D,&hm`5B1`5D); X `7D X`09 X options = fopen ("empiredir:client.OPTS","r"); X if (options == (FILE *) 0) X `7B X printf ("\nEMPIREDIR:CLIENT.OPTS not found"); X printf ("\nAssuming DEFINE EMPIREDIR sys$login"); X printf ("\nAdd DEFINE EMPIREDIR :`5B`5D to your L VOGIN.COM file"); X printf ("\nto make this message stop appearing."); X printf ("\n"); X#ifdef WOLLENGONG X printf ("\nNote: This program was designed for Wollengong TCP/IP"); X#elif MULTINET X printf ("\nNote: This program was designed for Multinet TCP/IP"); X#elif UCX X printf ("\nNote: This program was designed for UCX TCP/IP"); X#else X printf ("\nNote: This program should not have compiled at all!!!"); X#endif X`0C X options = fopen ("sys$login:client.OPTS","r"); X `7D X X if (options == (FILE *) 0) X `7B X printf ("\nUnable to CLIENT.OPTS"); X printf ("\nCreate new CLIENT.OPTS or Exit? C/`5BE`5D "); X gets(hm); X if ((hm`5B0`5D != 'C') && (hm`5B0`5D != 'c')) X exit(1); X X printf ("\nHost name: ('*' to be prompted each time): "); X gets(hm); X printf ("\nPort Number: ('*' to be prompted each time): "); X gets(portname); X printf ("\nCountry name: ('*' to be prompted each time): "); X gets(countryname); X printf ("\nWarning: Empire tends to truncate passwords to 8 letters. V"); X printf ("\nPassword: ('*' to be prompted each time): "); X gets(password); X printf ("\nName of Game: "); X gets(gamename); X X options = fopen ("sys$login:client.OPTS","w"); X fprintf (options, "%s\n", hm); X fprintf (options, "%s\n", portname); X fprintf (options, "%s\n", countryname); X fprintf (options, "%s\n", password); X fprintf (options, "%s\n", gamename); X fprintf (options, "#\n"); X fprintf (options, "# Format\n"); X fprintf (options, "# One line per item:\n"); X fprintf (options, "# Hostname ('*' indicates program prompts for it V)\n"); X fprintf (options, "# Portname ('*' indicates program prompts for it V)\n"); X fprintf (options, "# Country ('*' indicates program prompts for it) V\n"); X fprintf (options, "# password ('*' indicates program prompts for it V)\n"); +-+-+-+-+-+-+-+- END OF PART 1 +-+-+-+-+-+-+-+-