-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from pacampbell/fix_common_crafting_hangs
feat: Add empty handler for craft skill analyze option
- Loading branch information
Showing
6 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Arrowgene.Ddon.GameServer/Handler/CraftSkillAnalyzeHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Linq; | ||
using Arrowgene.Ddon.GameServer.Characters; | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Model; | ||
using Arrowgene.Ddon.Shared.Network; | ||
using Arrowgene.Logging; | ||
using System; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class CraftSkillAnalyzeHandler : GameStructurePacketHandler<C2SCraftSkillAnalyzeReq> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(CraftSkillAnalyzeHandler)); | ||
|
||
|
||
public CraftSkillAnalyzeHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override void Handle(GameClient client, StructurePacket<C2SCraftSkillAnalyzeReq> packet) | ||
{ | ||
S2CCraftSkillAnalyzeRes resp = new S2CCraftSkillAnalyzeRes() | ||
{ | ||
Result = 0 | ||
}; | ||
|
||
client.Send(resp); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SCraftSkillAnalyzeReq.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class C2SCraftSkillAnalyzeReq : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.C2S_CRAFT_CRAFT_SKILL_ANALYZE_REQ; | ||
|
||
public C2SCraftSkillAnalyzeReq() | ||
{ | ||
AssistPawnIds = new List<CDataCommonU32>(); | ||
} | ||
|
||
public byte CraftType { get; set; } | ||
public UInt32 RecipeId { get; set; } | ||
public UInt32 ItemId { get; set; } | ||
public UInt32 PawnId { get; set; } | ||
public List<CDataCommonU32> AssistPawnIds { get; set; } | ||
public UInt32 CreateCount { get; set; } | ||
|
||
public class Serializer : PacketEntitySerializer<C2SCraftSkillAnalyzeReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SCraftSkillAnalyzeReq obj) | ||
{ | ||
WriteByte(buffer, obj.CraftType); | ||
WriteUInt32(buffer, obj.RecipeId); | ||
WriteUInt32(buffer, obj.ItemId); | ||
WriteEntityList<CDataCommonU32>(buffer, obj.AssistPawnIds); | ||
WriteUInt32(buffer, obj.CreateCount); | ||
} | ||
|
||
public override C2SCraftSkillAnalyzeReq Read(IBuffer buffer) | ||
{ | ||
C2SCraftSkillAnalyzeReq obj = new C2SCraftSkillAnalyzeReq(); | ||
obj.CraftType = ReadByte(buffer); | ||
obj.RecipeId = ReadUInt32(buffer); | ||
obj.ItemId = ReadUInt32(buffer); | ||
obj.AssistPawnIds = ReadEntityList<CDataCommonU32>(buffer); | ||
obj.CreateCount = ReadUInt32(buffer); | ||
return obj; | ||
} | ||
} | ||
|
||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CCraftSkillAnalyzeRes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class S2CCraftSkillAnalyzeRes : ServerResponse | ||
{ | ||
public override PacketId Id => PacketId.S2C_CRAFT_CRAFT_SKILL_ANALYZE_RES; | ||
|
||
public S2CCraftSkillAnalyzeRes() | ||
{ | ||
AnalyzeResultList = new List<CDataCraftSkillAnalyzeResult>(); | ||
} | ||
|
||
public Int32 ReqResult { get; set; } // renamed from result due to name conflict | ||
public List<CDataCraftSkillAnalyzeResult> AnalyzeResultList { get; set; } | ||
|
||
public class Serializer : PacketEntitySerializer<S2CCraftSkillAnalyzeRes> | ||
{ | ||
public override void Write(IBuffer buffer, S2CCraftSkillAnalyzeRes obj) | ||
{ | ||
WriteServerResponse(buffer, obj); | ||
WriteInt32(buffer, obj.ReqResult); | ||
WriteEntityList<CDataCraftSkillAnalyzeResult>(buffer, obj.AnalyzeResultList); | ||
} | ||
|
||
public override S2CCraftSkillAnalyzeRes Read(IBuffer buffer) | ||
{ | ||
S2CCraftSkillAnalyzeRes obj = new S2CCraftSkillAnalyzeRes(); | ||
ReadServerResponse(buffer, obj); | ||
obj.ReqResult = ReadInt32(buffer); | ||
obj.AnalyzeResultList = ReadEntityList<CDataCraftSkillAnalyzeResult>(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
Arrowgene.Ddon.Shared/Entity/Structure/CDataCraftSkillAnalyzeResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Model; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.Structure | ||
{ | ||
public class CDataCraftSkillAnalyzeResult | ||
{ | ||
public CDataCraftSkillAnalyzeResult() | ||
{ | ||
} | ||
|
||
public byte SkillType { get; set; } | ||
public byte Rate { get; set; } | ||
public UInt32 Value0 { get; set; } | ||
public UInt32 Value1 { get; set; } | ||
|
||
public class Serializer : EntitySerializer<CDataCraftSkillAnalyzeResult> | ||
{ | ||
public override void Write(IBuffer buffer, CDataCraftSkillAnalyzeResult obj) | ||
{ | ||
WriteByte(buffer, obj.SkillType); | ||
WriteByte(buffer, obj.Rate); | ||
WriteUInt32(buffer, obj.Value0); | ||
WriteUInt32(buffer, obj.Value1); | ||
} | ||
|
||
public override CDataCraftSkillAnalyzeResult Read(IBuffer buffer) | ||
{ | ||
CDataCraftSkillAnalyzeResult obj = new CDataCraftSkillAnalyzeResult(); | ||
obj.SkillType = ReadByte(buffer); | ||
obj.Rate = ReadByte(buffer); | ||
obj.Value0 = ReadUInt32(buffer); | ||
obj.Value1 = ReadUInt32(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |