home *** CD-ROM | disk | FTP | other *** search
- '
- ' RChat300 -- Or, RBBS-Chat, release 3.00. A character by character
- ' internode chat program..
- '
- ' Not the worlds prettiest, or cleanest code.. but I'm under no illusions..
- '
- ' Copyright 1989-1990 By John Morris All Rights Reserved
- ' modifications for rbbs17.4 by Pete Eibl
- '
- ' I'm not a big fan of global variables, but here goes..
- '
- ' $INCLUDE: 'RBBS-VAR.MOD' 'RBBS-VAR.BAS minus the DEF FN...
- '
- DEFINT A - Z
- COMMON Shared /Chat/ DoTrueChat, HasPaged, UpperNode, LowerNode, SaveToDisk
- COMMON Shared /Chat/ NodesToSquelch$
- COMMON SHARED /ChatField/ ChatActivity$, PagingNode$, PrivateFor$
- COMMON SHARED /ChatField/ ChatInput$, ChatName$, InTrueChat$
- COMMON SHARED /ChatField/ TrueChatIndex$, SavingToDisk$, BBSActivity$
- '
- 59800 ' $SUBTITLE: 'LogNewForChat - Save user info for chat'
- ' $PAGE
- '
- ' NAME -- LogNewForChat
- '
- ' INPUTS -- Zmaxnodes -- needed for creation of RBBSCHAT.DEF
- '
- ' OUTPUTS -- Updates the node record in RBBSCHAT.DEF with this users
- ' name and chat activity (always "I") when the user logs on.
- '
- ' PURPOSE -- See OUTPUTS. Also, if no RBBSCHAT.DEF is not found, one will be
- ' created.
- '
- SUB LogNewForChat(ZMaxNodes) STATIC
- CALL FindItX (ZChatFileName$, 9)
- REM ** If "RBBSCHAT.DEF" does not exist, then create it **
-
- IF NOT ZOK THEN
- CALL OpenWrk9 (ZChatFileName$)
- FIELD 9, 128 AS TempNode$
- LSET TempNode$ = SPACE$(128)
- FOR Index = 1 TO ZMaxNodes
- CALL LockIt9 (Index, ZFalse)
- NEXT
- END IF
-
- ChatIndex = ZNodeRecIndex - 1
- CLOSE 9
- CALL OpenWrk9 (ZChatFileName$)
- CALL Field9
- CALL LockIt9 (ChatIndex, ZTrue)
- LSET ChatActivity$ = "I" ' I means inactive
- LSET PagingNode$ = MKI$(0)
- LSET ChatName$ = SPACE$(31)
-
- IF ZActiveUserName$ = ZSysopPswd1$ + " " + ZSysopPswd2$ THEN
- LSET ChatName$ = "SYSOP"
- ELSE
- LSET ChatName$ = ZActiveUserName$
- END IF
-
- LSET ChatInput$ = SPACE$(72)
- LSET InTrueChat$ = "I"
- CALL LockIt9 (ChatIndex, ZFalse)
- CLOSE 9
- END SUB
-
- 59810 ' $SUBTITLE: 'CBCHECK - Check for a page attempt'
- ' $PAGE
- '
- ' NAME -- CBCHECK
- '
- ' INPUTS -- NONE
- '
- ' OUTPUTS -- ChatActivity$ Changed to reflect whether or not they
- ' are going to chat
- ' WillChat If WillChat is TRUE, then the user will
- ' automatically be thrust unawares into
- ' chat mode.. They said yes... didn't they?
- '
- ' PURPOSE -- Check to see if we have been paged from another node
- '
- SUB CBCheck(WillChat) STATIC
- WillChat = ZFalse
- exit sub
- END SUB
- 59820 ' $SUBTITLE: 'PageEm - attempt to page another user to chat'
- ' $PAGE
- '
- ' NAME -- PageEm
- '
- ' INPUTS -- ShowOnly Show whos is on the other nodes only
- ' Zmaxnodes Number of nodes in this system
- '
- ' OUTPUTS -- HasPaged -1 exit chat mode
- ' 0 don't check for reply to page
- ' 1 - Zmaxnodes check for page reply
- '
- ' PURPOSE -- Page another user on the system and set up for a reply
- ' from the other user
- '
- SUB PageEm(CurrentNodeIndex, ZMaxNodes, ShowOnly) STATIC
-
- REM ** Page 'Em only needs access to the COMMON variable HasPaged **
- SHARED HasPaged
-
- CALL WhosOn (ZMaxNodes)
- CALL SkipLine(1)
- END SUB
-
- 59830 ' $SUBTITLE: 'CBTrueChat - The letter by letter chat'
- ' $PAGE
- '
- ' NAME -- CBTrueChat
- '
- ' INPUTS -- Zmaxnodes
- '
- ' INTERNAL - NodesToSquelch$ STRING OF NODES NOT TO RECEIVE TEXT FROM
- ' HasPaged NODE (IF ANY) THAT THIS USER PAGED
- ' CurrentNodeIndex NODE RECORD IN "RBBSCHAT.DEF"
- ' ChatActivity$ CURRENT STATUS OF EACH NODE
- ' PagingNode$ NODE WHICH HAS PAGED THIS ONE
- ' ChatInput$ CURRENT TEXT INPUT BY USER FOR CHATTING
- ' ChatName$ NAME OF USER ON EACH NODE (NOT CURRENTLY USED)
- ' SquelchIt BOOLEAN - MEANS NODE IS IGNORED
- ' ZUserIn$() USED TO SAVE CURRENT STATUS OF EACH NODE
- ' THIS INFO IS LATER COMPARED, AND IF THAT
- ' STATUS IS CHANGED, THEN THE USER IS NOTIFIED
- ' OF THE CHANGE
- ' DoTrueChat Means we are in a true chat mode, we'll
- ' only check one node for input
- '
- '
- ' OUTPUTS -- NONE
- '
- ' PURPOSE -- To allow users to chat between nodes in several different
- ' ways.
- '
- SUB CBTrueChat(Zmaxnodes) STATIC
- CALL QuickTput1 ( "Chat Not avaiable on this system")
- Exit Sub
- End Sub
-
-
-
- REM **
- REM ** Save what a user is doing in the BBS.. for W)hos on mods..... **
- REM **
- 59910 SUB SaveUserActivity(Activity$, NodeRecordIndex, ReadIt) STATIC
-
- ChatNodeIndex = NodeRecordIndex - 1
-
- CLOSE 9
- CALL OpenWrk9 (ZChatFileName$)
- CALL Field9
-
- IF ReadIt THEN
- CALL LockIt9(ChatNodeIndex, ZTrue)
- Activity$ = BBSActivity$
- ELSE
- CALL LockIt9(ChatNodeIndex, ZTrue)
- LSET BBSActivity$ = Activity$
- CALL LockIt9(ChatNodeIndex, ZFalse)
- END IF
-
- IF NOT ReadIt THEN
- CLOSE 9
- END IF
-
- END SUB
-
- 59990 SUB Field9 STATIC
- REM ** all of these variables are SHARED between all subprograms in **
- REM ** this module (RCHAT300.BAS) **
- FIELD 9, 1 AS ChatActivity$, _
- 2 AS PagingNode$, _
- 2 AS PrivateFor$, _
- 72 AS ChatInput$, _
- 31 AS ChatName$, _
- 1 AS InTrueChat$, _
- 2 AS TrueChatIndex$,_
- 1 AS SavingToDisk$, _
- 1 AS BBSActivity$
- END SUB