Skip to content

Commit

Permalink
Merge branch 'ACEmulator:master' into metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
LtRipley36706 authored Oct 30, 2024
2 parents 25ee591 + 703ee5f commit 2ae9a9d
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 88 deletions.
2 changes: 1 addition & 1 deletion AppVeyor/dbversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.282
0.9.283
2 changes: 1 addition & 1 deletion Source/ACE.Adapter/ACE.Adapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Source/ACE.Common/ACE.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<ItemGroup>
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Source/ACE.DatLoader.Tests/ACE.DatLoader.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Source/ACE.DatLoader/ACE.DatLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.17" />
<PackageReference Include="System.Drawing.Common" Version="8.0.8" />
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions Source/ACE.Database.Tests/ACE.Database.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<ItemGroup>
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Source/ACE.Database/ACE.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions Source/ACE.Server.Tests/ACE.Server.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<ItemGroup>
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
138 changes: 72 additions & 66 deletions Source/ACE.Server/Command/Handlers/DeveloperContentCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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<LandblockInstance> dummyList = new List<LandblockInstance> ();
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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
6 changes: 4 additions & 2 deletions Source/ACE.Server/Managers/HouseManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,18 @@ private static void HandleRentPaid(PlayerHouse playerHouse)

player.SaveBiotaToDatabase();

var clearedInventoryStatus = "";
if (playerHouse.House.HouseStatus == HouseStatus.Active)
{
// clear out slumlord inventory
var slumlord = playerHouse.House.SlumLord;
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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions Source/ACE.Server/Network/Structure/HouseData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public void SetRentItems(List<WorldObject> rentItems)
/// </summary>
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)
Expand Down
6 changes: 6 additions & 0 deletions Source/ACE.Server/Network/Structure/HouseProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public void SetRentItems(List<WorldObject> rentItems)
/// </summary>
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)
Expand Down
14 changes: 7 additions & 7 deletions Source/ACE.Server/ServerBuildInfo_Dynamic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

2 changes: 2 additions & 0 deletions Source/ACE.Server/WorldObjects/House.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit 2ae9a9d

Please sign in to comment.