📄 configurationdefaults.java
字号:
/* Written and copyright 2001-2003 Tobias Minich.
* Distributed under the GNU General Public License; see the README file.
* This code comes with NO WARRANTY.
*
*
* ConfigurationDefaults.java
*
* Created on 31. Juli 2003, 21:31
*/
package org.gudy.azureus2.core3.config.impl;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.io.File;
import org.gudy.azureus2.core3.stats.StatsWriterPeriodic;
import org.gudy.azureus2.core3.torrent.TOTorrent;
import org.gudy.azureus2.core3.tracker.client.TRTrackerClient;
import org.gudy.azureus2.core3.tracker.host.TRHost;
import org.gudy.azureus2.core3.tracker.server.TRTrackerServer;
import org.gudy.azureus2.core3.util.SystemProperties;
import org.gudy.azureus2.core3.config.*;
import org.gudy.azureus2.core3.util.*;
/**
*
* @author Tobias Minich
*/
/**
* Some (proposed) option naming conventions:
* - Starts with a general identifier
* General_ for, well, general things =)
* Server_ for webinterface specific things
* GUI_ (eventually) for GUI specific things
* Core_ (eventually) for core specific things
* - Second is some identifing term. It starts with a small letter denoting
* the vaiable type.
* b Boolean
* i Integer
* s String
* - Directory options should end with _Directory. This activates some
* special validity checks in the webinterface option parsing code.
* (Namely they are created if they don't exist and the option isn't changed
* with a logged error if a normal file of the same name exists)
*/
public class ConfigurationDefaults {
private static ConfigurationDefaults configdefaults;
private static AEMonitor class_mon = new AEMonitor( "ConfigDef");
private HashMap def = null;
public int def_int = 0;
public float def_float = 0;
public int def_boolean = 0;
public String def_String = "";
public byte[] def_bytes = null;
public static ConfigurationDefaults
getInstance()
{
try{
class_mon.enter();
if(configdefaults == null){
configdefaults = new ConfigurationDefaults();
}
return configdefaults;
}finally{
class_mon.exit();
}
}
/** Creates a new instance of Defaults */
protected
ConfigurationDefaults()
{
def = new HashMap();
/** Core settings **/
def.put("Override Ip", "");
def.put("Enable incremental file creation", new Long(0));
def.put("TCP.Listen.Port", new Long(6881));
def.put("max active torrents", new Long(4));
def.put("max downloads", new Long(4));
def.put("Max.Peer.Connections.Per.Torrent", new Long(COConfigurationManager.CONFIG_DEFAULT_MAX_CONNECTIONS_PER_TORRENT));
def.put("Max.Peer.Connections.Total", new Long(COConfigurationManager.CONFIG_DEFAULT_MAX_CONNECTIONS_GLOBAL));
def.put("File Max Open", new Long(50));
def.put("Max Uploads", new Long(4));
def.put("Max Upload Speed KBs", new Long(0));
def.put("Use Resume", new Long(1));
def.put("Save Resume Interval", new Long(5));
def.put("Check Pieces on Completion", new Long(1));
def.put("Stop Ratio", new Float(0));
def.put("Stop Peers Ratio", new Long(0));
def.put("Disconnect Seed", new Long(1));
def.put("priorityExtensions", "");
def.put("priorityExtensionsIgnoreCase", new Long(0));
def.put("Ip Filter Enabled", new Long(1));
def.put("Ip Filter Allow",new Long(0));
def.put("Ip Filter Enable Banning", new Long(1));
def.put("Allow Same IP Peers",new Long(0));
def.put("Use Super Seeding",new Long(0));
/** SWT GUI Settings **/
def.put("useCustomTab",new Long(1));
def.put("GUI Refresh",new Long(1000));
def.put("Graphics Update",new Long(4));
def.put("ReOrder Delay",new Long(0));
def.put("Send Version Info",new Long(1));
def.put("Show Download Basket",new Long(0));
def.put("config.style.refreshMT",new Long(0));
def.put("Open Details", new Long(0));
//default data location options
def.put("Use default data dir", new Long(0));
def.put("Default save path", "" );
def.put("GUI_SWT_bFancyTab", new Long(1));
def.put("GUI_SWT_bAlternateTablePainting", new Long(0));
def.put("update.start",new Long(1));
def.put("update.periodic",new Long(1));
def.put("update.opendialog",new Long(1));
def.put("Colors.progressBar.override", new Long(0));
def.put("Logging Enable", new Long(0));
def.put("Logging Dir", "");
def.put("Logging Max Size", new Long(5));
int[] logComponents = { 0, 1, 2, 4 };
for (int i = 0; i < logComponents.length; i++)
for (int j = 0; j <= 3; j++)
def.put("bLog" + logComponents[i] + "-" + j, new Long(1));
// Start/Stop Automation Stuff
def.put("StartStopManager_iNumPeersAsFullCopy", new Long(0));
def.put("StartStopManager_iFakeFullCopySeedStart", new Long(1));
def.put("StartStopManager_iMinPeersToBoostNoSeeds", new Long(1));
def.put("StartStopManager_iMinSpeedForActiveDL", new Long(512));
def.put("StartStopManager_iMinSpeedForActiveSeeding", new Long(512));
def.put("StartStopManager_iRankType", new Long(com.aelitis.azureus.plugins.startstoprules.defaultplugin.StartStopRulesDefaultPlugin.RANK_SPRATIO));
def.put("StartStopManager_iRankTypeSeedFallback", new Long(0));
def.put("StartStopManager_bAutoReposition", new Long(0));
def.put("StartStopManager_iMinSeedingTime", new Long(60*3));
def.put("StartStopManager_bIgnore0Peers", new Long(1));
def.put("StartStopManager_iIgnoreSeedCount", new Long(0));
def.put("StartStopManager_bPreferLargerSwarms", new Long(1));
def.put("StartStopManager_bDebugLog", new Long(0));
def.put("StartStopManager_iFirstPriority_Type", new Long(com.aelitis.azureus.plugins.startstoprules.defaultplugin.StartStopRulesDefaultPlugin.FIRSTPRIORITY_ANY));
def.put("StartStopManager_iFirstPriority_ShareRatio", new Long(500));
def.put("StartStopManager_iFirstPriority_SeedingMinutes", new Long(0));
def.put("StartStopManager_iFirstPriority_DLMinutes", new Long(0));
def.put("StartStopManager_bAutoStart0Peers", new Long(0));
// for "Stop Peers Ratio" ignore rule
def.put("StartStopManager_iIgnoreRatioPeersSeedStart", new Long(0));
// for "Stop Ratio" ignore rule
def.put("StartStopManager_iIgnoreShareRatioSeedStart", new Long(0));
//tracker proxy defaults
def.put( "Enable.Proxy", new Long(0) );
def.put( "Enable.SOCKS", new Long(0) );
def.put( "Proxy.Host", "" );
def.put( "Proxy.Port", "" );
def.put( "Proxy.Username", "" );
def.put( "Proxy.Password", "" );
// data proxy defaults
def.put( "Proxy.Data.Enable", new Long(0));
def.put( "Proxy.Data.SOCKS.version", "V4" );
def.put( "Proxy.Data.SOCKS.inform", new Long(1));
def.put( "Proxy.Data.Same", new Long(1));
def.put( "Proxy.Data.Host", "" );
def.put( "Proxy.Data.Port", "" );
def.put( "Proxy.Data.Username", "" );
def.put( "Proxy.Data.Password", "" );
//old
def.put( "Start Num Peers", new Long(-1) );
def.put( "Max Upload Speed", new Long(-1) );
def.put( "Max Clients", new Long(-1) );
def.put( "Server.shared.port", new Long(1) );
def.put( "Low Port", new Long(6881) );
def.put( "Already_Migrated", new Long(0) );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -