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:
parent
2d0690e625
commit
2a1e110a65
@ -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 );
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user