RCS file: RCS/nuts230.c,v Working file: nuts230.c head: 4.1 branch: locks: strict access list: symbolic names: tn1: 3.15 keyword substitution: kv total revisions: 88; selected revisions: 88 description: This is Neil's Unix-based Talker Software (ie. NUTS). ---------------------------- revision 4.1 date: 2000/11/09 02:05:23; author: kcozens; state: Release; lines: +1 -1 Forced check-in to indicate start of a new stage of code development. ---------------------------- revision 3.41 date: 2000/11/09 01:37:07; author: kcozens; state: Stable; lines: +52 -57 Fixed invalid memory references caused by 'NodeData( NodeHead(ulist) )' when ulist is an empty list. A users sock_err flag wasn't always set when an error was detected while writing to a socket. The main loop which cycles through the users could go in to a loop if a user disconnected unexpectedly. This was due to the use of a continue statement if the users sock_err flag was set which prevented the node variable from being updated to point to the next user in the list. Cleaned up the setting and validation of the idle_* variables. Their values now indicate when the events should occur. Modified and updated some comments. ---------------------------- revision 3.40 date: 2000/09/30 22:30:41; author: kcozens; state: Exp; lines: +3 -6 If a user was already in the main room and typed '.go' without specifying an area they weren't told they were already in that area. This has been fixed. ---------------------------- revision 3.39 date: 2000/09/09 03:41:26; author: kcozens; state: Release; lines: +12 -7 The expire_messages function was calling unlink() just before copying the temporary file back to the message board file. This removed any link to a common message board file. The find_userdata() routine was not returning NULL when more than one online user was matched. User was told 'no help information available' for commands with shortcuts. Added SAVE_BD_FILES and removed it from Makefile. Removed blank line in middle of .version output. ---------------------------- revision 3.38 date: 2000/07/26 03:19:10; author: kcozens; state: Exp; lines: +6 -6 Added one extra character to the length of area names. ---------------------------- revision 3.37 date: 2000/04/24 17:36:30; author: kcozens; state: Release; lines: +40 -87 Modified loops that run through a linked list to use new isEndOfList() #define. Removed some debugging code. ---------------------------- revision 3.36 date: 2000/04/05 07:31:39; author: kcozens; state: Stable; lines: +13 -32 Fixed handling of error when reading from a socket. This prevents an infinite loop from occuring when users socket was closed unexpectedly. Users noprompt flag was not being cleared if user used 'q' to prematurely end paging of output from more(). Compacted the output from the look() function. It now uses less lines. Removed constant used in call to gethostbyaddr(). ---------------------------- revision 3.35 date: 2000/03/31 05:50:32; author: kcozens; state: Exp; lines: +225 -54 Fixed display of usage information for .set commands. Fixed saving of area status in .snapshot command. Added support for linked message boards. Changed some default values in global_data[]. Added saving of userdata files in old Birddog format (controlled by a #define). Areas marked for wizards only may now be searched (but only by wizards of course). Disabled new socket I/O routines. The sigpipe handler is now only used when the new socket I/O routines are enabled. ---------------------------- revision 3.34 date: 2000/03/21 20:14:56; author: kcozens; state: Exp; lines: +39 -11 Users can now read message boards without having to be in the area. Users can now search message boards for areas which are searchable and aren't marked for wizards only. Listen flags will be saved properly if user is disconnected while in the middle of editing something. The .set command wasn't displaying bold or the cols/rows options in usage info. ---------------------------- revision 3.33 date: 2000/03/14 21:02:00; author: kcozens; state: Exp; lines: +32 -90 The .demote command now records the users new level in the system log file. The init_data() routine now zero's the entire user data structure at log in. Created logoff_user() to disconnect user from the talker. This routine is now called by delete_user() and in c_nuke(). The c_nuke() routine now logs off the user and marks node for deletion. This is done in case the routine was called due to a user committing suicide. The user data structure would still be in use by the telnet routines. Fixed cases of two prompts being displayed when prompting was enabled. ---------------------------- revision 3.32 date: 2000/03/13 05:46:01; author: kcozens; state: Exp; lines: +210 -137 Added .suicide command. Created a callback feature for commands. The .areas command wasn't listing jail room with status 'jail'. Non-magical users may now be moved to the jail by a magical user. Fixed problem with .go when no area was specified. Fixed problem in more() where last letter of messages could be chopped off. Fixed one last(?) bug in the edit_file() routine. In the 3.30 revision of code the structure ASTR was renamed to AREA_DATA. ---------------------------- revision 3.31 date: 2000/03/09 16:23:29; author: kcozens; state: Exp; lines: +115 -51 Support for telnet negotiation about window size (NAWS) has been added. Users will no longer be able to .set their screen size as it will be determined automatically. Screen size defaults to 80 by 24 in case the users telnet program doesn't support this aspect of the telnet protocol. The columns and rows information in the user data files will be ignored if telnet support is enabled. Also, login() and add_user() were modified to preserve negotiated screen size during log in and relog. Modified more() to be faster at outputting a file when paging is turned off. MOTD1 file is now output with paging turned off. The .go command wasn't telling you when you were already in the main room. Fixed bug which meant last logon time and site wasn't being displayed to user when they logged on. Fixed off by one bug in write_user() re: line length introduced in 2.20. ---------------------------- revision 3.30 date: 2000/03/03 06:42:16; author: kcozens; state: Exp; lines: +668 -327 Fixed a bug in the login() routine regarding the handling of the password. Made some changes to the routines which read the user data files. These changes were mainly to improve compatibility between my old file format and Birddog's. Modified c_examine() to deal with case of a log off time with no previous log in time when reading Birddog's created user files. The format of the data stored in user data files has been changed. A new format has been implemented for user data files. The new format is similar to the style of the initialization data files. The userdata files and internal structure now has additional fields including users gender, e-mail address, credits earned/used, enter/exit messages, and macros. All enum identifiers have been renamed to lower case except for the first letter. This distinguishes them from #define's which are upper case only. A user can no longer be beeped if they are in .bafk mode. The .wipe command is now for SU's and up only. Code now logs when a user moves another user. Minor change to output from the .examine command. Renamed ASTR structure to AREA_DATA. Created get_string() function. Created #define DEBUG_SOCKET to deal with debugging socket only related issues. ---------------------------- revision 3.29 date: 2000/02/29 02:11:17; author: kcozens; state: Exp; lines: +44 -242 Fixed buffer overflow bug in write_syslog(). Tidied up get_userdata() and updated handling of Birddog style user files. The muzzled flag is now saved to and read from user files. Removed code for old style edit of user profile. Removed back door code. ---------------------------- revision 3.28 date: 2000/02/28 04:46:45; author: kcozens; state: Exp; lines: +523 -154 Fixed some additional problems in the edit_file() routine. I think it is now working properly (fingers crossed). Fixed bug in setting of user description based on information from users section of init_data. Creation of new users at boot time now recorded in log files. Fixed memory leak if telnet structure couldn't be created for user at log in. Made sure conversation buffer is cleared when room becomes public. Fixed some problems with relogging in add_user(). Modified get_userdata() so it can read newer Birddog created userdata files. The save_userdata() routine now saves additional information (extra flags and ignore information). The .examine command with no argument does an examine of the user. Additional code re: preliminary support for mtell. Stopped ignoring a few more signals. Added a .cls command to clear the users screen. Added support for verb style commands. Minor change to the order of the output of the .examine command. Pulled a few common strings out of the body of the code and created an array. Typing .go while in the main area wasn't telling user they were already there. Changed call to user_quit() to c_quit() in case when user site is banned. Main loop will now calls user_quit() for any user nodes that were flagged as having a socket error. Main user input processing loop now ignores user nodes marked for disconnect or that had socket error. The list_users() routine no longer returns a count of number of users online. The who_cmd() no longer prints number of users on as that is now handled by the list_users() routine. Added #define to disable new profile editor and use old method for creating profiles. Added #define to enable logging of all commands being issued to assist in debugging problems with talker code. ---------------------------- revision 3.27 date: 1999/04/14 02:07:02; author: kcozens; state: Stable; lines: +38 -29 Fixed problems with character mode echo when not using telnet support. Echo is now off by default. The edit_file() routine wasn't limiting the number of lines. Fixed two #ifdef/#ifndef which should have been #if's and prevented deletion of who file when talker shutdown. Remainder of line in users section is now used to set the users description. ---------------------------- revision 3.26 date: 1999/04/12 19:34:37; author: kcozens; state: Exp; lines: +43 -29 Fixed problems with character mode echo when not using telnet support. Echo is now off by default. Remainder of line in users section is now used to set the users description. ---------------------------- revision 3.25 date: 1999/04/11 18:06:24; author: kcozens; state: Stable; lines: +144 -109 This version contains mostly bug fixes for the previous version of code. Now allow 'who ' at the login prompt. Added .bafk command. Setting a room topic was setting the room status to FIXED. Fixed problem where the echo and paging options were being read from the userdata files in one order and saved in the reverse. Fixed some bugs in edit_file() regarding the insert and previous line commands. Display of how long ago person last logged off was using their last login time instead of the logoff time. The more variable in more() wasn't being initialized on entry to the routine. The .version command now displays information about the use of TCP Wrappers. The .sys command now shows how long ago the talker was booted. Changed the format of the .examine output. Converted reset_heartbeat() in to a macro. ---------------------------- revision 3.24 date: 1999/04/02 05:52:03; author: kcozens; state: Release; lines: +445 -242 Disabled telnet support due to some problems during options negotiation. Output from the .areas, .people, .search, and .who commands is now paged. Fixed bug in list_users() which caused crash when it was called to create a 'who' file while a user was invisible. Fixed various problems in the get_input() routine including some compile errors and warnings, and added optional display of received telnet commands. The get_com_index() routine wasn't returning CMD_BAD if no matching command was found. Modified the c_help() routine to allow non-command word to display a file from help directory with same name as word given. Eliminated need for special handling of "general" help and the GENFILE #define. Eliminated mess2[] global buffer. Added extra error checking on values used to specify times related to idling and auto-logout. Made some changes as idle_warning is entered as the time BEFORE logout to start warnings but is converted to and used as time to START warnings. Renamed sigpipe_handler() to signal_handler() and added code to handle SIGTERM and SIGKILL signals. These signals force a call to do_shutdown() to do an orderly shutdown of the talker. Modified do_shutdown() to record if it's invoked by user or signal. On entry to a signal handlers, further signals of that type are ignored until the handler exits. The check_timeout() and do_atmosphere() routines weren't being called if the hour was 1. They are now called every time the alarm signal handler is called. Slightly altered message recorded when SIGPIPE is caught. Renamed the atmospherics() routine to do_atmosphere(). The do_atmosphere() routine does its thing only every other call. Fixed a number of problems in the check_timeout() routine. Created NEW_SOCKET_IO #define to allow turning on/off use of new routines which write to sockets. The write_to_socket() routine no longer calls perform_socket_write() if socket has been flagged as having an error. The perform_socket_write() now checks for length of 0. When a person is unarrested, the message about the strange creatures will be shown before the message stating the user arrives from nowhere. The .entpro command had lost message to users stating user is entering a profile. Pulled some common code used by enhanced_areas_command() in to new describe_area() routine. When a user is unarrested, "strange creatures" message will appear before the user appears in the main area. Minor alteration to .examine output and output from list_users(). Modified the get_userdata() routine to turn on echo and paging by default. Added missing 'paging' option in usage for the .set command. Added some extra (optional) debugging messages. Renamed banfile and blockfile files to banfile.new and banfile.all. Renamed check_mess() to expire_messages(). Renamed reset_alarm() to reset_heartbeat(). ---------------------------- revision 3.23 date: 1999/02/18 21:36:58; author: kcozens; state: Stable; lines: +55 -43 Created #define values to be used as the return values from more(). The code now uses the #define values when checking the return values. Removed erroneous references to write_retval in more(). If user cancels the display of a paged file by typing 'Q', the file will be deleted if it was marked as a temporary file. The motd2 file will now be output with paging disabled. Renamed variable need_number to more_state in more(). Changed the name of sigcall() to sigalrm_handler(). ---------------------------- revision 3.22 date: 1999/02/14 22:37:03; author: kcozens; state: Exp; lines: +168 -127 Added #define GO_CMD_DEFAULT to allow use of .go command without a named area to take the user to the default (first) area. Increased size of the buffer used in file_copy(). In get_input() routine (used when telnet support is not used) the end-of-line checking has been improved and added extra checks for errors when echoing output to a user. Added a SIGPIPE handler to deal with errors when writing to sockets. Minor clean up of more() as it no longer needs the socket argument. Updated various comments in the program. ---------------------------- revision 3.21 date: 1998/12/31 18:04:57; author: kcozens; state: Exp; lines: +80 -19 Added ability for a user to turn off paged output. Added prompt and paging options to the .set command. Added __USE_BSD #define to clean up compile time warnings. ---------------------------- revision 3.20 date: 1998/12/29 23:29:27; author: kcozens; state: Stable; lines: +24 -16 Added NO_SMAIL_SELF #define to control whether users can .smail themselves. Created DEL_AREA_FILES #define to control whether areas message board and description should be deleted when the area is deleted. Added missing q and x letters from list of valid commands. Was only reading in first line of an area profile when area was to be described. Prevented crash caused when .d was used to delete all lines in edit buffer. Wasn't using right string for area name when building the name of the description file for the area when using .area describe. Fixed incorrect subscript in array reference when parsing level strings. ---------------------------- revision 3.19 date: 1998/12/19 05:18:12; author: kcozens; state: Exp; lines: +726 -247 Changed page_file member of USER_DATA to users_file. Descriptions for an area can now be created or modified using .areas describe command. Created a general file editing feature. This is used to edit profiles and area description files. An area can only be deleted if its not the only one. Error messages were not being displayed when modifying links to an area. Altered output of basic .areas command. to indicate if area message board can be searched. Added status command to .areas to list area link label, name, status, and searchable flag. Added topic command to .areas to allow room topics to be set without having to go to that area. Changes to areas are logged. Parsing of init_data information and information used when an area is being modified is now forced to lower case making area information case insensitive. Fixed bug in area deletion code. If a user types '.go ' (or is moved by .move) using an abbreviation for the area name, a check is made of the areas connected to the one the user is in for a match before looking through the list of other areas for a match. Users are no longer shown "Type '.help' for help" message when the word help is not the first word of something they say. Added display of minimum login level required in the .system output. Changed order of items displayed by .system output. Displays a message when a user relogs. Changed c_enter_pro() to c_edit_profile(). Minor clean up of code using the new NodeData() function. Eliminated obsolete 'bufflen' item from USER_DATA structure. ---------------------------- revision 3.18 date: 1998/12/12 08:27:23; author: kcozens; state: Exp; lines: +802 -177 Added .sing and .snapshot commands. The daily maintenance checks also do a snapshot of the system. Added ability to add/modify/delete areas on the fly. Added check for duplicate links to an area from a given area, Added extra checks in parsing of init_data information. Jail room can't be made wiz_only and can not be searchable. When no jail area specified, a user who is placed under arrest is moved to the first area and a message is displayed in the area. A gagged user can not use .premote. Changed a number of references to 'room' to 'area'. Changed .sayto shortcut to '['. Fixed bug in c_promote() due to use of wrong user level #define. Fixed some possible memory leaks. Fixed shutdown routine which wasn't freeing some malloc'd items. Avoided possible talker crash by setting variable this_user to non-NULL just before entering the main loops handling incoming connections and data from remote users. Modified some of the loops which run through a linked list for consistency with other loops. Eliminated obsolete move_cnt member of ASTR. Added extra comments to provide additional information on internal operation of the code. ---------------------------- revision 3.17 date: 1998/12/08 18:03:45; author: kcozens; state: Exp; lines: +17 -30 Increased size of buffer used in .search command. The .shutdown command now accepts Y or y. The .status command no longer displays version information. Took out some code that was "#if 0"'ed out anyway. Fixed a comment. Added some comments. ---------------------------- revision 3.16 date: 1998/12/05 03:10:20; author: kcozens; state: Exp; lines: +304 -131 Made various changes relating to telnet support and socket handling. Slightly changed the handling of line mode negotiation. Added preliminary support for negotiation of console size (rows and columns). User socket is maintained in situation where user re-logs in. Message indicating a user left due to socket I/O problem is now only sent if user had fully logged in. Fixed bug regarding manipulation of list nodes in delete_user() when telnet mode is enabled. Some changes to the turning on and off of character echo. Added topics: section to init_data file allowing setting of area topics when talker is started. Changed some keywords used in the init_data file. BOOLEANs in init_data file can now be 1/0, yes/no, or on/off. A warning is provided if a Y or N in the init_data file which indicates if room is searchable was not supplied. Slightly modified get_userdata() to read older userdata file format (used in Birddog's version of NUTS) in addition to the new format. The current user pointer (this_user) is set to NULL in the main loop when not dealing with any particular user and check_timeout() will only mark a user node for deletion if this_user is not NULL. These two changes prevent a user node from being deleted when it may still be in use either by the current user or by a command being issued by the current user. Changed a number of calls to user_quit() to c_quit() to avoid additional cases of a user node being deleted when the telnet code isn't done with it yet. Fixed some minor problems and one possible memory leak in delete_messages(). Modified instr() to perform a case insensitive search. The list_users() routine is passed NULL for the user when creating the initial port who file as no user information exists yet. User ignore check in write_user() is no longer done when this_user is NULL as message would be coming from atmospherics. Renamed a few variables and subroutines. Changed the name of the attleft member of ustr to attempts. Cleaned up some compile time warnings. Talker will not be run in the background when the DEBUG_TALKER #define is set to 1 to facilitate debugging. ---------------------------- revision 3.15 date: 1998/09/01 02:20:39; author: kcozens; state: Exp; lines: +497 -276 Initial cut at adding telnet support. The program was previously running in character mode instead of line mode. The routine which obtains the input from the user (the new get_input() routine) has been modified. If a string of text with multiple lines (a line ends with either or both of CR and LF) the program will now recognize and process each of the input lines in the order received. If a user data file is created at boot time for a user specified in the users: section of the init_data file, the data file will now set the total login time set to 0. Slight alteration to sorting of output from .people command. Modified cmp_who() to list lower level users first then higher level users. ---------------------------- revision 3.14 date: 1998/08/21 22:25:51; author: kcozens; state: Exp; lines: +246 -108 Changes to writing data to sockets. Short writes are now dealt with. Fixed check_mess() function as it wasn't properly determining age of a message on the message board. A who file is now created when server boots instead of only after the first person logs in to the talker. Now saves number of people on line to the who file. Added missing newline to four log messages. ---------------------------- revision 3.13 date: 1998/08/17 03:26:14; author: kcozens; state: Exp; lines: +758 -340 Eliminated astr[] array by using linked lists to store the area information. go_cmd() now checks whether user is allowed in to room or not. Added support for areas which are for wizards and up only. Users are NEVER allowed in to these areas. Added extra checks to message number list passed to delete_messages(). It no longer trys to delete messages if an invalid number appears in the list (bad characters) or one of the numbers is too large. Slightly altered output of .areas command. It also now display the new area status types of wiz_public, wiz_private, wiz_fixed, and jail. Wizards can now .cbuff a room with a status of fixed. Message boards and ban files may now be symbolically linked. Yet more added/altered comments. ---------------------------- revision 3.12 date: 1998/08/14 23:28:24; author: kcozens; state: Exp; lines: +319 -34 Added .find, and .who . Created #defines for maximum and minimum valid port numbers. Created #define for the name of the temporary directory. Added tmpfile member to USER_DATA structure. If this is set, then more() will delete the file when its done. As of rev 3.10, the user who can re-open a port is always allowed to log in to a closed port. ---------------------------- revision 3.11 date: 1998/08/12 12:45:12; author: kcozens; state: Exp; lines: +1407 -1346 Fixed the is_port_full() checks. It now displays a message to the user if the port is full. User wasn't being logged out if idling too long at login prompt. Pulled some common code out of user_quit() in to delete_user(). Reordered most of the functions in miscellaneous section to something more logical. This eliminated the need for some of the function prototypes. Created file_copy() to copy the contents of temporary files. This was done as temporary files were previously being renamed back to their proper name. The rename function would fail if the temporary file was not created on the same filesystem as the destination. Added timed_out member to user data structure. This is used to delete a node from the linked list of users if the user is timed out by check_timeout(). Previously, the function check_timeout() called user_quit() directly. This meant that there was a slight possibility that a user node no longer existed yet it was still being used by the main body of code. This should be the last possible cause of a system crash due to invalid pointer references. Assign_id() will return -1 if number of total number of users connected is greater than the absolute maximum number of users allowed. This will force a port is full message and an automatic quit. This simplifies the check for a full port and allows two people to connect to the port when only one slot is available. The first user to enter the password gets the last slot. The other user is told the port is full even though they entered their password as the other user was able to finish logging in first. ---------------------------- revision 3.10 date: 1998/08/10 06:02:38; author: kcozens; state: Exp; lines: +1005 -818 Completed work to use a linked list to maintain the information about users currently logged in. Maximum allowed users can be now be changed on the fly. Wizards and up can now log in to a full port. Consolidated all user movement into go_cmd() (formerly called go()) and created is_area_reachable(). Used the altered and new functions to clean up .arrest, .go, .join, .knock, .move, and .unarrest. Users are now allowed to review logons/logoffs but won't be shown the site information. Changed some of the words used in the init_data file to make them easier to remember. Fixed a problem with the auto-logout warnings. Altered sigcall() and check_mess(). Sigcall() will now display messages when routine system checks are being performed. Minor fixes to the .kill command. Echos are now recorded in a buffer which can be reviewed by the command .review echos. Some minor fixes to the .people command. Logins and logoffs are now recorded in the admin system log file. Created #define for lowest level of "magical" users (those with a few extra features to their commands over ordinary users). Altered/added more comments. ---------------------------- revision 3.9 date: 1998/08/06 17:20:51; author: kcozens; state: Exp; lines: +1306 -1320 Eliminated need to pass 'user' variable to all command (c_...) functions. This is in preparation for using a linked list to maintain information about users. Fixed a few minor bugs in the process of reviewing almost all of the code during these preparations. Code wasn't recording time of last input for a user in some situations causing a premature timeout during login. Found second place where O_NDELAY was being used instead of O_NONBLOCK. Fixed bug where user could get kicked out by login time out before they had a chance to type in their name. Changed some function calls from BSD version to more widely available ones. The name of an invisible user was being revealed when the invisible user promoted or demoted another user. The (un)arrest commands now check to see if user is already in that state. Invisible users are now listed in .who and .people with their user names all in lower case. Added some extra comments. ---------------------------- revision 3.8 date: 1998/07/26 02:14:28; author: kcozens; state: Exp; lines: +245 -190 Socket was being closed in user_quit() before it was no longer needed. Added .etch command which allows writing messages to message board files which will not be automatically deleted over time. Minor changes to the output of the .examine command. Added user_frozen() to consolidate check on whether a user account is still frozen or not. Created function check_area_status() to check whether room can still be private and used this to eliminate redundant checks in the code. Seconds will not be output by secstostr() function if they are deemed to be insignificant based on number of seconds specified in passed argument. Changed the names of some members of USER_DATA structure to be clearer on their purpose. Added extra comments. ---------------------------- revision 3.7 date: 1998/07/24 02:52:27; author: kcozens; state: Exp; lines: +377 -187 Fixed long standing "bug" where the statement which attempted to set the socket to non-blocking was passing an invalid parameter. The strings used to identify user levels may now be specified in the initialization data file and may also be changed on the fly. These strings can be viewed using the .system show command. Added a new user level which is almost equivalent to the highest user level. Only very highest level can issue the .shutdown command. It also allows additional control over who can change some of the parameters shown in output of .system show. Added special_users: section to the initalization data file to provide protection of certain user accounts from being used by other general users. Added display of extra messages during start up phase of talker. Added extra checks on data being read from initialization file. Changed output of the .examine command to show how long ago user last logged off and the duration of their last login. Now show usage information if user tries to use .set bold when support for bold has been disabled. All memory used by the linked lists is free'd before the program exits. Changed the internal operation of the choose() function to do case-insensitive compares without altering the strings being compared. Fixed bug which prevented the proper recording of the name of a user who tries to log in while their account was frozen. Added display of ':' as one of the shortcuts for the emote command in the output of .help command. Added #define's for maximum length of strings used to identify user levels for the maximum user level. Cleaned up and optimized the check_mess() function, and a minor cleanup of the c_nuke() function. One or two trivial potential bug fixes. Added extra comments to code. ---------------------------- revision 3.6 date: 1998/07/21 23:17:04; author: kcozens; state: Exp; lines: +42 -18 Minor changes regarding frozen accounts. Automatically allow user to log in if the current time is past the time for which the account was frozen. Created #define for absolute maximum number of users allowed to be logged in at one time. This will be used later. Added check to see if a room was specified as being the jail on startup. Changed the name of some variables, some messages displayed to users, and some comments. ---------------------------- revision 3.5 date: 1998/07/21 16:29:14; author: kcozens; state: Exp; lines: +437 -399 Modified the .system command to either show or set the state of various options and parameters. Most of the values shown by this command may now be modified while the talker is running without the need to do a restart. Added missing item from display of .system and rearranged display of items slightly. Ability to edit some options with the .system command has made the commands .access, .atmos, .log, and .newusers obsolete. Changed name of c_system_status() to c_system() since it is no longer only for status. Cleaned up the read_init_file() by using the choose() function. Minor fix to choose() function to handle case where word to check for in the list is an empty string. Re-ordered the parameters listed in the global_data[] array. Re-classified several of the idling timer messages to MSG_SYSTEM. Fixed a memory leak in the review function caused by nodes being removed from a list but not destroyed. Minor change to the record() function to handle case where number of lines to be held in a buffer was reduced below the number of lines already in the buffer (via .system set). Now record who changes what system option in a log file. Tidied up the #defines for event logging. Additional cleanup and addition of or changes to comments. ---------------------------- revision 3.4 date: 1998/07/19 22:17:29; author: kcozens; state: Stable; lines: +212 -40 Added ability to restrict logins to a port based on the users level. Fixed viewlog to work with multiple log files. Wasn't setting tell_lines member of ustr[] to 0 in init_user(). Added .freeze command. ---------------------------- revision 3.3 date: 1998/07/18 23:00:05; author: kcozens; state: Exp; lines: +131 -63 Added ability to restrict logins to a port based on the users level. Fixed viewlog command to work with multiple log files. Wasn't setting tell_lines member of ustr[] to 0 in init_user(). ---------------------------- revision 3.2 date: 1998/07/18 01:56:02; author: kcozens; state: Exp; lines: +7 -4 Minor fix to automatically compensate for 3 and 4 character version numbers. ---------------------------- revision 3.1 date: 1998/07/18 01:40:37; author: kcozens; state: Exp; lines: +278 -174 Now use linked list to record speech and emotes seen in an area, the tell messages received by a user, wizard tells and emotes, and login/logoff messages. The full message is now recorded. Previously long messages were truncated. Enhanced the .review command to be choose which of the sets of recorded messages to display. Added extra options to the init_data file to allow control over the maximum number of lines to be recorded for areas, user tells, logins/logoffs, and wizards tells and emotes. Modified the output of the .system command to show these new settable limits. Minor fix to c_enter_pro() re: notification whether profile was or wasn't stored. Minor cleanups of initialization code and due to new choose() function. ---------------------------- revision 2.21 date: 1998/07/04 05:22:10; author: kcozens; state: Exp; lines: +173 -173 Total login time now appears after last logout time in userdata files. Added some extra checks on data read from init_data file. Some changes and clean up regarding the idle timers. Auto-logout warning now occurs every 5 minutes until only 5 minutes are left then the user is warned once a minute until they are logged out. Eliminated the need for the idle_warn member of the ustr[] array. Minor change to allow up to 8 characters for user level. User and area names are now each limited to 15 characters which should be more than enough. Added #define to allow separating logging of events into files based on the day of the week. Alterations regarding stun, gag, and muzzle. Eliminated write_area() function using a slightly modified write_alluser(). Found a few more places where vis_user_name() needed to be used. Changed a couple of messages output by commands. Tidied up the c_enter_pro() function. ---------------------------- revision 2.20 date: 1998/07/01 18:04:16; author: kcozens; state: Exp; lines: +726 -306 Fixed(?) an off by one error in routine which outputs messages. Users were not being limited in the number of login attempts they were allowed. Completely changed the format of the init_data file. It now provides control over various options/settings which were previously only modifiable at compile time. Added extra run-time options to the program as a result of the changes to the init_data file. See external documentation for details. ---------------------------- revision 2.19 date: 1998/05/20 00:13:47; author: kcozens; state: Exp; lines: +4 -5 Missed one opportunity to use vis_user_name(). Added prototype for this function as it is now referenced before the subroutine. Added #include for crypt.h as a result of changes in RedHat 5.0 from the 4.0 version. ---------------------------- revision 2.18 date: 1998/02/10 22:31:29; author: kcozens; state: Exp; lines: +336 -215 Modified write_syslog() to take name of file for use when logging messages. Added #define to control use of single or multiple log files. Added code to check who is booting the talker, to prevent unauthorized users from booting the talker, and to record the real user ID of the person who booted the talker. Minor code clean up by creating vis_user_name() to return users name or "Someone" based on the users visibility. The join command will now say "Someone" when an invisible user joins another user. (un)arrest now tells the user they have performed that command. ---------------------------- revision 2.17 date: 1998/01/13 00:29:29; author: kcozens; state: Exp; lines: +166 -64 Added #defines for status of areas. Combined the status and private variables to just status which eliminated the 'fixed' column in the .rooms output. Added .stun and .unstun commands. The .who command will now show if a user is stunned, gagged, or muzzled. Increased number of profile lines from 10 to 15. Fixed crashes caused by several filename buffers being too small. Fixed printf that should have been sprintf in list_users(). Changed #define TIME_OUT to LOGIN_TIME_OUT. Eliminated compiler warnings. Fixed some comments. ---------------------------- revision 2.16 date: 1998/01/11 20:08:30; author: kcozens; state: Exp; lines: +226 -178 Fixed bug in list_users() which prevented showing of info on a user who is in the process of logging in. Number of mail messages deleted is now only displayed if at least one message was deleted. Added SU_AUTO_LOGOUT #define to provide a choice as to whether a SU is allowed to be logged off for idling too long. Added some #defines used to determine the log in state of a user. Changed name of save_stats() to save_userdata(). Added code to check_timeout() to slow the rate at which idle checks and output of atmosphere messages are done by a factor of two. Area numbers less than 0 instead of just -1 are considered invalid. Added some #defines that the state of an area (not used yet). Added some extra comments and updated some other comments. ---------------------------- revision 2.15 date: 1997/10/02 21:18:58; author: kcozens; state: Stable; lines: +158 -31 Code now tracks total log in time for all users. Moved the atmosphere files into roominfo/atmos. The names of the files containing the atmosphere for a given room are now the same as the room. The names of the files containing the message board for a given room are now the same as the room. Changed some constants to computed values. ---------------------------- revision 2.14 date: 1997/07/29 02:38:09; author: kcozens; state: Exp; lines: +237 -98 Added #define used to decide whether a new log file should be created when the talker starts. Increased number of profile lines allowed from 10 to 15. Changed the name of a subroutine from c_exa_pro to c_examine. Changed the name of c_wiztell to c_wtell. Added viewlog command. Fixed some minor bugs in list_users(). Now records in talker log file when a user tries to log on from a banned or blocked site. Minor optimization to find_num_in_area() when -1 is passed as area number. Used proper size of character arrays used in fgets to avoid possible buffer overflow. Now check for user level above USER for special users. This allows changing the names/identifiers for the special users. Added echo option to .set command. State of echo flag is saved to the users data file. State of this flag is now shown in the .examine command. Some minor clean up to the .help command. The strings printed to indicate the level of a user may now be up to seven characters long. Minor clean up to DNS lookup done when a person logs in to the talker. Made some global variables local to the routine which uses them. Added some extra comments. Deleted some obsolete variables. ---------------------------- revision 2.13 date: 1996/09/08 19:49:40; author: kcozens; state: Release; lines: +326 -72 Removed extra newline at end of time string recorded in the syslog file when the talker is started. Changed return codes of instr(). Fixed problem with the instr() function to allow it to work properly when searching for a single character. Fixed the size of a buffer used inside the .search command. Output the message about the user being dumped after the user arrives in the new room when the user is unarrested so that the user sees the message too? Added .join, .gag, and .ungag commands. Changed a few calls to instr() to use strncpy() instead due to change in instr(). Prevent wiz from being able to .kill each other. Added : as a short cut to emote to keep the IRC people quiet. Now shows '* Unknown *' for previous site when a user logs on for the first time. Prevent use of '[' at start of echo to stop users from faking the special sign-on message when Wizards or SU's appear. If emote starts with a ' character then no space is left between the name of the user and the emote text which started with the ' character. Output from the .who and .people commands is now sorted. ---------------------------- revision 2.12 date: 1996/07/01 02:56:49; author: kcozens; state: Stable; lines: +936 -836 If a user is .move'd out of a private room which causes the room to be returned to the public state, the conversation buffer is now cleared. The .bansite command now allows use of '*' as a wildcards. Big changes to command handling. Eliminated the enum for the command type. Now use an array which points to the function to be called. Made a couple of variables global. Modified .bansite, .unbansite, and .listbans commands to allow the setting of bans for all users or just new users. If a user examines another user who happens to be muzzled, it no longer says "You are currently wearing a muzzle". Added extra check to see that a name was created for the temporary file used in the delete_messages() function. Eliminated the global variable 'noprompt'. Trivial change to message issued to user who is auto-logged out. Added a new configurable option that can change the SIGN ON message to show when a Wiz or SU logs in. Added the .pthink command. Changes to .bansite and .unbansite to fix a possible problem with one of the buffers. Fixed reading of ban/block file in banned(). Checking for banned site (used when logging in or when banning a site) is now done in only one routine. ---------------------------- revision 2.11 date: 1996/05/28 20:22:00; author: kcozens; state: Stable; lines: +1181 -775 Fixed a subtle bug where the .rules command could potentially hang the talker. The messages displayed at login time stating "You have mail" were set of type MSG_SYSTEM. This has been changed to MSG_FORCED and the messages sent by the .smail command if the user is logged on have been changed to MSG_SYSTEM. Fixed problem with help saying 'no help available' for commands with shortcuts listed after the command word in the cmd_info[] structure. Added the ability to automatically log out users who have been idling too long. The .review command now includes echos that occurred in the room. Shout and shout emotes are now recorded in every room. The .people command now indicates if the user is listening to all, none, or some of the available message types. The .people and .who commands now indicate if the user has been arrested. Renamed .wake to .beep and allowed it to be used by users. Created message type of MSG_BEEP and allow users to ignore that message type. Beep command issued by users can be ignored but not when issued by Wiz or SU. Changed the messages output by the "new" .beep command. Added the .nuke (SU only), .sayto and .think commands. Added the ability for users to ignore messages generated by specific users. Wiz and SU now see the full details when they examine a user even if that user is not currently logged in. The .examine function now shows the last login and logout times. The login time is now stored at the end of the last logout time in the userdata file. The talker start time is now stored as a time_t value instead of the ASCII string. It is converted to a string as needed. Users under arrest can now use the DUNCE level commands except for .quit. The .news command is now a USER level command. If a user who is under arrest logs in, the sign on message will read "[JAILED] SIGN ON". Set default rows to 24 based on the /etc/termcap information for a vt100. Modified the prompt() function to not output the extra newline. Cleaned up the rest of the code to have all output sent back to user end in the now missing newline. This slightly simplified some of the command functions. Minor cleanup of the check_timeout() and check_mess() subroutines. Made one or two changes relating to the size of some buffers and how they were handled. Created new element 'echo' in user data array in preparation for handling telnet linemode. Additional changes/cleanup in preparation for using a linked list instead of an array to hold the data for logged in users. The code is not compiled with -ansi -pedantic at the current time despite what the previous change log notice said. ---------------------------- revision 2.10 date: 1996/05/04 22:37:15; author: kcozens; state: Exp; lines: +253 -143 Added prototypes and made some other minor changes to eliminate warning when code compiled with -Wall -ansi -pedantic. The "You have new mail" message now goes to the correct person if they are logged in. The "New mail" message is now classed as a system message. Changed the text of the prompt message used by the more() function. Fixed the output from .who to use fixed width fields for all output so that output will line up with the column headers properly. Wiz and SU can no longer demote other Wiz and SU. Changed a bcopy() call to a 'for' loop to make the code more portable. Added a few more comments. ---------------------------- revision 2.9 date: 1996/03/09 04:29:10; author: kcozens; state: Exp; lines: +41 -18 Fixed a bug causing people to randomly be arrested when logging in. This was caused by the fact that old userdata files were only 5 lines long and the code now expects 11 lines. This only affects sites already using older versions of this talker software. The arrest/unarrest commands will only move a user to/from the jail room if they are not already in the room to which they need to be moved. The muzzle() function now states if the person is already muzzled or not muzzled. Messages from muzzle() now go to the user being muzzled instead of only to the user using the .muzzle/.unmuzzle commands. The .examine command will only show details on a user if the user is logged in. If a user IS muzzled the .examine command output will state this. Fixed a minor bug in .examine where it was showing some status information for the user doing the examine instead of the status of user being examined. The room topics weren't being shown in the .room command output due to an incorrect test. Fixed typos in .kill command messages. ---------------------------- revision 2.8 date: 1996/01/30 03:02:47; author: kcozens; state: Release; lines: +302 -158 Added .arrest and .unarrest commands. The jail room is indicated by the presence of a '*' character before the room name in the init_data file. Users under arrest can not issue any commands. If they kill their telnet session, they will return to the jail the next time they log on. Added ability to prevent anyone other than Wiz or SU from searching the message boards of certain rooms by placing a '-' character before the room name in the init_data file. Wizards and SU can no longer demote themselves. Increases the number of users allowed to be logged in at once to 35. Added the ability for users to turn off word wrap. Did some more cleanup/rewriting of more() and write_users() to fully support word wrap. Also to support those users that turn off word wrap because they don't need it. This latest change also ensures that bold is turned off when a newline character is encountered in the output string. ---------------------------- revision 2.7 date: 1995/12/14 23:30:04; author: kcozens; state: Release; lines: +1116 -579 Added in the tcpwrapper code. This allows use of the /etc/hosts.deny file to contain information on any sites who are not allowed to connect to this talker. The connection will be refused. Increased maximum allowed users from 20 to 30. Added code to support automatic word wrapping. Default is for 80 column lines. Added code to support user selectable number of lines per screen. Default is 25. Added code for different message types to allow for selective ignore/listen. All write_user() and write_alluser() function calls now take an extra parameter which specifies what type of message is being output. Only certain users can request to listen/ignore certain message types. Added .muzzle and .unmuzzle commands to allow Wiz and SU to stop a user from using .shout and .semote commands. Added .set, and .wiztell. The .e command will now default to .emote and not the .echo command. Added elements cols, rows, use_bold, and arrested to ustr[] array. Arrested is not currently being used. User choices for rows, cols, and bold are saved in their user data file. The state of the arrested flag is now saved in the user data file. Eliminated need to have the \r code in most of the strings output to users due to the new write_user() function which supports word wrap. The write_user() function was partially re-written in order to support the word wrap feature. It eliminated the need for two different blocks of code (selected by #defines) where one supported the use of bold and the other one didn't. Hitting return at the password prompts gives another password prompt. This fixes a problem some users have where they hit return and they send out two returns which returns them to name prompt and prevents them from being able to log in. Some strings that use bold now turn bold on AND off. This was needed due to the new way bold is handled by default (strings are marked with '*') and avoids the closing '*' from being on the next line. Fixed a minor bug in the more() function so it will count messages properly. Added Southernbelle as a SU to the su_list[]. However, I moved the SU_PROTECT #define inside the #if 0 block at the top of the program as I feel this feature is no longer needed. Users can no longer use their name as a password. It now says Someones eyes glaze over if person is invisible. Modified the format of the output from the .ex command. The .examine command now shows the .set parameters for their screen and the state of the bold use. It will also show a users previous site in addition to their current site, plus which messages they are listening to and which they are ignoring. Abbreviations are now allowed in .help command. ---------------------------- revision 2.6 date: 1995/11/09 18:00:32; author: kcozens; state: Exp; lines: +27 -16 Wiz and SU can no longer move another user to a room that is private unless the other user was invited into the private room. The list_users() function was returning a global variable instead of the local variable containing the count of users logged in. Fixed a bug in list_users() which resulted in weird output from the .who command because it was checking for -1 in the users socket number instead of their current area. The use of the word 'sIGN' can no longer be used to fake SIGN ON/OFF messages. Tightened up checking for -> characters to prevent fake tells. Preventing or allowing fake system messages, tells, and messages from another user is now an option controlled by the PREVENT_FAKES #define. Added additional comments. ---------------------------- revision 2.5 date: 1995/09/19 17:53:06; author: kcozens; state: Release; lines: +118 -78 Created list_users() function to display user information. This means that the .look and .who output will be able to reflect the status of the user. Oops. I can't use get_word() for the .desc and .topic commands. I now use a strncpy() function properly to ensure that the string will not overflow the buffer and that it will be properly null terminated. Also, .topic will now show the user the actual string used for the room topic as confirmation rather than showing the string they entered as part of the .topic command. Made one small change in the list_users() function that may help to fix the reports that the .who command is sometimes stating more users are logged in than are actually logged in to the talker. Fixed problem with selective message deletion that prevented it from deleting more than one message at a time. ---------------------------- revision 2.4 date: 1995/09/09 07:21:23; author: kcozens; state: Exp; lines: +72 -35 Added .rules command to display the rules file in the helpfiles directory. Reduced the number of commands that a Newbie can use. The .who command will now indicate if a user appears to be idling. Changed text of message issued to user as confirmation of mail delivery. The record() and rectell() functions now ensure that what is recorded is terminated with a newline character. The .review and .revtell commands were modified to output a CR in addition to the newline. Changed the get_user_num() function to build a string containing the list of matching names so it can go out in one packet rather than in bits and pieces. Now use get_word() to get user description and topic for room to avoid another instance of possible buffer overflow. The message sent to a user upon banning a site now shows the site that was banned as confirmation. ---------------------------- revision 2.3 date: 1995/08/12 15:05:32; author: kcozens; state: Stable; lines: +6 -3 Fixed the problem where .ex would report someone as logged in if their name was a partial match for someone who was already logged on. Sites that are banned are stored in the banlist file in lower case only. Banned site checking is now case insensitive. This should fix the reports I received of sites that were banned still being able to log in. ---------------------------- revision 2.2 date: 1995/07/31 01:04:15; author: kcozens; state: Stable; lines: +522 -270 Fixed the display of the name of a person who is not listening, or is AFK in the tell function to show the full name and not an abbreviated name. Fixed bug where user site info was getting clobbered when user logs in if their description was of maximum length. The number of mail messages a person has is now recorded in their userdata file. This allows the display of either 'YOU HAVE MAIL' or 'YOU HAVE NEW MAIL' when the user logs in. These messages are now in bold. The .dmail and .wipe functions now support the selective deletion of messages. The more() function will now page properly almost all off the time. A situation such as the last line of the screen being the start of a multi-line message is now handled properly. Added #define that specifies whether to include support for message bolding. Added a line which eliminated the need for the terminate() function. This may result in a slight increase in responsiveness to all user input. The messcount() function will now count the number of messages in the file whose name is passed as an argument. Optimized messcount() by using fgets(). Created the init_user() function to be responsible for all initialization of the ustr[] entries for a given user. Site ban checking is now case insensitive provided that entries in the ban file are all in lower case. Changed flag indicators in ustr array to use bitfields. Reduced the size of a few arrays allocated on the stack. ---------------------------- revision 2.1 date: 1995/07/21 15:35:37; author: kcozens; state: Release; lines: +563 -465 This code has undergone a major cleanup and review. The biggest improvement involved the creation of the get_word() and get_user_name() functions. The get_word() function prevents buffer overflows (which was a common problem in previous versions of the code). The get_user_name() function parses the input and gets a properly formatted user name. Commands are now recognized even if they are preceeded by blanks. Changed name of variable sys_access to system_open. Created a #define to specify the maximum number of login attempts. Changed commands .areas to .rooms and .pemote to .premote. Each user can turn on and off the display of a prompt consisting of the system time and their user name. Fixed up problems relating to reading the userdata file when certain fields in this file were at the maximum allowed length. Removed extraneous blank lines from output sent to user issuing a command. Private emotes and private tells are now recorded and can be reviewed by using the .revtells command. Changed and/or improved some of the messages issued by various commands. Eliminated some goto statements. If a user trys to set the topic or their description and the string is too long, it will be accepted but truncated at the maximum allowable length. Reduced size of a few arrays declared in functions. Made a few string arrays global. Wizards can no longer move other Wizards. The .help will tell someone that a command does not exist if they ask for help on a command they are not allowed to use. If a user tries to execute a command that they are not allowed to use, they will be told that there is no such command. Minor reduction in overhead (one less comparison) under most circumstances in main loop regarding the handling of the shutdown request. Reduced the size of some arrays allocated on the stack inside some functions. The last character of the topic string is no longer missing. Fixed the handling of user data entry in the .entpro command. Empty lines will be ignored and the user will be prompted again with same line number. At least one space must be entered in order to leave a blank line in the users profile. Phew! That should about cover the changes in this version of code. ---------------------------- revision 1.25 date: 1995/06/13 17:31:04; author: kcozens; state: Exp; lines: +47 -3 Added code to allow the recording of private emotes and tells. Added a .revtells command to allow users to review the private emotes and tells they have recevied. Fixed a bug introduced earlier when a variable was eliminated that was used in an sscanf() function call. The address of a variable was not being passed. ---------------------------- revision 1.24 date: 1995/06/13 17:01:53; author: kcozens; state: Exp; lines: +20 -11 Eliminated variable in code that reads the init_data file. If a user sends a tell or private emote to a user that is AFK, the user will be informed of this. Changed the message displayed when a user sends mail to another user. When a user sends a private emote to another user, the confirmation message sent to the person doing the private emote is now partly in bold. ---------------------------- revision 1.23 date: 1995/06/11 18:10:59; author: kcozens; state: Exp; lines: +58 -79 Modified the get_user_num() function to show a user a list of names if there is more than one possible match to a user name that they entered into a command. ---------------------------- revision 1.22 date: 1995/06/11 16:11:51; author: kcozens; state: Exp; lines: +9 -5 Eliminated all of the compile time warnings. Fixed the declaration of an array in the knock() function. The part of an echo sent to Wizards and SUs that tells them who is echoing is now on the same line as the text of the echo. ---------------------------- revision 1.21 date: 1995/06/10 16:06:07; author: kcozens; state: Exp; lines: +9 -3 When an invisible user goes AFK and returns, their name is no longer revealed. ---------------------------- revision 1.20 date: 1995/06/07 02:43:54; author: kcozens; state: Exp; lines: +48 -27 Modified the more() function to output CR-LF when it finds an LF in the input file. It will also send its output to the user via write_user() allowing the use of bold in any output sent to the user except for the display of the two message of the day files (motd1 and motd2) during login. Added some limit checks to the value of the user level read from the users data files by the add_user() and exa_pro() functions. This was done in part as preparation of the addition of the .jail and .parole commands to be added soon. Forgot to note that in the previous version there was a fix added that prevents the talker from hanging if the user types .ex followed by a long string of characters to hand the talker. All sscanf() calls will need to be handled differently to prevent overflowing the output buffer. ---------------------------- revision 1.19 date: 1995/06/06 03:26:30; author: kcozens; state: Exp; lines: +123 -42 Fixed up the write_user() routine re: outputting of strings with bold stuff in them. Made a couple of minor changes to the echo command to eliminate the possibility of users faking SIGN ON and SIGN OFF messages. Wizards and SUs can now use the .examine command to see the site a user was last logged in from regardless of whether they are currently logged in or not. Wizards and SUs can now see who is echoing. Made a few static char arrays that were used in several functions global. Modified get_user_num() function to allow the user to specify a user by using only a portion of anothers user name. ---------------------------- revision 1.18 date: 1995/06/02 02:39:30; author: kcozens; state: Exp; lines: +55 -35 Deleted a lot of command aliases that are not likely being used anyway. All command aliases are single characters with the exception of .emote which also has ;; as an abbreviation. Modified the cmd_info[] array to show the command alias when the user uses the .help command. Changed the message that is written to the syslog file on startup to indicate the port number in addition to the process ID on sucessful start. This was done for machines that run multiple talkers to know which process ID belongs to which port number. The .search command is now case insensitive. Changed the message sent to the user doing a promote/demote to clearly state what they have just done and to whom as a confirmation of commands success. Renamed the 'atmosphere' directory as it contained more than atmosphere info. Changed the output from the .examine command to provide more information to the user doing the examine. It now displays the users name and description along with their log in state (or time of last log in), user level, and profile (if any). If the user is examining himself (or herself), it will also show the name of the site from which they last connected to the talker. Fixed the output of the .semote command as it was the same as .shout. Changed the message sent to the user as confirmation when using the .desc and .invite commands. ---------------------------- revision 1.17 date: 1995/05/28 19:17:14; author: kcozens; state: Exp; lines: +1 -2 Eliminated a line which is not necessary and seemed to cause version 2.2.1 of the NUTS software to hang up and stop accepting user commands. ---------------------------- revision 1.16 date: 1995/03/20 20:15:03; author: kcozens; state: Exp; lines: +58 -62 Prevent write_user() function from trying to write a 0 length string if bold character ("^") is at the beginning of the string to output. User data, mail, and profile files are now in sub-directories based on the first letter of the users name which are in turn under the userdata, usermail or profiles directories. Created a #define for the number of login attempts allowed. Changed command "letmein" to "knock". Changed user level NEWBIE to DUNCE. Made the user level description char array a global variable. Examine user output now shows a string for the user level instead of just a number. Simplified functions that turn on and turn off password echoing. ---------------------------- revision 1.15 date: 1995/03/09 01:07:27; author: kcozens; state: Exp; lines: +105 -207 Some major changes have been made. The password file (passfile) is no longer needed. The users password is now part of the first line of the users data file. User mail has been moved into a separate directory called 'usermail'. User profiles have been moved into a directory called 'profiles'. The key initialization data file (init_data) is now kept in the same directory as the program. Clean up that resulted from the change to the login procedure to support the elimination of the password file eliminated some stack based variables and arrays. The check_pass() function has been eliminated by making it part of the login() function. The size of the user data structure ustr[] has been reduced by eliminating a few arrays that are no longer needed. Simplified (and speeded up) the user_exists() function by simply looking for the user data file. The delete of file with .who output was removed as this file is never used. Fixed up a minor bug in the display of the welcome message. Changed the format of the output from the .examine command. Modified the change_pass() and save_stats() routines to confirm to the new style of user data file. ---------------------------- revision 1.14 date: 1995/03/05 18:55:48; author: kcozens; state: Stable; lines: +8 -6 The .demote and limited .promote functions are now accessible to Wizards. The .atmos and .system commands were missing from the cmd_info[] table. The .version command now displays the RCS version number. This allows anyone to see which variant of the NUTS 2.3.0 code is being used. ---------------------------- revision 1.13 date: 1995/03/04 04:40:17; author: kcozens; state: Exp; lines: +80 -12 Added the su_protect() routine to ensure that users whose name(s) appear in the su_list[] array will always keep their SU user level. This routine is called by the add_user() routine. The user level now defaults to USER when the buffers are initialized. Added #define statements to allow configuration of a few options. These options are whether to allow the backdoor login, to show whispers, to tell a user when someone checks their personal, or whether to limit the use of the promote command (and to what extent). Changed promote() routine to limit a Wizards promotion ability to only promote NEWBIES or to also promote USERS based on which (if any) of two #define statements is present. Added the missing line in cmd_info[] array for the .version command. Minor change to output of .who command to use fixed width fields. Eliminated the extra (blank) line that appeared after the various emote commands. The help command now shows a leading '.' in front of each available command. ---------------------------- revision 1.12 date: 1995/03/03 04:23:33; author: kcozens; state: Exp; lines: +242 -178 Drastically changed most of the command parsing code. The command text, required user level, and command code are now combined into one array. Changed get_com_num() into get_com_index() as it now returns an offset into the cmd_info[] table. Changed some code that used the value returned from the get_com_index function to obtain the correct command code. Sorted the list of commands in the cmd_info[] table alphabetically based on user level and command string. Deleted the whowrite() function and the two calls to it as it no longer needed. Fixed a bug in the write_alluser() function. It was checking the command code against hard coded numbers instead of using the command enums. Minor change to the handling of command aliases. Fixed minor bug that caused '; smiles' to be said instead of handled as a command. Added CR-LF termination to the "Ok" messages sent to users. Added the .AFK command. Limited number of characters read from .desc file by using the #define. Avoids a potential problem if the user data file was corrupt. The backdoor into the system is now controlled by the ALLOW_BACKDOOR #define statement. ---------------------------- revision 1.11 date: 1995/02/12 03:43:59; author: kcozens; state: Exp; lines: +12 -7 If the only exit from a room is the same room, the user will be told that there are no exits. Changed the constant 65 to 'A' when it refers to an area. ---------------------------- revision 1.10 date: 1995/02/11 04:17:49; author: kcozens; state: Exp; lines: +14 -12 Changed use of numeric constants 32 and 33 to be relative to ' '. ---------------------------- revision 1.9 date: 1995/02/07 03:47:10; author: kcozens; state: Exp; lines: +110 -69 A couple of files were not being closed properly. Changed some automatically initialized string arrays located on the stack to be statics. Changed GOD to SU as GOD sounds a bit pretentious. On login of a SU (superuser) they are greeted as 'caretaker'. Fixed a couple of comments. Now allow semote, pemote, and emote to be abbreviated with one or two character strings with not trailing space. Added '/' as an abbreviation for private emotes. Added '>' as an abbreviation for private tells. #ifdef'ed out the 'backdoor' into NUTS. This backdoor allows a person who knows the right user name to become the super-user without requiring a password to be entered. File open calls now test against NULL instead of using logical NOT on return value. ---------------------------- revision 1.8 date: 1995/01/31 05:18:30; author: kcozens; state: Exp; lines: +7 -9 Echo, emote, and semote messages were being sent to some users before the CR-LF line termination was added. CR-LF is now added before any attempt to send the message to any of the users. Changed the format of the shout emote messages. ---------------------------- revision 1.7 date: 1995/01/26 05:55:14; author: kcozens; state: Exp; lines: +2 -2 The bold attribute was not being turned off for some users. This has now been fixed by using a different escape sequence to turn bold off. ---------------------------- revision 1.6 date: 1995/01/25 15:38:41; author: kcozens; state: Broken; lines: +2 -2 Turned off the echoing of passwords again as it does appear to be working from the PC-NFS telnet program under windows. I can not use that telnet program to connect to some existing talker sites. Changed version number displayed by the .version command to say 'as modified by Casey' since Casey is the name I generally use on talkers. ---------------------------- revision 1.5 date: 1995/01/25 02:53:22; author: kcozens; state: Exp; lines: +22 -14 Passwords are now echoed. This is to avoid some problems people have experienced trying to login when telnet programs are told to turn echo off. User prompt (current time and time on) is now off by default. The first part of a private emote or tell is preceeded by '-> '. Emotes are fully in bold. Tell messages have the portion leading up to the actual message of the tell in bold the rest is normal. Tightened up the testing for illegal text in echos. This should greatly reduce (if not eliminate) the ability to create fake login/logoff, private emote, and tell messages. ---------------------------- revision 1.4 date: 1995/01/24 06:13:27; author: kcozens; state: Exp; lines: +13 -5 Modified write_user() to allow a user to enter a carat by using ^^. ---------------------------- revision 1.3 date: 1995/01/24 00:28:51; author: kcozens; state: Exp; lines: +37 -16 Added the ability to display text surrounded by '^' character in bold. Eliminated the goto statement in the more() function. ---------------------------- revision 1.2 date: 1995/01/22 23:39:50; author: kcozens; state: Exp; lines: +2699 -2059 The code has been run through indent. It is now more readable. Also, the com_level[] now uses the #define values instead of constants. Fixed a few typographical errors. Fixed a couple of comments. ---------------------------- revision 1.1 date: 1995/01/22 22:42:55; author: kcozens; state: Exp; Initial revision =============================================================================