From 50cc3a2d45ca749c622bb7e68c38541520179da1 Mon Sep 17 00:00:00 2001 From: Lucca Faria Ferri Date: Sun, 12 Feb 2023 19:52:20 -0800 Subject: [PATCH] Update Currency removed useless bloodshard query, and some cleanup. --- .../BGS-Server/ChannelSystem/Member.cs | 31 ++++++++++--------- src/DiIiS-NA/Core/Versions/VersionInfo.cs | 16 +++++----- .../Implementations/HiddenVendor.cs | 2 +- .../GSSystem/ActorSystem/InteractiveNPC.cs | 4 +-- .../GSSystem/ActorSystem/Spawner.cs | 2 +- .../GeneratorsSystem/WorldGenerator.cs | 6 ++-- .../GSSystem/PlayerSystem/Player.cs | 2 +- .../Implementations/HeroSkills/Necromancer.cs | 2 +- 8 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/DiIiS-NA/BGS-Server/ChannelSystem/Member.cs b/src/DiIiS-NA/BGS-Server/ChannelSystem/Member.cs index 60e42d7..0d51fd2 100644 --- a/src/DiIiS-NA/BGS-Server/ChannelSystem/Member.cs +++ b/src/DiIiS-NA/BGS-Server/ChannelSystem/Member.cs @@ -54,29 +54,30 @@ namespace DiIiS_NA.LoginServer.ChannelSystem { var rank = this.Channel.Guild.GetRank(this.Identity.GameAccountId.Low); var note = this.Channel.Guild.GetMemberNote(this.Identity.GameAccountId.Low); - builder.AddAttribute(bgs.protocol.Attribute.CreateBuilder().SetName("D3.GuildMember.Rank").SetValue(bgs.protocol.Variant.CreateBuilder().SetIntValue(rank))); - builder.AddAttribute(bgs.protocol.Attribute.CreateBuilder().SetName("D3.GuildMember.Note").SetValue(bgs.protocol.Variant.CreateBuilder().SetStringValue(note))); - builder.AddAttribute(bgs.protocol.Attribute.CreateBuilder().SetName("D3.GuildMember.AchievementPoints").SetValue(bgs.protocol.Variant.CreateBuilder().SetUintValue(this.GameAccount.AchievementPoints))); + builder.AddAttribute(bgs.protocol.Attribute.CreateBuilder().SetName("D3.GuildMember.Rank") + .SetValue(bgs.protocol.Variant.CreateBuilder().SetIntValue(rank))); + builder.AddAttribute(bgs.protocol.Attribute.CreateBuilder().SetName("D3.GuildMember.Note") + .SetValue(bgs.protocol.Variant.CreateBuilder().SetStringValue(note))); + builder.AddAttribute(bgs.protocol.Attribute.CreateBuilder() + .SetName("D3.GuildMember.AchievementPoints").SetValue(bgs.protocol.Variant.CreateBuilder() + .SetUintValue(this.GameAccount.AchievementPoints))); } else { - if (this.Privileges != Privilege.None) - builder.SetPrivileges((ulong)this.Privileges); // We don't have to set this if it is the default (0) + if (this.Privileges != Privilege.None) + builder.SetPrivileges( + (ulong)this.Privileges); // We don't have to set this if it is the default (0) } + return builder.Build(); } } - public bgs.protocol.channel.v1.Member BnetMember - { - get - { - return bgs.protocol.channel.v1.Member.CreateBuilder() - .SetIdentity(this.Identity) - .SetState(this.BnetMemberState) - .Build(); - } - } + public bgs.protocol.channel.v1.Member BnetMember => + bgs.protocol.channel.v1.Member.CreateBuilder() + .SetIdentity(this.Identity) + .SetState(this.BnetMemberState) + .Build(); public Member(Channel channel, GameAccount account, Privilege privs, params Role[] roles) { diff --git a/src/DiIiS-NA/Core/Versions/VersionInfo.cs b/src/DiIiS-NA/Core/Versions/VersionInfo.cs index 0435b37..7be1a95 100644 --- a/src/DiIiS-NA/Core/Versions/VersionInfo.cs +++ b/src/DiIiS-NA/Core/Versions/VersionInfo.cs @@ -27,7 +27,7 @@ namespace DiIiS_NA.Core.Versions /// public const int RequiredClientVersion = 22044; - public static Dictionary ClientVersionMaps = new Dictionary + public static Dictionary ClientVersionMaps = new() { {"Aurora 2e79d6e023_public", 22044}, {"Aurora 1a3c949c86_public", 16603}, @@ -56,37 +56,37 @@ namespace DiIiS_NA.Core.Versions /// Auth modules' hash maps for client platforms. /// //TODO: Get Hashes for Mac client. - public static Dictionary PasswordHashMap = new Dictionary() + public static Dictionary PasswordHashMap = new() { { BattleClient.ClientPlatform.Win,"8f52906a2c85b416a595702251570f96d3522f39237603115f2f1ab24962043c".ToByteArray() }, { BattleClient.ClientPlatform.Mac,"63BC118937E6EA2FAA7B7192676DAEB1B7CA87A9C24ED9F5ACD60E630B4DD7A4".ToByteArray() } }; - public static Dictionary SSOHashMap = new Dictionary() + public static Dictionary SSOHashMap = new() { { BattleClient.ClientPlatform.Win,"8e86fbdd1ee515315e9e3e1b479b7889de1eceda0703d9876f9441ce4d934576".ToByteArray() }, { BattleClient.ClientPlatform.Mac,"8e86fbdd1ee515315e9e3e1b479b7889de1eceda0703d9876f9441ce4d934576".ToByteArray() } }; - public static Dictionary ThumbprintHashMap = new Dictionary() + public static Dictionary ThumbprintHashMap = new() { { BattleClient.ClientPlatform.Win,"36b27cd911b33c61730a8b82c8b2495fd16e8024fc3b2dde08861c77a852941c".ToByteArray() }, { BattleClient.ClientPlatform.Mac,"36b27cd911b33c61730a8b82c8b2495fd16e8024fc3b2dde08861c77a852941c".ToByteArray() }, }; - public static Dictionary TokenHashMap = new Dictionary() + public static Dictionary TokenHashMap = new() { { BattleClient.ClientPlatform.Win,"bfa574bcff509b3c92f7c4b25b2dc2d1decb962209f8c9c8582ddf4f26aac176".ToByteArray() }, { BattleClient.ClientPlatform.Mac,"bfa574bcff509b3c92f7c4b25b2dc2d1decb962209f8c9c8582ddf4f26aac176".ToByteArray() }, }; - public static Dictionary RiskFingerprintHashMap = new Dictionary() + public static Dictionary RiskFingerprintHashMap = new() { { BattleClient.ClientPlatform.Win,"5e298e530698af905e1247e51ef0b109b352ac310ce7802a1f63613db980ed17".ToByteArray() }, { BattleClient.ClientPlatform.Mac,"bcfa324ab555fc66614976011d018d2be2b9dc23d0b54d94a3bd7d12472aa107".ToByteArray() }, }; - public static Dictionary AgreementHashMap = new Dictionary() + public static Dictionary AgreementHashMap = new() { { BattleClient.ClientPlatform.Win,"41686a009b345b9cbe622ded9c669373950a2969411012a12f7eaac7ea9826ed".ToByteArray() }, { BattleClient.ClientPlatform.Mac,"41686a009b345b9cbe622ded9c669373950a2969411012a12f7eaac7ea9826ed".ToByteArray() }, @@ -96,7 +96,7 @@ namespace DiIiS_NA.Core.Versions public static byte[] EULA = "00616C75656167726500005553DDD1D77970291A4E8A64BB4FE25B2EA2D69D8915D35D53679AE9FDE5EAE47ECC".ToByteArray(); public static byte[] RMAH = "0068616D72616772650000555398A3FC047004D6D4A0A1519A874AC9B1FC5FBD62C3EAA23188E095D6793537D7".ToByteArray(); - public static Dictionary Regions = new Dictionary() + public static Dictionary Regions = new() { { "US", 0x5553 }, { "XX", 0x5858 }, //Beta Region diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Implementations/HiddenVendor.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Implementations/HiddenVendor.cs index 2fcfcf3..f1078d2 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Implementations/HiddenVendor.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Implementations/HiddenVendor.cs @@ -22,7 +22,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem.Implementations public class HiddenVendor : Vendor { // TODO: extract - private static readonly Dictionary criteria = new Dictionary + private static readonly Dictionary criteria = new() { [ActorSno._a1_genericvendor_tinker] = 74987243309911, [ActorSno._a1_uniquevendor_alchemist] = 74987243309912, diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/InteractiveNPC.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/InteractiveNPC.cs index 4628b52..99167e5 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/InteractiveNPC.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/InteractiveNPC.cs @@ -53,11 +53,11 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem Conversations = new List(); - World.Game.QuestManager.OnQuestProgress += new QuestManager.QuestProgressDelegate(quest_OnQuestProgress); + World.Game.QuestManager.OnQuestProgress += new QuestManager.QuestProgressDelegate(QuestProgress); UpdateConversationList(); // show conversations with no quest dependency } - protected override void quest_OnQuestProgress() // shadows Actors'Mooege.Core.GS.Actors.InteractiveNPC.quest_OnQuestProgress(Mooege.Core.GS.Games.Quest)' + protected override void QuestProgress() // shadows Actors'Mooege.Core.GS.Actors.InteractiveNPC.quest_OnQuestProgress(Mooege.Core.GS.Games.Quest)' { if (this is Hireling && (this as Hireling).IsHireling) return; // call base classe update range stuff diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Spawner.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Spawner.cs index 76fc96e..db30e04 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Spawner.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/ActorSystem/Spawner.cs @@ -45,7 +45,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem /// Rewrite the quest handling event /// /// - protected override void quest_OnQuestProgress() + protected override void QuestProgress() { if (SNO == ActorSno._spawner_zolt_centerpiece) return; //Spawn if this is spawner diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/GeneratorsSystem/WorldGenerator.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/GeneratorsSystem/WorldGenerator.cs index 89019fa..3030f93 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/GeneratorsSystem/WorldGenerator.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/GeneratorsSystem/WorldGenerator.cs @@ -1808,9 +1808,9 @@ namespace DiIiS_NA.GameServer.GSSystem.GeneratorsSystem if (worldTiles.ContainsKey(exit.Value)) continue; worldTiles.Add(exit.Value, null); if (exit.Key == randomizedExitTypes.Last().Key) //continuing passage - counter = AddadjacentTileAtExit(worldTiles, tiles, chunkSize, counter, exit.Value, false); + counter = AdjacentTileAtExit(worldTiles, tiles, chunkSize, counter, exit.Value, false); else - counter = AddadjacentTileAtExit(worldTiles, tiles, chunkSize, counter, exit.Value, true); + counter = AdjacentTileAtExit(worldTiles, tiles, chunkSize, counter, exit.Value, true); } return counter; @@ -1837,7 +1837,7 @@ namespace DiIiS_NA.GameServer.GSSystem.GeneratorsSystem /// /// /// - private int AddadjacentTileAtExit(Dictionary worldTiles, Dictionary tiles, int chunkSize, int counter, Vector3D position, bool lookingForCork) + private int AdjacentTileAtExit(Dictionary worldTiles, Dictionary tiles, int chunkSize, int counter, Vector3D position, bool lookingForCork) { TileTypes tileTypeToFind = TileTypes.Normal; //Find if other exits are in the area of the new tile to add diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs index d5cf05b..7da5bb7 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/PlayerSystem/Player.cs @@ -4494,7 +4494,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable public void LoadCurrencyData() { - var bloodShards = Toon.GameAccount.BloodShards; // TODO: is this needed? @iamdroppy + // var bloodShards = Toon.GameAccount.BloodShards; // Removed by @iamdroppy @ 12/02/2023 Inventory.UpdateCurrencies(); } diff --git a/src/DiIiS-NA/D3-GameServer/GSSystem/PowerSystem/Implementations/HeroSkills/Necromancer.cs b/src/DiIiS-NA/D3-GameServer/GSSystem/PowerSystem/Implementations/HeroSkills/Necromancer.cs index 9308710..fa2aea0 100644 --- a/src/DiIiS-NA/D3-GameServer/GSSystem/PowerSystem/Implementations/HeroSkills/Necromancer.cs +++ b/src/DiIiS-NA/D3-GameServer/GSSystem/PowerSystem/Implementations/HeroSkills/Necromancer.cs @@ -4767,7 +4767,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations } #endregion - // + // TODO: implementation of the power Simalacrum #region Simulacrum [ImplementsPowerSNO(SkillsSystem.Skills.Necromancer.ExtraSkills.Simulacrum)] public class Simulacrum : Skill