Skip to content

Commit 3e79ff0

Browse files
authored
Merge pull request #2055 from NosCoreIO/Cleanup
Cleanup
2 parents 7f500ea + 6a54f7c commit 3e79ff0

File tree

429 files changed

+25760
-6236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

429 files changed

+25760
-6236
lines changed

src/NosCore.Core/NosCore.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.3.0" />
3838
<PackageReference Include="NosCore.Dao" Version="4.0.3" />
3939
<PackageReference Include="NosCore.Networking" Version="7.0.0" />
40-
<PackageReference Include="NosCore.PathFinder" Version="2.0.1" />
40+
<PackageReference Include="NosCore.PathFinder" Version="2.1.0" />
4141
<PackageReference Include="NosCore.Shared" Version="6.0.0" />
4242
<PackageReference Include="Serilog" Version="4.3.0" />
4343
<PackageReference Include="Polly" Version="8.6.5" />

src/NosCore.Data/CommandPackets/CommandPacketHeaderAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
namespace NosCore.Data.CommandPackets
2525
{
26-
public class CommandPacketHeaderAttribute(string identification, AuthorityType authority) : PacketHeaderAttribute(identification, Scope.InGame | Scope.InGame)
26+
public class CommandPacketHeaderAttribute(string identification, AuthorityType authority) : PacketHeaderAttribute(identification, Scope.InGame)
2727
{
2828
public AuthorityType Authority { get; } = authority;
2929
}

src/NosCore.Data/SkillPacket.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
using NosCore.Packets.Attributes;
22
using NosCore.Packets;
3-
using System;
43
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
84
using NosCore.Packets.Enumerations;
95

106
//todo move to NosCore.Packets

src/NosCore.Data/WebApi/WarehouseLink.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class WarehouseLink
2525
{
2626
public WarehouseDto? Warehouse { get; set; }
2727

28+
public short Slot { get; set; }
29+
2830
//todo move this to a generic ItemInstance with a converter
2931
public ItemInstanceDto? ItemInstance { get; set; }
3032
}

src/NosCore.GameObject/Character.cs renamed to src/NosCore.GameObject/ComponentEntities/Entities/Character.cs

Lines changed: 84 additions & 67 deletions
Large diffs are not rendered by default.

src/NosCore.GameObject/Services/MapInstanceGenerationService/MapDesignObject.cs renamed to src/NosCore.GameObject/ComponentEntities/Entities/MapDesignObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
using NosCore.Packets.ServerPackets.Map;
2323
using NosCore.Packets.ServerPackets.Miniland;
2424

25-
namespace NosCore.GameObject.Services.MapInstanceGenerationService
25+
namespace NosCore.GameObject.ComponentEntities.Entities
2626
{
2727
public class MapDesignObject : MinilandObjectDto
2828
{

src/NosCore.GameObject/Services/MapItemGenerationService/MapItem.cs renamed to src/NosCore.GameObject/ComponentEntities/Entities/MapItem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
using System.Reactive.Subjects;
3030
using System.Threading.Tasks;
3131
using NodaTime;
32+
using NosCore.GameObject.Services.MapItemGenerationService;
3233

33-
namespace NosCore.GameObject.Services.MapItemGenerationService
34+
namespace NosCore.GameObject.ComponentEntities.Entities
3435
{
3536
public class MapItem(long visualId) : ICountableEntity, IRequestableEntity<Tuple<MapItem, GetPacket>>
3637
{

src/NosCore.GameObject/MapMonster.cs renamed to src/NosCore.GameObject/ComponentEntities/Entities/MapMonster.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// __ _ __ __ ___ __ ___ ___
1+
// __ _ __ __ ___ __ ___ ___
22
// | \| |/__\ /' _/ / _//__\| _ \ __|
33
// | | ' | \/ |`._`.| \_| \/ | v / _|
44
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
@@ -22,6 +22,7 @@
2222
using NosCore.GameObject.ComponentEntities.Extensions;
2323
using NosCore.GameObject.ComponentEntities.Interfaces;
2424
using NosCore.GameObject.Services.MapInstanceGenerationService;
25+
using NosCore.GameObject.Services.ShopService;
2526
using NosCore.PathFinder.Interfaces;
2627
using NosCore.Shared.Enumerations;
2728
using Serilog;
@@ -33,7 +34,7 @@
3334
using System.Threading;
3435
using System.Collections.Concurrent;
3536

36-
namespace NosCore.GameObject
37+
namespace NosCore.GameObject.ComponentEntities.Entities
3738
{
3839
public class MapMonster(ILogger logger, IHeuristic distanceCalculator, IClock clock,
3940
ISpeedCalculationService speedCalculationService)
@@ -99,20 +100,21 @@ internal void StopLife()
99100

100101
public Task StartLifeAsync()
101102
{
103+
Life?.Dispose();
104+
102105
async Task LifeAsync()
103106
{
104107
try
105108
{
106109
if (!MapInstance.IsSleeping)
107110
{
108-
await MonsterLifeAsync().ConfigureAwait(false);
111+
await MonsterLifeAsync();
109112
}
110113
}
111114
catch (Exception e)
112115
{
113116
logger.Error(e.Message, e);
114117
}
115-
116118
}
117119
Life = Observable.Interval(TimeSpan.FromMilliseconds(400)).Select(_ => LifeAsync()).Subscribe();
118120
return Task.CompletedTask;

src/NosCore.GameObject/MapNpc.cs renamed to src/NosCore.GameObject/ComponentEntities/Entities/MapNpc.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// __ _ __ __ ___ __ ___ ___
1+
// __ _ __ __ ___ __ ___ ___
22
// | \| |/__\ /' _/ / _//__\| _ \ __|
33
// | | ' | \/ |`._`.| \_| \/ | v / _|
44
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
@@ -26,6 +26,7 @@
2626
using NosCore.GameObject.Services.ItemGenerationService;
2727
using NosCore.GameObject.Services.MapInstanceGenerationService;
2828
using NosCore.GameObject.Services.NRunService;
29+
using NosCore.GameObject.Services.ShopService;
2930
using NosCore.PathFinder.Interfaces;
3031
using NosCore.Shared.Enumerations;
3132
using Serilog;
@@ -38,7 +39,7 @@
3839
using NodaTime;
3940
using System.Threading;
4041

41-
namespace NosCore.GameObject
42+
namespace NosCore.GameObject.ComponentEntities.Entities
4243
{
4344
public class MapNpc(IItemGenerationService? itemProvider, ILogger logger, IHeuristic distanceCalculator,
4445
IClock clock)
@@ -133,13 +134,15 @@ internal void StopLife()
133134

134135
public Task StartLifeAsync()
135136
{
137+
Life?.Dispose();
138+
136139
async Task LifeAsync()
137140
{
138141
try
139142
{
140143
if (!MapInstance.IsSleeping)
141144
{
142-
await MonsterLifeAsync().ConfigureAwait(false);
145+
await MonsterLifeAsync();
143146
}
144147
}
145148
catch (Exception e)

src/NosCore.GameObject/Pet.cs renamed to src/NosCore.GameObject/ComponentEntities/Entities/Pet.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
using NosCore.Data.Dto;
2121
using NosCore.Data.StaticEntities;
2222
using NosCore.GameObject.ComponentEntities.Interfaces;
23+
using NosCore.GameObject.Services.GroupService;
2324
using NosCore.GameObject.Services.MapInstanceGenerationService;
25+
using NosCore.GameObject.Services.ShopService;
2426
using NosCore.Shared.Enumerations;
2527
using System;
2628
using System.Collections.Concurrent;
2729
using NodaTime;
2830
using System.Threading;
2931

30-
namespace NosCore.GameObject
32+
namespace NosCore.GameObject.ComponentEntities.Entities
3133
{
3234
public class Pet : MapMonsterDto, INamedEntity //TODO replace MapMonsterDTO by the correct PetDTO
3335
{

0 commit comments

Comments
 (0)