diff --git a/AppVeyor/dbversion.txt b/AppVeyor/dbversion.txt index 4842b4d2bd..d16aaf980a 100644 --- a/AppVeyor/dbversion.txt +++ b/AppVeyor/dbversion.txt @@ -1 +1 @@ -0.9.282 +0.9.283 diff --git a/Source/ACE.Adapter/ACE.Adapter.csproj b/Source/ACE.Adapter/ACE.Adapter.csproj index 95752a0ac1..b7ebcf7c69 100644 --- a/Source/ACE.Adapter/ACE.Adapter.csproj +++ b/Source/ACE.Adapter/ACE.Adapter.csproj @@ -35,7 +35,7 @@ - + diff --git a/Source/ACE.Common/ACE.Common.csproj b/Source/ACE.Common/ACE.Common.csproj index ff448d6c61..ab11cf487e 100644 --- a/Source/ACE.Common/ACE.Common.csproj +++ b/Source/ACE.Common/ACE.Common.csproj @@ -16,7 +16,7 @@ - + diff --git a/Source/ACE.DatLoader.Tests/ACE.DatLoader.Tests.csproj b/Source/ACE.DatLoader.Tests/ACE.DatLoader.Tests.csproj index 37a0248800..94aeef5980 100644 --- a/Source/ACE.DatLoader.Tests/ACE.DatLoader.Tests.csproj +++ b/Source/ACE.DatLoader.Tests/ACE.DatLoader.Tests.csproj @@ -28,8 +28,8 @@ - - + + diff --git a/Source/ACE.DatLoader/ACE.DatLoader.csproj b/Source/ACE.DatLoader/ACE.DatLoader.csproj index f37da459ec..9d19c9e597 100644 --- a/Source/ACE.DatLoader/ACE.DatLoader.csproj +++ b/Source/ACE.DatLoader/ACE.DatLoader.csproj @@ -16,7 +16,7 @@ - + diff --git a/Source/ACE.Database.Tests/ACE.Database.Tests.csproj b/Source/ACE.Database.Tests/ACE.Database.Tests.csproj index dd87bf2976..5f1fcbdd12 100644 --- a/Source/ACE.Database.Tests/ACE.Database.Tests.csproj +++ b/Source/ACE.Database.Tests/ACE.Database.Tests.csproj @@ -29,8 +29,8 @@ - - + + diff --git a/Source/ACE.Database/ACE.Database.csproj b/Source/ACE.Database/ACE.Database.csproj index a00b13a707..52813e5979 100644 --- a/Source/ACE.Database/ACE.Database.csproj +++ b/Source/ACE.Database/ACE.Database.csproj @@ -18,7 +18,7 @@ - + diff --git a/Source/ACE.Server.Tests/ACE.Server.Tests.csproj b/Source/ACE.Server.Tests/ACE.Server.Tests.csproj index 3ded81d7ca..31a07adc2f 100644 --- a/Source/ACE.Server.Tests/ACE.Server.Tests.csproj +++ b/Source/ACE.Server.Tests/ACE.Server.Tests.csproj @@ -29,8 +29,8 @@ - - + + diff --git a/Source/ACE.Server/Command/Handlers/DeveloperContentCommands.cs b/Source/ACE.Server/Command/Handlers/DeveloperContentCommands.cs index 571f5ac6b4..8b5df00da4 100644 --- a/Source/ACE.Server/Command/Handlers/DeveloperContentCommands.cs +++ b/Source/ACE.Server/Command/Handlers/DeveloperContentCommands.cs @@ -571,21 +571,21 @@ public static string json2sql_weenie(Session session, string folder, string json output.LastModified = DateTime.UtcNow; sqlFilename = WeenieSQLWriter.GetDefaultFileName(output); - var sqlFile = new StreamWriter(sqlFolder + sqlFilename); + using (StreamWriter sqlFile = new StreamWriter(sqlFolder + sqlFilename)) + { - WeenieSQLWriter.CreateSQLDELETEStatement(output, sqlFile); - sqlFile.WriteLine(); + WeenieSQLWriter.CreateSQLDELETEStatement(output, sqlFile); + sqlFile.WriteLine(); - WeenieSQLWriter.CreateSQLINSERTStatement(output, sqlFile); + WeenieSQLWriter.CreateSQLINSERTStatement(output, sqlFile); - var metadata = new Adapter.GDLE.Models.Metadata(weenie); - if (metadata.HasInfo) - { - var jsonEx = JsonSerializer.Serialize(metadata, LifestonedConverter.SerializerSettings); - sqlFile.WriteLine($"\n/* Lifestoned Changelog:\n{jsonEx}\n*/"); + var metadata = new Adapter.GDLE.Models.Metadata(weenie); + if (metadata.HasInfo) + { + var jsonEx = JsonSerializer.Serialize(metadata, LifestonedConverter.SerializerSettings); + sqlFile.WriteLine($"\n/* Lifestoned Changelog:\n{jsonEx}\n*/"); + } } - - sqlFile.Close(); } catch (Exception e) { @@ -659,20 +659,18 @@ public static string json2sql_recipe(Session session, string folder, string json } sqlFilename = RecipeSQLWriter.GetDefaultFileName(recipe, cookbooks); - var sqlFile = new StreamWriter(sqlFolder + sqlFilename); + using (StreamWriter sqlFile = new StreamWriter(sqlFolder + sqlFilename)) { + RecipeSQLWriter.CreateSQLDELETEStatement(recipe, sqlFile); + sqlFile.WriteLine(); - RecipeSQLWriter.CreateSQLDELETEStatement(recipe, sqlFile); - sqlFile.WriteLine(); + RecipeSQLWriter.CreateSQLINSERTStatement(recipe, sqlFile); + sqlFile.WriteLine(); - RecipeSQLWriter.CreateSQLINSERTStatement(recipe, sqlFile); - sqlFile.WriteLine(); + CookBookSQLWriter.CreateSQLDELETEStatement(cookbooks, sqlFile); + sqlFile.WriteLine(); - CookBookSQLWriter.CreateSQLDELETEStatement(cookbooks, sqlFile); - sqlFile.WriteLine(); - - CookBookSQLWriter.CreateSQLINSERTStatement(cookbooks, sqlFile); - - sqlFile.Close(); + CookBookSQLWriter.CreateSQLINSERTStatement(cookbooks, sqlFile); + } } catch (Exception e) { @@ -760,14 +758,14 @@ public static string json2sql_landblock(Session session, string folder, string j } sqlFilename = LandblockInstanceWriter.GetDefaultFileName(landblockInstances[0]); - var sqlFile = new StreamWriter(sqlFolder + sqlFilename); - - LandblockInstanceWriter.CreateSQLDELETEStatement(landblockInstances, sqlFile); - sqlFile.WriteLine(); - LandblockInstanceWriter.CreateSQLINSERTStatement(landblockInstances, sqlFile); + using (StreamWriter sqlFile = new StreamWriter(sqlFolder + sqlFilename)) + { + LandblockInstanceWriter.CreateSQLDELETEStatement(landblockInstances, sqlFile); + sqlFile.WriteLine(); - sqlFile.Close(); + LandblockInstanceWriter.CreateSQLINSERTStatement(landblockInstances, sqlFile); + } } catch (Exception e) { @@ -822,14 +820,13 @@ public static string json2sql_quest(Session session, string folder, string json_ if (quest.LastModified == DateTime.MinValue) quest.LastModified = DateTime.UtcNow; - var sqlFile = new StreamWriter(sqlFolder + sqlFilename); - - QuestSQLWriter.CreateSQLDELETEStatement(quest, sqlFile); - sqlFile.WriteLine(); - - QuestSQLWriter.CreateSQLINSERTStatement(quest, sqlFile); + using (StreamWriter sqlFile = new StreamWriter(sqlFolder + sqlFilename)) + { + QuestSQLWriter.CreateSQLDELETEStatement(quest, sqlFile); + sqlFile.WriteLine(); - sqlFile.Close(); + QuestSQLWriter.CreateSQLINSERTStatement(quest, sqlFile); + } } catch (Exception e) { @@ -2217,20 +2214,19 @@ public static void ExportSQLRecipe(Session session, string param) try { - var sqlFile = new StreamWriter(sql_folder + sql_filename); - - RecipeSQLWriter.CreateSQLDELETEStatement(recipe, sqlFile); - sqlFile.WriteLine(); - - RecipeSQLWriter.CreateSQLINSERTStatement(recipe, sqlFile); - sqlFile.WriteLine(); + using (StreamWriter sqlFile = new StreamWriter(sql_folder + sql_filename)) + { + RecipeSQLWriter.CreateSQLDELETEStatement(recipe, sqlFile); + sqlFile.WriteLine(); - CookBookSQLWriter.CreateSQLDELETEStatement(cookbooks, sqlFile); - sqlFile.WriteLine(); + RecipeSQLWriter.CreateSQLINSERTStatement(recipe, sqlFile); + sqlFile.WriteLine(); - CookBookSQLWriter.CreateSQLINSERTStatement(cookbooks, sqlFile); + CookBookSQLWriter.CreateSQLDELETEStatement(cookbooks, sqlFile); + sqlFile.WriteLine(); - sqlFile.Close(); + CookBookSQLWriter.CreateSQLINSERTStatement(cookbooks, sqlFile); + } } catch (Exception e) { @@ -2278,14 +2274,25 @@ public static void ExportSQLLandblock(Session session, string param) LandblockInstanceWriter.WeenieNames = DatabaseManager.World.GetAllWeenieNames(); } - var sqlFile = new StreamWriter(sql_folder + sql_filename); - - LandblockInstanceWriter.CreateSQLDELETEStatement(instances, sqlFile); - sqlFile.WriteLine(); - - LandblockInstanceWriter.CreateSQLINSERTStatement(instances, sqlFile); + using (StreamWriter sqlFile = new StreamWriter(sql_folder + sql_filename)) + { + // Check if the Landblock is empty + if(instances.Count > 0) + LandblockInstanceWriter.CreateSQLDELETEStatement(instances, sqlFile); + else + { + // We'll just create a dummy list with a fake instance in our landblock so we don't anger CreateSQLDeleteStatement() + CommandHandlerHelper.WriteOutputInfo(session, $"Landblock {landblockId:X4} is empty."); + List dummyList = new List (); + LandblockInstance dummyInstance = new LandblockInstance(); + dummyInstance.ObjCellId = (uint)(landblockId << 16); + dummyList.Add(dummyInstance); + LandblockInstanceWriter.CreateSQLDELETEStatement(dummyList, sqlFile); + } + sqlFile.WriteLine(); - sqlFile.Close(); + LandblockInstanceWriter.CreateSQLINSERTStatement(instances, sqlFile); + } } catch (Exception e) { @@ -2325,14 +2332,14 @@ public static void ExportSQLQuest(Session session, string questName) try { - var sqlFile = new StreamWriter(sql_folder + sql_filename); - - QuestSQLWriter.CreateSQLDELETEStatement(quest, sqlFile); - sqlFile.WriteLine(); + using (StreamWriter sqlFile = new StreamWriter(sql_folder + sql_filename)) + { - QuestSQLWriter.CreateSQLINSERTStatement(quest, sqlFile); + QuestSQLWriter.CreateSQLDELETEStatement(quest, sqlFile); + sqlFile.WriteLine(); - sqlFile.Close(); + QuestSQLWriter.CreateSQLINSERTStatement(quest, sqlFile); + } } catch (Exception e) { @@ -2379,14 +2386,13 @@ public static void ExportSQLSpell(Session session, string param) try { - var sqlFile = new StreamWriter(sql_folder + sql_filename); - - SpellSQLWriter.CreateSQLDELETEStatement(spell, sqlFile); - sqlFile.WriteLine(); - - SpellSQLWriter.CreateSQLINSERTStatement(spell, sqlFile); + using (StreamWriter sqlFile = new StreamWriter(sql_folder + sql_filename)) + { + SpellSQLWriter.CreateSQLDELETEStatement(spell, sqlFile); + sqlFile.WriteLine(); - sqlFile.Close(); + SpellSQLWriter.CreateSQLINSERTStatement(spell, sqlFile); + } } catch (Exception e) { diff --git a/Source/ACE.Server/Managers/HouseManager.cs b/Source/ACE.Server/Managers/HouseManager.cs index b1d3168bc4..3b44748dd9 100644 --- a/Source/ACE.Server/Managers/HouseManager.cs +++ b/Source/ACE.Server/Managers/HouseManager.cs @@ -408,6 +408,7 @@ private static void HandleRentPaid(PlayerHouse playerHouse) player.SaveBiotaToDatabase(); + var clearedInventoryStatus = ""; if (playerHouse.House.HouseStatus == HouseStatus.Active) { // clear out slumlord inventory @@ -415,9 +416,10 @@ private static void HandleRentPaid(PlayerHouse playerHouse) slumlord.ClearInventory(); slumlord.SaveBiotaToDatabase(); + clearedInventoryStatus = "and cleared "; } - log.DebugFormat("[HOUSE] HouseManager.HandleRentPaid({0}): rent payment successful!", playerHouse.PlayerName); + log.DebugFormat($"[HOUSE] HouseManager.HandleRentPaid({0}): rent payment successfully collected {clearedInventoryStatus}from SlumLord!", playerHouse.PlayerName); // re-add item to queue AddRentQueue(player, playerHouse.House); @@ -458,7 +460,7 @@ public static void HandleEviction(House house, uint playerGuid, bool multihouse var nextRentTime = house.GetRentDue(purchaseTime); player.HouseRentTimestamp = (int)nextRentTime; - log.DebugFormat("[HOUSE] HouseManager.HandleRentPaid({0}): house rent disabled via config", player.Name); + log.DebugFormat("[HOUSE] HouseManager.HandleEviction({0}): house rent disabled via config", player.Name); // re-add item to queue AddRentQueue(player, house); diff --git a/Source/ACE.Server/Network/Structure/HouseData.cs b/Source/ACE.Server/Network/Structure/HouseData.cs index e4b232aad4..4a55dd3f60 100644 --- a/Source/ACE.Server/Network/Structure/HouseData.cs +++ b/Source/ACE.Server/Network/Structure/HouseData.cs @@ -56,6 +56,12 @@ public void SetRentItems(List rentItems) /// public void SetPaidItems(SlumLord slumlord) { + if (slumlord.House?.HouseOwner != null) + { + foreach (var item in Buy) + item.Paid = item.Num; + } + if (slumlord.House?.HouseStatus == HouseStatus.InActive) { foreach (var item in Rent) diff --git a/Source/ACE.Server/Network/Structure/HouseProfile.cs b/Source/ACE.Server/Network/Structure/HouseProfile.cs index 7e021603cd..b4323bde79 100644 --- a/Source/ACE.Server/Network/Structure/HouseProfile.cs +++ b/Source/ACE.Server/Network/Structure/HouseProfile.cs @@ -58,6 +58,12 @@ public void SetRentItems(List rentItems) /// public void SetPaidItems(SlumLord slumlord) { + if (slumlord.House?.HouseOwner != null) + { + foreach (var item in Buy) + item.Paid = item.Num; + } + if (slumlord.House?.HouseStatus == HouseStatus.InActive) { foreach (var item in Rent) diff --git a/Source/ACE.Server/ServerBuildInfo_Dynamic.cs b/Source/ACE.Server/ServerBuildInfo_Dynamic.cs index 8281b3d952..4cf2af6cdc 100644 --- a/Source/ACE.Server/ServerBuildInfo_Dynamic.cs +++ b/Source/ACE.Server/ServerBuildInfo_Dynamic.cs @@ -4,17 +4,17 @@ namespace ACE.Server public static partial class ServerBuildInfo { public static string Branch = "master"; - public static string Commit = "6f63d94bf25a1c34257071f5003ca595429a4626"; + public static string Commit = "a1d6fab020944b635d0d27862d8f00a4893b7d51"; - public static string Version = "1.63"; - public static string Build = "4606"; + public static string Version = "1.64"; + public static string Build = "4610"; public static int BuildYear = 2024; - public static int BuildMonth = 09; - public static int BuildDay = 30; + public static int BuildMonth = 10; + public static int BuildDay = 29; public static int BuildHour = 16; - public static int BuildMinute = 23; - public static int BuildSecond = 07; + public static int BuildMinute = 55; + public static int BuildSecond = 43; } } diff --git a/Source/ACE.Server/WorldObjects/House.cs b/Source/ACE.Server/WorldObjects/House.cs index 91b6f5b48c..6486756bd8 100644 --- a/Source/ACE.Server/WorldObjects/House.cs +++ b/Source/ACE.Server/WorldObjects/House.cs @@ -167,6 +167,8 @@ public static House Load(uint houseGuid, bool isBasement = false) house.ChildLinks.Remove(house.SlumLord); house.ChildLinks.Add(slumlord); + + slumlord.ParentLink = house; } return house; } diff --git a/Source/ACE.Server/WorldObjects/Player_House.cs b/Source/ACE.Server/WorldObjects/Player_House.cs index 4fab6041da..bd6baa957c 100644 --- a/Source/ACE.Server/WorldObjects/Player_House.cs +++ b/Source/ACE.Server/WorldObjects/Player_House.cs @@ -191,12 +191,17 @@ public void HandleActionRentHouse(uint slumlord_id, List item_ids) var slumlord = FindObject(slumlord_id, SearchLocations.Landblock) as SlumLord; if (slumlord == null) + { + log.Warn($"[HOUSE] {Name}.HandleActionRentHouse({slumlord_id:X8}): Could not find SlumLord in world."); return; + } if (slumlord.IsRentPaid()) { //Session.Network.EnqueueSend(new GameEventWeenieError(Session, WeenieError.HouseRentFailed)); // WeenieError.HouseRentFailed == blank message Session.Network.EnqueueSend(new GameMessageSystemChat("The maintenance has already been paid for this period.\nYou may not prepay next period's maintenance.", ChatMessageType.Broadcast)); + + log.Info($"[HOUSE] {Name}.HandleActionRentHouse({slumlord_id:X8}): The maintenance has already been paid for this period."); return; } @@ -211,6 +216,8 @@ public void HandleActionRentHouse(uint slumlord_id, List item_ids) if (ownerHouses.Count() > 1) { Session.Network.EnqueueSend(new GameMessageSystemChat("The owner of this house currently owns multiple houses. Maintenance cannot be paid until they only own 1 house.", ChatMessageType.Broadcast)); + + log.Info($"[HOUSE] {Name}.HandleActionRentHouse({slumlord_id:X8}): The owner of this house currently owns multiple houses. Maintenance cannot be paid until they only own 1 house."); return; } } @@ -275,7 +282,10 @@ public void HandleActionRentHouse(uint slumlord_id, List item_ids) } if (consumeItems.Count == 0) + { + log.Warn($"[HOUSE] {Name}.HandleActionRentHouse({slumlord_id:X8}): Nothing sent could be transferred to slumlord for rent."); return; + } foreach (var consumeItem in consumeItems) TryConsumeItemForRent(slumlord, consumeItem); @@ -292,7 +302,11 @@ public void HandleActionRentHouse(uint slumlord_id, List item_ids) HandleActionQueryHouse(); - Session.Network.EnqueueSend(new GameMessageSystemChat($"Maintenance {(slumlord.IsRentPaid() ? "" : "partially ")}paid.", ChatMessageType.Broadcast)); + var maintenanceStatus = $"Maintenance {(slumlord.IsRentPaid() ? "" : "partially ")}paid."; + + Session.Network.EnqueueSend(new GameMessageSystemChat(maintenanceStatus, ChatMessageType.Broadcast)); + + log.Info($"[HOUSE] {Name}.HandleActionRentHouse({slumlord_id:X8}): {maintenanceStatus}"); } /// diff --git a/appveyor.yml b/appveyor.yml index 2fcccab963..2f7cdee683 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.63.{build} +version: 1.64.{build} pull_requests: do_not_increment_build_number: true skip_tags: true