3.1 Config Refactor

This commit is contained in:
AconiteGodOfSWG
2021-03-28 16:44:33 -04:00
parent 694a499356
commit 355796dd48
148 changed files with 900 additions and 6277 deletions
@@ -225,6 +225,11 @@ public class player_structure extends script.base_script
public static final string_id SID_NO_CITY = new string_id("city/city", "no_city_during_packup");
public static final string_id SID_GENERIC_CITY_PACKUP_ERROR = new string_id("city/city", "city_packup_generic_fail");
public static final string_id SID_MAYOR_PROTECTED = new string_id("city/city", "city_packup_mayor_protected");
public static final boolean STRUCTURE_FEES_DISABLED = utils.checkConfigFlag("GameServer", "disableStructureFees");
public static final int STRUCTURE_MAINTENANCE_HEARTBEAT = utils.getIntConfigSetting("GameServer", "maintenanceHeartbeat", 1800);
public static final boolean ENABLE_ABANDONED_STRUCTURES_SYSTEM = utils.checkConfigFlag("GameServer", "enableAbandonedHousePackup");
public static final boolean ALLOW_PACKING_ABANDONED_STRUCTURES = utils.checkConfigFlag("GameServer", "allowPlayersToPackAbandonedStructures");
public static obj_id createPlayerStructure(String template, obj_id owner, location loc, int rotation, dictionary deed_info) throws InterruptedException
{
if (template == null)
@@ -3577,7 +3582,7 @@ public class player_structure extends script.base_script
}
public static int decrementMaintenancePool(obj_id structure, int amt) throws InterruptedException
{
if (getConfigSetting("GameServer", "disableStructureFees") != null)
if (STRUCTURE_FEES_DISABLED)
{
return 1;
}
@@ -5388,17 +5393,7 @@ public class player_structure extends script.base_script
}
public static int getMaintenanceHeartbeat() throws InterruptedException
{
final int MAINTENANCE_HEARTBEAT = 1800;
String strConfigSetting = getConfigSetting("GameServer", "maintenanceHeartbeat");
if ((strConfigSetting != null) && (!strConfigSetting.equals("")))
{
int intHeartBeat = utils.stringToInt(strConfigSetting);
if (intHeartBeat > 0)
{
return intHeartBeat;
}
}
return MAINTENANCE_HEARTBEAT;
return STRUCTURE_MAINTENANCE_HEARTBEAT;
}
public static void sendOutOfMaintenanceMail(obj_id objStructure) throws InterruptedException
{
@@ -5504,10 +5499,10 @@ public class player_structure extends script.base_script
{
return false;
}
if (!utils.checkConfigFlag("GameServer", "enableHousePackup"))
{
return false;
}
//if (!utils.checkConfigFlag("GameServer", "enableHousePackup"))
//{
// return false;
//}
if (isAbandoned(structure) || isPreAbandoned(structure))
{
return true;
@@ -5520,7 +5515,7 @@ public class player_structure extends script.base_script
{
return false;
}
if (!utils.checkConfigFlag("GameServer", "enableAbandonedHousePackup"))
if (!ENABLE_ABANDONED_STRUCTURES_SYSTEM)
{
return false;
}
@@ -5618,7 +5613,7 @@ public class player_structure extends script.base_script
{
return false;
}
if (!utils.checkConfigFlag("GameServer", "allowPlayersToPackAbandonedStructures"))
if (!ALLOW_PACKING_ABANDONED_STRUCTURES)
{
return false;
}