home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
BBS_UTIL
/
RBTCH242.ZIP
/
EXAMPLE.ZIP
/
RSB2BYTE.ZIP
/
RSB2BYTE.MRG
< prev
next >
Wrap
Text File
|
1993-07-24
|
6KB
|
124 lines
* ------------[ BLED merge (c) Ken Goosens ]-------------
* Merge this against RBBSSUB2.BAS to produce RSB2BYTE.BAS
* RBBS-PC 17.4 - RBBSSUB2.BAS: Date 6-20-1992 Size 140946 bytes
* ------------[ Created 06-20-1992 14:45:00 ]------------
*
* REPLACING old line(s) by new
20096 ' $SUBTITLE: 'CheckRatio - subroutine to print ul/dl ratio'
' $PAGE
'
' NAME -- CheckRatio
'
' INPUTS -- PARAMETER MEANING
' TellUser TELL USER THEIR RATIO
' ZDnlds FILES DOWNLOADED
' ZDLBytes! BYTES DOWNLOADED
' ZUplds FILES UPLOADED
' ZULBytes! BYTES UPLOADED
'
' OUTPUTS -- ZOK -1 if okay to download, 0 otherwise
'
' PURPOSE -- To determine whether the users violated
' their upload to download restriction
'
SUB CheckRatio (TellUser) STATIC
ZOK = ZTrue
IF ZRatioRestrict# <= 0 OR (NOT ZEnforceRatios) OR ZFreeDnld THEN _
GOTO 20110
'
' Detemine method of ratio checking. Look ahead to amount downloaded
'
IF ZByteMethod = 1 OR ZByteMethod = 3 THEN _
Method$ = "Bytes" : _
ULWork# = ZULBytes! : _
DLWork# = ZDLBytes! + ZNumDnldBytes!
IF ZByteMethod = 0 OR ZByteMethod = 2 THEN _
Method$ = "Files" : _
ULWork# = ZUplds : _
DLWork# = ZDnlds + ZDownFiles
IF ULWork# < ZInitialCredit# THEN _
ULWork# = ZInitialCredit#
IF ZByteMethod = 2 THEN _
Today# = ZRatioRestrict# - ZDLToday! - ZDownFiles
IF ZByteMethod = 3 THEN _
Today# = ZRatioRestrict# - ZBytesToday! - ZNumDnldBytes!
'
Ratio# = 0
RatioSuffix$ = ":0"
IF ULWork# > 0 THEN _
Ratio# = (DLWork# / ULWork#) : _
RatioSuffix$ = ":1"
* -----------------[ first line different ]---------------
IF ZByteMethod > 1 THEN ' DGS070301-DS
IF ZBytesToday! > 0 THEN _ ' DGS070301-DS
DGSTemp! = ZBytesToday! ' DGS070301-DS
DGSTemp! = DGSTemp! + ZNumDnldBytes! ' DGS070301-DS
ZOutTxt$ = "Today Downloaded Files: " + STR$(ZDLToday! + ZDownFiles) + _
" Bytes:" + STR$(DGSTemp!) ' DGS070301-DS
DGSTemp! = 0 ' DGS071701-DS
ZSubParm = 5 ' DGS070301-DS
CALL TPut ' DGS070301-DS
CALL SkipLine (1) ' DGS070301-DS
GOTO 20100 ' DGS070301-DS
END IF ' DGS070301-DS
WasX$ = STR$(Ratio#)
X = INSTR(WasX$,".")
IF X > 0 THEN _
WasX$ = LEFT$(WasX$,X+1)
ZOutTxt$ = Method$ + " Downloaded:" + STR$(DLWork#) + _
" Uploaded:" + _
STR$(ULWork#) + _
" Ratio:" + _
WasX$ + _
RatioSuffix$
ZSubParm = 5
CALL TPut
'
' CHECK TO SEE IF THE USER HAS VIOLATED THEIR UL/DL RESTRICTION
'
20100 IF NOT (ZRatioRestrict# > 0 AND TellUser) THEN _
EXIT SUB
IF ZByteMethod <= 1 THEN _
GOTO 20105
IF Today# < 0 THEN ' DGS070301-DS
ZOutTxt$ = "Sorry, Daily download limit of" ' DGS070301-DS
IF ZBytesToday! < 0 THEN ' DGS070301-DS
ZOutTxt$ = ZOutTxt$ + STR$(ZRatioRestrict# - ZBytesToday!) ' DGS070301-DS
ELSE ' DGS070301-DS
ZOutTxt$ = ZOutTxt$ + STR$(ZRatioRestrict#) ' DGS070301-DS
END IF ' DGS070301-DS
ZOutTxt$ = ZOutTxt$ + " " + Method$ + " Reached" ' DGS070301-DS
ZOK = ZFalse ' DGS070301-DS
ZNumDnldBytes! = 0 ' DGS070301-DS
ELSE ZOutTxt$ = "Download balance:" + _
STR$(Today#) + _
" " + _
Method$ ' DGS070301-DS
ZOK = ZTrue ' DGS070301-DS
END IF ' DGS070301-DS
ZSubParm = 5
CALL TPut
CALL SkipLine(1)
EXIT SUB
'
20105 IF Ratio# > ZRatioRestrict# OR ULWork# = 0 THEN _
ZOK = ZFalse : _
ZOutTxt$ = "Sorry, DL/UL ratio of" + _
STR$(ZRatioRestrict#) + _
":1 " + _
Method$ + " exceeded" : _
ZSubParm = 5 : _
CALL TPut : _
ZOutTxt$ = "Minimum upload of" + _
STR$(INT(((DLWork# - (ULWork# * ZRatioRestrict#)) _
/ ZRatioRestrict#) + 1)) + _
+ " " + Method$ + " required to download" : _ ' DGS070301-DS
ZDownFiles = 0 _ ' DGS070301-DS
ELSE ZOutTxt$ = "Balance remaining before upload required:" + _
STR$(INT((ULWork# * ZRatioRestrict#)-DLWork#)) + _
" " + Method$
ZSubParm = 5
CALL TPut
CALL SkipLine (1)
20110 END SUB