1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 11:40:29 +00:00

Make the file descriptor limit configurable

This commit is contained in:
Lignum 2017-05-02 00:17:16 +02:00
parent 2d0690e625
commit 2a1e110a65
No known key found for this signature in database
GPG Key ID: E4DE8F54CA0912BA
2 changed files with 6 additions and 1 deletions

View File

@ -242,6 +242,10 @@ public class ComputerCraft
prop.setComment( "The disk space limit for floppy disks, in bytes" );
floppySpaceLimit = prop.getInt();
prop = config.get(Configuration.CATEGORY_GENERAL, "maximumFilesOpen", maximumFilesOpen);
prop.setComment( "How many files a computer can have open at the same time" );
maximumFilesOpen = prop.getInt();
prop = config.get(Configuration.CATEGORY_GENERAL, "turtlesNeedFuel", turtlesNeedFuel);
prop.setComment( "Set whether Turtles require fuel to move" );
turtlesNeedFuel = prop.getBoolean( turtlesNeedFuel );

View File

@ -6,6 +6,7 @@
package dan200.computercraft.core.filesystem;
import dan200.computercraft.ComputerCraft;
import dan200.computercraft.api.filesystem.IMount;
import dan200.computercraft.api.filesystem.IWritableMount;
@ -654,7 +655,7 @@ public class FileSystem
{
synchronized( m_openFiles )
{
if( m_openFiles.size() >= 4 )
if( m_openFiles.size() >= ComputerCraft.maximumFilesOpen )
{
throw new FileSystemException("Too many files already open");
}