Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.UUCP Newsgroups: net.unix-wizards Subject: Re: Process control and communications Message-ID: <2204@brl-smoke.ARPA> Date: Sat, 29-Mar-86 18:31:46 EST Article-I.D.: brl-smok.2204 Posted: Sat Mar 29 18:31:46 1986 Date-Received: Tue, 1-Apr-86 07:19:15 EST References: <698@watdragon.UUCP> Reply-To: gwyn@brl.ARPA Distribution: net Organization: Ballistic Research Lab (BRL) Lines: 25 In article <698@watdragon.UUCP> wasaunders@watdragon.UUCP (Parallel Hair???) writes: >Being fairly new at the unix game I have a question to ask of all you Whee-Zards >out there ... actually it is more of a problem than a question, but anyway ... > >I would like to set up a time-sharing system (a small one). One of the things >I would like to do is to include a multi-user game which I have been thinking >of writing. The events during the game are to take place in real time, so >one possible architecture for the software would be to have one games master, >with player processes forked from it. When someone logs into my system they >are given a CI (shell, whatever ....) - if they want to play the game how >can I associate the player process with their port, and then restore their >CI when they are one playing? Assuming you plan to use UNIX: You can't in general attach a terminal to an already-running process, so your best bet is to have a game master process that reads a FIFO, socket, or (if you don't have FIFOs or sockets) a locked known file to get slave data (part of which for a new slave would be information on how to send data back to the player), and start up a fresh slave player process when a new player enters the game. Games like this have been distributed publicly, for example on USENIX tapes. One that was popular at JHU was called "search". Termination of a fork/execed process from the shell will return to the shell automatically; no magic required there.