Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update eolib-dotnet to rc3 #378

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EOLib.IO/EOLib.IO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutomaticTypeMapper" Version="1.4.1" />
<PackageReference Include="Moffat.EndlessOnline.SDK" Version="1.0.0-rc2" />
<PackageReference Include="Moffat.EndlessOnline.SDK" Version="1.0.0-rc3" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion EOLib.Localization/EOLib.Localization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutomaticTypeMapper" Version="1.4.1" />
<PackageReference Include="Moffat.EndlessOnline.SDK" Version="1.0.0-rc2" />
<PackageReference Include="Moffat.EndlessOnline.SDK" Version="1.0.0-rc3" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion EOLib/EOLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ItemGroup>
<PackageReference Include="Amadevus.RecordGenerator" Version="0.6.0" />
<PackageReference Include="AutomaticTypeMapper" Version="1.4.1" />
<PackageReference Include="Moffat.EndlessOnline.SDK" Version="1.0.0-rc2" />
<PackageReference Include="Moffat.EndlessOnline.SDK" Version="1.0.0-rc3" />
<PackageReference Include="Optional" Version="4.0.0" />
</ItemGroup>
</Project>
10 changes: 7 additions & 3 deletions EOLib/PacketHandlers/NPC/NPCDeathHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ protected NPCDeathHandler(IPlayerInfoProvider playerInfoProvider,

protected void DeathWorkflow(NpcKilledData killData, int? experience)
{
DeathWorkflowSpell(killData, experience, Option.None<(int, int)>());
DeathWorkflowSpell(killData, experience, Option.None<(int, int?)>());
}

protected void DeathWorkflowSpell(NpcKilledData killData, int? experience, Option<(int SpellId, int CasterTp)> castProperties)
protected void DeathWorkflowSpell(NpcKilledData killData, int? experience, Option<(int SpellId, int? CasterTp)> castProperties)
{
var optionalDamage = killData.Damage.SomeWhen(x => x > 0);
// note: this replicates prior functionality implemented based on EOSERV
Expand All @@ -69,7 +69,11 @@ protected void DeathWorkflowSpell(NpcKilledData killData, int? experience, Optio

castProperties.MatchSome(x =>
{
UpdateCharacterStat(CharacterStat.TP, x.CasterTp);
if (x.CasterTp.HasValue)
{
UpdateCharacterStat(CharacterStat.TP, x.CasterTp.Value);
}

NotifySpellCast(killData.KillerId);
});
}
Expand Down
16 changes: 10 additions & 6 deletions EOLib/PacketHandlers/Trade/TradeOfferUpdateHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using EOLib.Domain.Character;
using EOLib.Domain.Login;
using EOLib.Domain.Trade;
Expand All @@ -23,13 +24,16 @@ protected TradeOfferUpdateHandler(IPlayerInfoProvider playerInfoProvider,
_tradeRepository = tradeRepository;
}

protected void Handle(TradeItemData data)
protected void Handle(List<TradeItemData> data)
{
var player1Id = data.PartnerPlayerId;
var player1Items = data.PartnerItems.Select(x => new InventoryItem(x.Id, x.Amount)).ToList();
if (data.Count != 2)
return;

var player2Id = data.YourPlayerId;
var player2Items = data.YourItems.Select(x => new InventoryItem(x.Id, x.Amount)).ToList();
var player1Id = data[0].PlayerId;
var player1Items = data[0].Items.Select(x => new InventoryItem(x.Id, x.Amount)).ToList();

var player2Id = data[1].PlayerId;
var player2Items = data[1].Items.Select(x => new InventoryItem(x.Id, x.Amount)).ToList();

_tradeRepository.SomeWhen(x => x.PlayerOneOffer.PlayerID == player1Id)
.Match(some: x =>
Expand Down
2 changes: 1 addition & 1 deletion EndlessClient/EndlessClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<PackageReference Include="Amadevus.RecordGenerator" Version="0.6.0" />
<PackageReference Include="EndlessClient.Binaries" Version="1.3.4.2" />
<PackageReference Include="managed-midi" Version="1.9.14" />
<PackageReference Include="Moffat.EndlessOnline.SDK" Version="1.0.0-rc2" />
<PackageReference Include="Moffat.EndlessOnline.SDK" Version="1.0.0-rc3" />
<PackageReference Include="Monogame.Content.Builder.Task" Version="3.8.1.303" />
<PackageReference Include="MonoGame.Extended.Content.Pipeline" Version="3.8.0" />
<PackageReference Include="MonoGame.Extended.Input" Version="3.8.0" />
Expand Down