diff --git a/Campofinale/Game/Factory/BlockCalculator.cs b/Campofinale/Game/Factory/BlockCalculator.cs index a77b7f3..ba4b72b 100644 --- a/Campofinale/Game/Factory/BlockCalculator.cs +++ b/Campofinale/Game/Factory/BlockCalculator.cs @@ -9,7 +9,7 @@ namespace Campofinale.Game.Factory { public class BlockCalculator { - public static float CalculateTotalBlocks(List points) + public static int CalculateTotalBlocks(List points) { if (points == null || points.Count < 2) return 0; @@ -36,7 +36,6 @@ namespace Campofinale.Game.Factory int y1 = (int)Math.Floor(p2.y); int z1 = (int)Math.Floor(p2.z); - // Algoritmo di Bresenham 3D int dx = Math.Abs(x1 - x0); int dy = Math.Abs(y1 - y0); int dz = Math.Abs(z1 - z0); @@ -44,7 +43,6 @@ namespace Campofinale.Game.Factory int sy = y0 < y1 ? 1 : -1; int sz = z0 < z1 ? 1 : -1; - // Decision variables if (dx >= dy && dx >= dz) { int err1 = 2 * dy - dx; @@ -89,7 +87,7 @@ namespace Campofinale.Game.Factory y0 += sy; } } - else // dz รจ la dimensione dominante + else { int err1 = 2 * dy - dz; int err2 = 2 * dx - dz; @@ -112,7 +110,6 @@ namespace Campofinale.Game.Factory } } - // Aggiungi l'ultimo punto blocks.Add(Tuple.Create(x1, y1, z1)); } } diff --git a/Campofinale/Game/Factory/FactoryManager.cs b/Campofinale/Game/Factory/FactoryManager.cs index dbaa245..81f4e51 100644 --- a/Campofinale/Game/Factory/FactoryManager.cs +++ b/Campofinale/Game/Factory/FactoryManager.cs @@ -76,10 +76,9 @@ namespace Campofinale.Game.Factory List nodeUpdateList = new(); foreach (var node in GetChapter(player.GetCurrentChapter()).nodes) { - if (node != null) { - if (node.position.DistanceXZ(player.position) < 150 && node.nodeType != FCNodeType.BoxConveyor) + if (node.position.DistanceXZ(player.position) < 150 && node.nodeBehaviour!=null) { nodeUpdateList.Add(node); } diff --git a/Campofinale/Game/Inventory/Item.cs b/Campofinale/Game/Inventory/Item.cs index a219079..13afaa9 100644 --- a/Campofinale/Game/Inventory/Item.cs +++ b/Campofinale/Game/Inventory/Item.cs @@ -140,14 +140,15 @@ namespace Campofinale.Game.Inventory Inst = new() { InstId = guid, - + Equip = new() { - + EquipCharId = GetOwner().chars.Find(c => c.IsEquipped(guid)) != null ? GetOwner().chars.Find(c => c.IsEquipped(guid)).guid : 0, Equipid = guid, Templateid = ResourceManager.GetItemTemplateId(id), + }, IsLock = locked } @@ -240,6 +241,7 @@ namespace Campofinale.Game.Inventory }; GetOwner().Send(ScMsgId.ScWeaponAddExp, levelUp); + GetOwner().Send(new PacketScSyncWallet(GetOwner())); } } @@ -257,6 +259,10 @@ namespace Campofinale.Game.Inventory return false; case ItemValuableDepotType.MissionItem: return true; + case ItemValuableDepotType.Factory: + return false; + case ItemValuableDepotType.CommercialItem: + return false; default: return false; } diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 86db04e..e85cf9b 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -312,24 +312,6 @@ namespace Campofinale teams.Add(new Team()); teams.Add(new Team()); bitsetManager.Load(new Dictionary>()); - /*mails.Add(new Mail() - { - expireTime=DateTime.UtcNow.AddDays(30).Ticks, - sendTime=DateTime.UtcNow.Ticks, - claimed=false, - guid=random.Next(), - owner=roleId, - isRead=false, - content=new Mail_Content() - { - content= "Welcome to Campofinale, Join our Discord for help: https://discord.gg/5uJGJJEFHa", - senderName="SuikoAkari", - title="Welcome", - templateId="", - } - - });*/ - spaceshipManager.Load(); } @@ -348,8 +330,6 @@ namespace Campofinale } else { - //sceneManager.UnloadCurrent(false); - //sceneManager.LoadCurrent(); sceneLoadState = SceneLoadState.Loading; Send(new PacketScEnterSceneNotify(this, curSceneNumId)); } @@ -370,7 +350,6 @@ namespace Campofinale } public SceneLoadState sceneLoadState=0; - // public bool LoadFinish = true; public void EnterScene(int sceneNumId, Vector3f pos, Vector3f rot, PassThroughData passThroughData = null) { // if (!LoadFinish) return; @@ -573,15 +552,10 @@ namespace Campofinale { } - - - - Disconnect(); } public void Kick(CODE code, string optionalMsg="") { - Send(ScMsgId.ScNtfErrorCode, new ScNtfErrorCode() { Details = optionalMsg, @@ -606,8 +580,6 @@ namespace Campofinale Logger.Print($"{nickname} Disconnected"); socket.Disconnect(false); } - - } public void Save() { diff --git a/Campofinale/Server.cs b/Campofinale/Server.cs index b5ea2ba..e707f8c 100644 --- a/Campofinale/Server.cs +++ b/Campofinale/Server.cs @@ -67,7 +67,7 @@ namespace Campofinale public static Dispatch? dispatch; public static ConfigFile? config; public static List csMessageToHide = new() { CsMsgId.CsMoveObjectMove, CsMsgId.CsBattleOp,CsMsgId.CsPing }; - public static List scMessageToHide = new() { ScMsgId.ScMoveObjectMove, ScMsgId.ScPing,ScMsgId.ScObjectEnterView }; + public static List scMessageToHide = new() { ScMsgId.ScMoveObjectMove, ScMsgId.ScPing,ScMsgId.ScObjectEnterView,ScMsgId.ScFactoryHsSync }; public void Start(ConfigFile config) { {