From a2c5a35c47895889a7f3ab47450a880a066d417d Mon Sep 17 00:00:00 2001 From: Cekis Date: Mon, 21 Mar 2022 15:30:37 -0400 Subject: [PATCH] Server account lot size now a config value. --- sku.0/sys.server/compiled/game/script/base_class.java | 10 ++++++++++ .../compiled/game/script/library/player_structure.java | 8 ++++---- .../compiled/game/script/player/live_conversions.java | 2 +- .../compiled/game/script/player/player_building.java | 4 ++-- .../game/script/vendor/vendor_control_device.java | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/sku.0/sys.server/compiled/game/script/base_class.java b/sku.0/sys.server/compiled/game/script/base_class.java index e3e7b0c7d..9b5a41d64 100755 --- a/sku.0/sys.server/compiled/game/script/base_class.java +++ b/sku.0/sys.server/compiled/game/script/base_class.java @@ -22090,6 +22090,16 @@ public class base_class { return _getAccountNumLots(getLongWithNull(player)); } + + /** + * Get the maximum housing lots a character can have + * @return The number of lots has available to them. + */ + private static native int _getMaxHousingLots(); + public static int getMaxHousingLots() + { + return _getMaxHousingLots(); + } /** * Find out what game features this player has purchased * @param player The player (creature object) diff --git a/sku.0/sys.server/compiled/game/script/library/player_structure.java b/sku.0/sys.server/compiled/game/script/library/player_structure.java index b67e174a3..daee831ca 100755 --- a/sku.0/sys.server/compiled/game/script/library/player_structure.java +++ b/sku.0/sys.server/compiled/game/script/library/player_structure.java @@ -116,7 +116,6 @@ public class player_structure extends script.base_script public static final float RATE_POWER_MIN = 1.0f; public static final float MERCHANT_SALES_MODIFIER = -0.2f; public static final int MIN_RESIDENCE_DURATION = 86400; - public static final int MAX_LOTS = 10; public static final int MAX_LIST_SIZE = 50; public static final int MAIL_WARNING_INTERVAL = 86400; public static final int TIME_TO_NEXT_PACKUP = 86400; @@ -815,7 +814,7 @@ public class player_structure extends script.base_script struct_lots = 1; } flagConverted(template, structure); - if ((getAccountNumLots(getPlayerObject(player)) + struct_lots) > MAX_LOTS) + if ((getAccountNumLots(getPlayerObject(player)) + struct_lots) > getMaxHousingLots()) { String realStructureTemplate = template; if (exists(structure)) @@ -1167,12 +1166,13 @@ public class player_structure extends script.base_script { lots_needed = 1; } - if (lots > MAX_LOTS) + int max_lots = getMaxHousingLots(); + if (lots > max_lots) { sendSystemMessageProse(player, prose.getPackage(new string_id(STF_FILE, "not_enough_lots"), lots_needed)); return false; } - if ((lots + lots_needed) > MAX_LOTS) + if ((lots + lots_needed) > max_lots) { if (!allowOverLotLimitIfPlayerHouse || (template.indexOf("object/building/player/player_house_") != 0)) { sendSystemMessageProse(player, prose.getPackage(new string_id(STF_FILE, "not_enough_lots"), lots_needed)); diff --git a/sku.0/sys.server/compiled/game/script/player/live_conversions.java b/sku.0/sys.server/compiled/game/script/player/live_conversions.java index 5983e3e10..8e969af13 100755 --- a/sku.0/sys.server/compiled/game/script/player/live_conversions.java +++ b/sku.0/sys.server/compiled/game/script/player/live_conversions.java @@ -703,7 +703,7 @@ public class live_conversions extends script.base_script } public void updateLotOverLimitStructureLocation(obj_id player) throws InterruptedException { - if (getAccountNumLots(getPlayerObject(player)) <= player_structure.MAX_LOTS) + if (getAccountNumLots(getPlayerObject(player)) <= getMaxHousingLots()) { removeObjVar(player, "lotOverlimit"); } diff --git a/sku.0/sys.server/compiled/game/script/player/player_building.java b/sku.0/sys.server/compiled/game/script/player/player_building.java index b017a108c..cbeb8b547 100755 --- a/sku.0/sys.server/compiled/game/script/player/player_building.java +++ b/sku.0/sys.server/compiled/game/script/player/player_building.java @@ -1845,7 +1845,7 @@ public class player_building extends script.base_script return SCRIPT_CONTINUE; } } - if ((perm_switch == 3) && (getAccountNumLots(getPlayerObject(self)) > player_structure.MAX_LOTS)) + if ((perm_switch == 3) && (getAccountNumLots(getPlayerObject(self)) > getMaxHousingLots())) { obj_id lotOverlimitStructure = getObjIdObjVar(self, "lotOverlimit.structure_id"); if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure == structure)) @@ -4831,7 +4831,7 @@ public class player_building extends script.base_script public int OnConstructionComplete(obj_id self, dictionary params) throws InterruptedException { string_id structure_name = params.getStringId("structure_name"); - int lots_remaining = player_structure.MAX_LOTS - getAccountNumLots(getPlayerObject(self)); + int lots_remaining = getMaxHousingLots() - getAccountNumLots(getPlayerObject(self)); prose_package pp_msg = new prose_package(); pp_msg.stringId = ((lots_remaining >= 0) ? SID_CONSTRUCTION_COMPLETE : SID_CONSTRUCTION_COMPLETE_LOT_LIMIT_EXCEEDED); pp_msg.actor.set(self); diff --git a/sku.0/sys.server/compiled/game/script/vendor/vendor_control_device.java b/sku.0/sys.server/compiled/game/script/vendor/vendor_control_device.java index dcebb99c7..8e48dacda 100755 --- a/sku.0/sys.server/compiled/game/script/vendor/vendor_control_device.java +++ b/sku.0/sys.server/compiled/game/script/vendor/vendor_control_device.java @@ -150,7 +150,7 @@ public class vendor_control_device extends script.base_script sendSystemMessage(player, SID_ONLY_IN_HOUSES); return SCRIPT_CONTINUE; } - if (getAccountNumLots(getPlayerObject(player)) > player_structure.MAX_LOTS) + if (getAccountNumLots(getPlayerObject(player)) > getMaxHousingLots()) { obj_id lotOverlimitStructure = getObjIdObjVar(player, "lotOverlimit.structure_id"); if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure != structure))