Short: AmiTCP on-line Amiga registry system Type: comm/net Author: jfriesne@ucsd.edu (Jeremy Friesner) Uploader: jfriesne@ucsd.edu (Jeremy Friesner) Requires: Workbench 2.04+, AmiTCP3.0b+ Replaces: comm/tcp/AmiTrack1.40 Version: 1.41 ---------------------------------------------------------------- AMITRACK V1.41 (Released 11/30/96) ---------------------------------------------------------------- INTRODUCTION ------------ What is AmiTrack? Hmm, good question. I was talking to an AmiPhone user a while ago, and he was lamenting that it was hard to find another AmiPhone user who was online to talk to. We decided what was needed was a way to find out who else is available, sort of an "Active Amiga registry". So that's what AmiTrack does. AmiTrack is an AmiTCP program that acts as the keeper of a list of Amigas that are currently on-line. It isn't limited to just AmiPhone users, either; you can register your Amiga to advertise any message string you want. This archive contains two executables: AmiTrack and AmiTrackServer. AmiTrack is a client that you can use to notify the world of your Amiga's presence on the internet, and AmiTrackServer is useful if you wish to let people use your Amiga as a registry site. AmiTrackServer must be launched from the CLI, but AmiTrack may be launched from either the CLI or by clicking its icon. INSTALLATION ------------ There isn't any, really. Just copy the executable files and icons to wherever you want to keep them. With the ToolTypes DONOTWAIT and CX_POPUP=NO set, AmiTrack can go into your WBStartup directory. If you wish to use the ACTION (app-launching) feature of AmiTrack, it is very likely you will have to modify the paths in the ACTION ToolTypes to suit the paths in your system. AMITRACK -------- The AmiTrack program is designed to connect to an Amiga running the AmiTrackServer program. While connected, it periodically does two things: it sends "ping" packets to the AmiTrackServer to let it know that you're still there, and it downloads the list of currently registered Amigas on that server, for your viewing pleasure. When you quit AmiTrack, you will be removed from the server's list of Amigas. AmiTrack understands the following parameters. These parameters may be set either as ToolTypes in AmiTrack's icon, or specified on the command line (in the same exact format as the tooltypes, although you may have to use "quote marks" if the parameter contains spaces): SERVER/K: The Internet host name of the Amiga that is running AmiTrackServer, that you wish to register with. This defaults to isys.ml.org. PORT/K/N: The port number on the server which you wish to connect to. This defaults to port 18945 (which by a bizarre coincidence, is also the default port for AmiTrackServer to accept connections on) COMMENT/K: The comment string you wish to have associated with your Amiga. This defaults to no comment. PINGDELAY/K/N: Sets the number of minutes to delay between pinging the AmiTrack server. Defaults to 1. Setting this to values greater than 4 are not recommended, as the AmiTrack server will drop you from its listing if it hasn't heard from you in 5 minutes or so. If set to zero, automatic pinging will be disabled. REFRESHDELAY/K/N: Sets the number of minutes to delay between refreshing your list of clients who are logged in to the AmiTrack server. If set to zero, automatic list refreshing will be disabled. ENABLED/K: If set to NO, AmiTrack will open in "disabled" mode. In this mode, AmiTrack will not register itself with the AmiTrack server. It will still periodically download the list of other clients, however. Thus, you can "lurk" by specifying this option. CONFIRMAPPLAUNCH/K: If set to NO, AmiTrack will not double-check with you whether or not you really wanted to launch an app when you double clicked on an entry in the ListView. Has no effect unless at least one ACTION parameter was also specified. ALLOWMULTIPLE/K: If set to YES, AmiTrack will allow you to run more than one copy of it at once. In this way, you can be connected to more than one server at a time, if necessary. (Note: This won't let you have more than 1 entry on at any given AmiTrackServer, the AmiTrackServer is smarter than that!) CX_POPUP/K: If set to NO, AmiTrack will not open its window on startup. CX_PRIORITY/K/N: Sets the Commodities priority of the AmiTrack commodity. Defaults to zero. CX_POPKEY/K: Sets a hotkey that will cause AmiTrack to open its window. Defaults to "lcommand shift a". ACTION0/K, ACTION1/K, ..., ACTION19/K: These 20 different ToolTypes can be used to allow AmiTrack to launch other programs by double-clicking on an item in the ListView. The values for these parameters must be in the form Label,Action. The label will be displayed in the cycle gadget at the right, and when an entry in the list is double-clicked, its associated Action string will be run as if it had been typed into a shell. Also, the token %s may be included in the value string up to 4 times. When the command is run, this token will be replaced with the IP hostname from the line that was double-clicked. Note that any application you run this way will by default have both stdin and stdout directed to NIL:. If you want to be able to access either or both of these streams, you will need to specify a redirect ('>' or '<') in you action string. TOP/K/N, LEFT/K/N, WIDTH/K/N, HEIGHT/K/N: These ToolTypes can be used to customize the default placement of the AmiTrack window on-screen. Some valid AmiTrack CLI invocations would be: AmiTrack AmiTrack "COMMENT=I'm online!" LEFT=50 TOP=10 AmiTrack SERVER=your.mother.com PORT=5217 CX_POPUP=NO "COMMENT=My comment" AmiTrack "COMMENT=Hi there" "CX_POPKEY=shift help" ENABLED=NO AmiTrack "ACTION0=AmiPhone,AmiTCP:bin/AmiPhone CONNECT=%s" "ACTION1=finger,finger @%s >CON://///WAIT/CLOSE" AmiTrack "ACTION0=FTP,AmiTCP:bin/ncFTP %s <>CON:" AMITRACK GUI ------------ AmiTrack's GUI is fairly straightforward. It consists of several string gadgets, two buttons, and a ListView. The Server, Port, and Comment string gadgets are self-explanatory (I hope!). The ListView shows the IP addresses and comment strings of everyone logged in to the server you are connected to. This list may be updated by clicking on the "Refresh" button, and will also be updated automatically every few minutes when the window is open, as indicated by the associated integer text gadget. The "Ping" button causes your client to send a packet to the AmiTrackServer, in effect saying "I'm here!". If the AmiTrackServer does not hear from your client for about five minutes straight, it will assume that you are no longer available and remove you from its list. Hence, it is probably a bad idea AmiTrack's ping interval to more than about four minutes. If any of the ACTION startup arguments were specified, a cycle gadget will also be present at the right side of the window. The cycle gadget indicates the name of the currently selected action. Clicking in the ListView will execute the associated command with the clicked-on entry's hostname as a parameter substituted wherever %s was found in the command string. Automatic refreshes and pings can be disabled by setting their interval gadget to zero. AmiTrack can be hidden via the Project menu. Its window can be reopened via its hotkey (see the CX_POPKEY argument above) or by clicking the "Show" button in the Commodities Exchange program. The "Enabled" option in the Project menu controls whether or not you wish to be visible on the AmiTrackServer's registry. You can also use the Enable/Disable buttons in the Commodities Exchange program is to control this. The "Confirm" option in the Project menu, if checked, will cause AmiTrack to bring up a requester making sure that you really wanted to launch a program. AMITRACK AREXX -------------- The AmiTrack client now features an ARexx interface. Scripts from the included "ARexx" directory may be used with this interface, or you can write your own. ARexx Commands understood by AmiTrack are listed here: --------------------------------------------------------------------- Command: CONNECT Description: Causes AmiTrack to launch an application, similar to to double-clicking on an entry in the ListView. Arguments: ACTION/K - Name of the app to launch (as it appears in the cycle gadget) ACTIONINDEX/K/N - Index number of the app to launch HOST/K - Name of the host to connect to, as it appears in the ListView. HOSTINDEX/K/S - Index of the host in the list to connect to. CONFIRM/K - Boolean override for the "Confirm Launch" menu option. Results: 0 if the app was launched, 5 if there were problems with the arguments specified, 10 if the app launch failed. Notes: All arguments are optional. If not otherwise specified, the currently specified action will be launched on the the previouly clicked host. Example: CONNECT ACTION 'AmiPhone' HOSTINDEX 2 CONFIRM false --------------------------------------------------------------------- Command: GET Description: Returns various state information. All values except the string-array (/M) values are returned automatically. To also return the string-arrays, specify their corresponding switch argument (CLIENTS/S or ACTIONS/S). Arguments: CLIENTS/S - return the lists of clients and their comment strings. ACTIONS/S - return the lists of GUI user-actions and their shell commands. Results: SERVER - IP name the AmiTrackServer is currently connected to. PORT/N - port number the AmiTrackServer connected to. CONFIRM/N - 1 iff "Confirm" in the Project menu is checked. CONNECTED/N - 1 iff AmiTrack has a valid connection to a server. NUMCLIENTS/N - The number of AmiTrack clients in the client list. ENABLED/N - 1 iff "Enabled" in the Project menu is checked. NUMACTIONS/N - The number of actions available in the cycle gadget. PINGINTERVAL/N - Number of minutes between automatic "pings". REFRESHINTERVAL/N - Number of minutes between automatic client list refreshes. MINUTESTILLPING/N - Minutes till the next automatic ping. MINUTESTILLREFRESH/N - Number of minutes till the next automatic refresh. HIDDEN/N - 1 iff the window is hidden (i.e. not open). COMMENT - The current comment string for this AmiTrack client. LASTCHANGEAT/N - Time at which the client list last changed (in seconds since 1970). LASTENTRYCLICKED/N - Index of the last client entry clicked on by the user. MYHOSTNAME - What AmiTrack thinks the local IP name is. CURRENTACTION/N - Index of the currently selected user action. ACTIONS/M - Array [0..NUMACTIONS-1] of user actions in cycle gadget. ACTIONS/S must have been specified. COMMANDS/M - Array [0..NUMACTIONS-1] of corresponding shell commands. ACTIONS/S must have been specified. CLIENTS/M - Array [0..NUMCLIENTS-1] of current AmiTrack clients. COMMENTS/M - Array [0..NUMCLIENTS-1] of comments associated with the clients. Notes: The numeric return value -1 means "invalid". Example: See ARexx/TestTrackRexx.rexx --------------------------------------------------------------------- Command: PING Description: Causes AmiTrack to send a UDP "ping" packet to the AmiTrackServer. Arguments: None. Results: 0 if AmiTrack was connected at the time, 5 if it was not. Notes: Example: PING --------------------------------------------------------------------- Command: QUIT Description: Causes AmiTrack to exit. Arguments: None. Results: None. Notes: Example: QUIT --------------------------------------------------------------------- Command: REFRESH Description: Causes AmiTrack to contact the AmiTrackServer and download an updated client list. Arguments: None. Results: 0 If AmiTrack was connected, 5 if it wasn't. Notes: Example: REFRESH --------------------------------------------------------------------- Command: REQUEST Description: Causes AmiTrack to display an EasyRequester to the user Arguments: TITLE/K - Text to be put in the requester's title MESSAGE/K - Text to be put in the requester's main body BUTTONS/K - '|' separated list of button labels. Results: CLICKED/N - Index of which button the user clicked. The right-hand button is index 0, and the left hand button is index 1. For Each successive button after the lefthand button, the index is incremented by 1. Notes: (Semi)appropriate defaults are used for any keywords not specified. Example: options results request stem rq. TITLE '"'||"My Title"||'"' MESSAGE '"'||"My Message"||'"' BUTTONS "Yes|Maybe|No" if (rq.clicked == 0) then say "you said no!" if (rq.clicked == 1) then say "you said yes!" if (rq.clicked == 2) then say "you said maybe!" --------------------------------------------------------------------- Command: SET Description: Changes any of a number of settings in AmiTrack. Arguments: ENABLED/K - Boolean to enable/disable AmiTrack. HIDDEN/K - Boolean to show/hide the AmiTrack window. CONFIRM/K - Boolean to enable/disable app launch confirmation requesters. LEFT/K/N - Sets the left edge position of the AmiTrack window (in pixels). TOP/K/N - Sets the top edge position of the AmiTrack window (in pixels). WIDTH/K/N - Sets the width of the AmiTrack window (in pixels). HEIGHT/K/N - Sets the height of the AmiTrack window (in pixels). COMMENT/K - Sets the current comment in the AmiTrack window. PINGDELAY/K/N - Sets the number of minutes between automatic pings. REFRESHDELAY/K/N - Sets the number of minutes between automatic refreshes. SERVER/K - Sets (and attempts to connect to) a new server. WINDOWTITLE - Displays a message in the AmiTrack Window's title bar. CURRENTACTION/K - Selects a new current user action (by label). CURRENTACTIONINDEX/K/N - Selects a new current user action (by index, first entry = 0). ACTION/K - Adds/Changes/Deletes a user action (see Notes, below). Results: ACTIONINDEX/N - If the ACTION keyword was used, this result will contain the index of the affected user action. Notes: Boolean arguments may be set using YES, NO, 1, 0, TRUE, or FALSE. Window dimensions will be truncated to the nearest legal setting. This allows one to make the window as small as possible by specifying WIDTH 0 HEIGHT 0, for example. The ACTION keyword takes a string of the form "Name,Action". If a user action with the name Name already exists, it will be modified to use the new Action string. If not, such a user action will be added to the end of the list. If you specify a Name without an Action, that User action will be deleted from the cycle gadget. Example: options results SET LEFT 15 HEIGHT 300 ENABLED true HIDDEN false SERVER localhost SET ACTION '"'||"AmiPhone,work:AmiPhone/AmiPhone %s"||'"' SET ACTION stem res. "TestAction,c:testProgram" say "TestAction's index is " res.actionindex SET CURRENTACTIONINDEX res.actionindex /* One way to do it... */ SET CURRENTACTION "TestAction" /* And the other way... */ SET ACTION "AmiPhone" /* Delete the AmiPhone user action */ --------------------------------------------------------------------- AMITRACKSERVER -------------- The AmiTrackServer executable is designed to accept AmiTrack client connections from all over the Internet and dole out information about who else has connected to it recently. Most people won't need this program, but it's there anyway for those who would like to run their own server. AmiTrackServer has no GUI, rather it sends only output to the CLI. It will display its list of registered Amigas to the CLI at regular intervals, and whenever the list is modified. The list displays the IP name of each Amiga, its comment string, and the number of seconds that have elapsed since the last "ping" was heard from that Amiga. AmiTrackServer takes one optional command line argument, the port number upon which it is to accept connections. This number defaults to 18945. AmiTrackServer will quit if sent a CTRL-C signal, and will refresh its CLI output of its list if sent a CTRL-D. TECHNICAL --------- AmiTrack tries to be as reliable and efficient as possible. The AmiTrack server keeps a linked list of the currently registered Amiga hostnames and their comment strings, as well as a timestamp of last time those Amigas were heard from. If an AmiTrack client has not sent a packet to the server for a specified amount of time (currently five minutes), it is liable to be removed from the registered list. This way, even if the client crashed and didn't send a disconnect packet, its entry won't hang around forever. To retrieve the list of clients, AmiTrack opens a TCP connection to the AmiTrack server, which immediately spits out a list of IP numbers, names, and comment strings, and then closes the connection. AmiTrack is written in DICE C, but there shouldn't be anything too compiler-dependent in it. MANIFEST -------- The following files should be in the AmiTrack archive: Listing of archive 'AmiTrack1.41.lha': Original Packed Ratio Date Time Name -------- ------- ----- --------- -------- ------------- 1188 642 45.9% 30-Nov-96 18:52:48 AmiTrack.info 37300 19994 46.3% 30-Nov-96 18:52:46 +AmiTrack 2147 1266 41.0% 30-Nov-96 18:52:46 +AmiTrack.info 25690 9402 63.4% 30-Nov-96 18:52:46 +AmiTrack.readme 840 295 64.8% 30-Nov-96 18:52:48 +AmiTrack.readme.info 12568 7643 39.1% 30-Nov-96 18:52:46 +AmiTrackServer 450 266 40.8% 30-Nov-96 18:52:46 +AmiTrackServer.info 628 270 57.0% 30-Nov-96 18:52:48 +ARexx.info 1152 464 59.7% 30-Nov-96 18:52:48 +TestTrackRexx.rexx 4232 1287 69.5% 30-Nov-96 18:52:48 +WatchAmiTrack.rexx 628 277 55.8% 30-Nov-96 18:52:44 +source.info 52043 15575 70.0% 30-Nov-96 18:52:44 +amitrack.c 2000 742 62.9% 30-Nov-96 18:52:46 +AmiTrack.h 5927 2156 63.6% 30-Nov-96 18:52:44 +amitrackserver.c 15918 5109 67.9% 30-Nov-96 18:52:46 +AmiTrackShared.c 5863 2027 65.4% 30-Nov-96 18:52:46 +amitrackshared.h 1783 450 74.7% 30-Nov-96 18:52:46 +dmakefile 15927 4873 69.4% 30-Nov-96 18:52:44 +TrackRexx.c 3650 1139 68.7% 30-Nov-96 18:52:46 +TrackRexx.h 2162 866 59.9% 30-Nov-96 18:52:44 +TrackRexx_rxcl.c 11900 2909 75.5% 30-Nov-96 18:52:46 +TrackRexx_rxif.c 91 72 20.8% 30-Nov-96 18:52:46 +TrackRexx_rxif.h -------- ------- ----- --------- -------- 204087 77724 61.9% 30-Nov-96 18:53:00 22 files AUTHOR ------ This program was written by Jeremy Friesner, using DICE C. My email address is jfriesne@ucsd.edu. (Try jaf@chem.ucsd.edu if that one doesn't work, though) ACKNOWLEDGEMENTS ---------------- Thanks to Oliver Hotz for providing a full-time AmiTrack server site. Thanks to AndyS and Gallant on #amiga for helping me debug & test. Thanks to the Fredrik Rambris and Johan Torin for suggesting so many cool enhancements! DISTRIBUTION ------------ AmiTrack is fully in the public domain. Do whatever you want with it. BUGS ---- - There ought to be a mechanism to ensure that you can't set the ping interval to be greater than the server's timeout interval. TODO ---- - Make a UNIX version of the server, and perhaps the client as well. - Write some type of SysInfoD so that people could query your system setup (what daemons you have running, etc) - Localize it! ;) - Some kind of optional "password" so that only people who knew the password could see you logged in. - Add some way for the AmiTrack client to notify ARexx scripts of interesting events (list changes, etc), thus avoiding polling. OTHER STUFF ----------- Some other programs I wrote: GadMget - Loads in an Aminet RECENT or INDEX file and lets you choose files to download via a pair of ListViews. Features keyword searching and sorting by name, size, age, directory, and description. When you're done, it outputs the ftp commands that are needed to download the selected files. The output formatting is extremely flexible, allowing generation of many formats: ftp, ncftp, ftp-by-mail, shell scripts, etc. Comes with an ARexx script to completely automate downloading with ncFTP. (util/misc/GadMget2.05.lha,93K) AmiSlate - A paint program that works with AmiTCP to allow two people to cooperatively paint on the same drawing from different computers. Features an extensive ARexx port which allows the construction of new features and games. Comes with ARexx scripts for chess, tic-tac-toe, backgammon, and others. (comm/tcp/AmiSlate1.4.lha,115K) AmiPhone - An Internet voice-chat program, similar to IPhone and VoiceChat and Nevot and all that, only Amiga-specific. Features aflexible buffering mechanism for slow connections, an ARexx port, IFF 8SVX transmission and playback, internal multitasking, and support for a variety of digitizers. (comm/net/AmiPhone1.92.lha,142K) HISTORY ------- 1.41 : (Public Release 11/30/96) - Added the CONNECT Arexx command. * The Stupid bug that had AmiTrack choosing a connect program based on the target's position in the ListView, rather than the current selection in the CycleGadget is fixed. 1.40 : (Public Release 11/25/96) - Added ARexx support to the AmiTrack client! See the ARexx section for details. - Added the ARexx directory and some sample ARexx scripts. - Added the TOP, LEFT, WIDTH, and HEIGHT startup arguments. - The AmiTrackServer now displays the number of clients connected. * The AmiTrackServer can now accept packets from hosts IPs that lack associated hostnames. 1.30 : (Public Release 11/4/96) - Added cool new icons, as given to me by Fredrik Rambris. - Added the ACTION0, ACTION1, ..., ACTION20 startup arguments, and the new action cycle gadget and app launching feature. - Added the CONFIRMAPPLAUNCH startup argument and menu item.t - Added the ALLOWMULTIPLE startup argument. * Fixed a bug that caused AmiTrack to register with the server on reconnect, even if it was marked "disabled". * AmiTrack no longer exits when its window is closed. * High-ASCII characters are now handled correctly. * The "socket in use" bug in the AmitrackServer is fixed. (thanks to Xavier Bestel!) 1.21 : (Public Release 10/22/96) - Added a time display to the "logins refreshed" message. - Window now retains the previous title bar message after being closed and reopened. * Oops, a stupid bug crept in that broke the automatic pinging and updating. Sorry about that! * Changed key-shortcut for the "About" box to lcommand-? 1.2 : (Public Release 10/22/96) - AmiTrack is now a commodity. - All the startup arguments have been changed, and new ones have been added. - Removed the iconify feature--use "Hide" and Commodities instead. - AmiTrack can now be started from the Workbench, and parses ToolTypes. - AmiTrack no longer requires AmiTCP to be running when AmiTrack is launched. If AmiTrack is launched and AmiTCP is not running, then AmiTrack will just wait around quietly until AmiTCP is started. This allows AmiTrack to be placed in your WBStartup directory! - Added the "Enable" item to the Project menu. - Made isys.ml.org the default server - Made absolutely no changes to the AmiTrackServer code. 1.11 : (Private Release 10/13/96) - Added iconify-on-startup. 1.1 : (Public Release 6/28/96) - Separated the AmiTrack server and client into two separate programs, and integrated GetTrackList into the client. - Added a nice GUI to the client program. - The AmiTrack protocol has changed slightly--v1.1 is not quite compatible with v1.0. Sorry! :( 1.0 : (Public Release 6/7/96) - Initial release. Works well for me, but untested in "real life".