Implemented unlimited user download limits
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* File ..................: bbs/file.c
|
||||
* Purpose ...............: All the file functions.
|
||||
* Last modification date : 10-Aug-2001
|
||||
* Last modification date : 30-Sep-2001
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2001
|
||||
@@ -415,8 +415,10 @@ void Download(void)
|
||||
* Minus the amount downloaded today from downloadktoday
|
||||
* if less than zero, it won't let the user download anymore.
|
||||
*/
|
||||
exitinfo.DownloadKToday -= (Size / 1024);
|
||||
exitinfo.iTransferTime = iTransfer;
|
||||
if (LIMIT.DownK || LIMIT.DownF) {
|
||||
exitinfo.DownloadKToday -= (Size / 1024);
|
||||
exitinfo.iTransferTime = iTransfer;
|
||||
}
|
||||
|
||||
WriteExitinfo();
|
||||
Pause();
|
||||
|
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* File ..................: bbs/filesub.c
|
||||
* Purpose ...............: All the file sub functions.
|
||||
* Last modification date : 09-Aug-2001
|
||||
* Last modification date : 30-Sep-2001
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2001
|
||||
@@ -488,24 +488,26 @@ int ShowOneFile()
|
||||
|
||||
int CheckBytesAvailable(long CostSize)
|
||||
{
|
||||
if((exitinfo.DownloadKToday <= 0) || ((CostSize / 1024) > exitinfo.DownloadKToday)) {
|
||||
if (LIMIT.DownK || LIMIT.DownF) {
|
||||
if ((exitinfo.DownloadKToday <= 0) || ((CostSize / 1024) > exitinfo.DownloadKToday)) {
|
||||
|
||||
/* You do not have enough bytes to download \" */
|
||||
pout(12, 0, (char *) Language(252));
|
||||
Enter(1);
|
||||
Syslog('+', "Not enough bytes to download %ld", CostSize);
|
||||
|
||||
/* You do not have enough bytes to download \" */
|
||||
pout(12, 0, (char *) Language(252));
|
||||
Enter(1);
|
||||
Syslog('+', "Not enough bytes to download %ld", CostSize);
|
||||
colour(15, 0);
|
||||
/* You must upload before you can download. */
|
||||
pout(12, 0, (char *) Language(253));
|
||||
Enter(2);
|
||||
|
||||
colour(15, 0);
|
||||
/* You must upload before you can download. */
|
||||
pout(12, 0, (char *) Language(253));
|
||||
Enter(2);
|
||||
colour(14, 0);
|
||||
/* Kilobytes currently available: */
|
||||
printf("%s%lu Kbytes.\n\n", (char *) Language(254), exitinfo.DownloadKToday);
|
||||
|
||||
colour(14, 0);
|
||||
/* Kilobytes currently available: */
|
||||
printf("%s%lu Kbytes.\n\n", (char *) Language(254), exitinfo.DownloadKToday);
|
||||
|
||||
Pause();
|
||||
return FALSE;
|
||||
Pause();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Main user login procedure. Checks for limits,
|
||||
* new ratio's cats all the welcome screens, and
|
||||
* does a lot of checking in general.
|
||||
* Last modification date : 08-Aug-2001
|
||||
* Last modification date : 30-Sep-2001
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2001
|
||||
@@ -964,15 +964,23 @@ void user()
|
||||
sprintf(temp,"%s", (char *) GetDateDMY());
|
||||
|
||||
if((strcmp(StrDateDMY(usrconfig.tLastLoginDate), temp)) != 0) {
|
||||
usrconfig.iTimeLeft = LIMIT.Time; /* Copy Sec limit/time to users file */
|
||||
/*
|
||||
* If no timelimit set give user 24 hours.
|
||||
*/
|
||||
if (LIMIT.Time)
|
||||
usrconfig.iTimeLeft = LIMIT.Time;
|
||||
else
|
||||
usrconfig.iTimeLeft = 86400;
|
||||
usrconfig.iTimeUsed = 0; /* Set time used today to Zero */
|
||||
usrconfig.iConnectTime = 0; /* Set connect time to Zero */
|
||||
|
||||
/*
|
||||
* Give user new bytes and files every day
|
||||
* Give user new bytes and files every day if needed.
|
||||
*/
|
||||
usrconfig.DownloadKToday = LIMIT.DownK;
|
||||
usrconfig.DownloadsToday = LIMIT.DownF;
|
||||
if (LIMIT.DownK && LIMIT.DownF) {
|
||||
usrconfig.DownloadKToday = LIMIT.DownK;
|
||||
usrconfig.DownloadsToday = LIMIT.DownF;
|
||||
}
|
||||
}
|
||||
} /* End of else */
|
||||
|
||||
|
Reference in New Issue
Block a user