-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
420 additions
and
3 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
50 changes: 50 additions & 0 deletions
50
Arrowgene.Ddon.GameServer/Handler/MandragoraBeginCraftHandler.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,50 @@ | ||
using System.Collections.Generic; | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class MandragoraBeginCraftHandler : GameRequestPacketHandler<C2SMandragoraBeginCraftReq, S2CMandragoraBeginCraftRes> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(MandragoraBeginCraftHandler)); | ||
|
||
public MandragoraBeginCraftHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override S2CMandragoraBeginCraftRes Handle(GameClient client, C2SMandragoraBeginCraftReq request) | ||
{ | ||
S2CMandragoraBeginCraftRes res = new S2CMandragoraBeginCraftRes(); | ||
|
||
// TODO: | ||
res.Unk0 = new CDataMyMandragoraBeginCraftResUnk0 | ||
{ | ||
SpeciesIndex = 101, | ||
Unk1 = 0, | ||
MandragoraId = 1, | ||
Unk3 = "Test", | ||
Unk4 = 0, | ||
Unk5 = 0, | ||
Unk6 = 0, | ||
Unk7 = new CDataMyMandragoraBeginCraftResUnk0Unk7 | ||
{ | ||
Unk0 = 0, | ||
Unk1 = 0, | ||
Unk2 = new List<CDataMyMandragoraBeginCraftResUnk0Unk7Unk2> | ||
{ | ||
new CDataMyMandragoraBeginCraftResUnk0Unk7Unk2 | ||
{ | ||
Unk0 = 0, | ||
Unk1 = 0 | ||
} | ||
}, | ||
Unk3 = 0 | ||
} | ||
}; | ||
|
||
return res; | ||
} | ||
} | ||
} |
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
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
57 changes: 57 additions & 0 deletions
57
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SMandragoraBeginCraftReq.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,57 @@ | ||
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 C2SMandragoraBeginCraftReq : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.C2S_MANDRAGORA_BEGIN_CRAFT_REQ; | ||
|
||
/// <summary> | ||
/// Recipe ID as provided via the previous GetCraftRecipeList request | ||
/// </summary> | ||
public uint RecipeId { get; set; } | ||
/// <summary> | ||
/// Mandragora chosen to perform crafting. | ||
/// </summary> | ||
public byte MandragoraId { get; set; } | ||
/// <summary> | ||
/// List of items used to "fertilize" or raise the mandragora. | ||
/// </summary> | ||
public List<CDataMyMandragoraBeginCraftFertilizerItem> CraftFertilizerItemList { get; set; } | ||
/// <summary> | ||
/// Actual craft recipe ingredient items. | ||
/// </summary> | ||
public List<CDataCraftMaterial> CraftMaterialList { get; set; } | ||
|
||
public C2SMandragoraBeginCraftReq() | ||
{ | ||
CraftMaterialList = new List<CDataCraftMaterial>(); | ||
} | ||
|
||
public class Serializer : PacketEntitySerializer<C2SMandragoraBeginCraftReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SMandragoraBeginCraftReq obj) | ||
{ | ||
WriteUInt32(buffer, obj.RecipeId); | ||
WriteByte(buffer, obj.MandragoraId); | ||
WriteEntityList<CDataMyMandragoraBeginCraftFertilizerItem>(buffer, obj.CraftFertilizerItemList); | ||
WriteEntityList<CDataCraftMaterial>(buffer, obj.CraftMaterialList); | ||
} | ||
|
||
public override C2SMandragoraBeginCraftReq Read(IBuffer buffer) | ||
{ | ||
C2SMandragoraBeginCraftReq obj = new C2SMandragoraBeginCraftReq(); | ||
|
||
obj.RecipeId = ReadUInt32(buffer); | ||
obj.MandragoraId = ReadByte(buffer); | ||
obj.CraftFertilizerItemList = ReadEntityList<CDataMyMandragoraBeginCraftFertilizerItem>(buffer); | ||
obj.CraftMaterialList = ReadEntityList<CDataCraftMaterial>(buffer); | ||
|
||
return obj; | ||
} | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CMandragoraBeginCraftRes.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,38 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class S2CMandragoraBeginCraftRes : ServerResponse | ||
{ | ||
public override PacketId Id => PacketId.S2C_MANDRAGORA_BEGIN_CRAFT_RES; | ||
|
||
public CDataMyMandragoraBeginCraftResUnk0 Unk0 { get; set; } | ||
|
||
public S2CMandragoraBeginCraftRes() | ||
{ | ||
} | ||
|
||
public class Serializer : PacketEntitySerializer<S2CMandragoraBeginCraftRes> | ||
{ | ||
public override void Write(IBuffer buffer, S2CMandragoraBeginCraftRes obj) | ||
{ | ||
WriteServerResponse(buffer, obj); | ||
|
||
WriteEntity<CDataMyMandragoraBeginCraftResUnk0>(buffer, obj.Unk0); | ||
} | ||
|
||
public override S2CMandragoraBeginCraftRes Read(IBuffer buffer) | ||
{ | ||
S2CMandragoraBeginCraftRes obj = new S2CMandragoraBeginCraftRes(); | ||
|
||
ReadServerResponse(buffer, obj); | ||
|
||
obj.Unk0 = ReadEntity<CDataMyMandragoraBeginCraftResUnk0>(buffer); | ||
|
||
return obj; | ||
} | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Arrowgene.Ddon.Shared/Entity/Structure/CDataMyMandragoraBeginCraftFertilizerItem.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,34 @@ | ||
using System.Collections.Generic; | ||
using Arrowgene.Buffers; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.Structure | ||
{ | ||
public class CDataMyMandragoraBeginCraftFertilizerItem | ||
{ | ||
/// <summary> | ||
/// ItemUID, taken from the lefthand side of the menu where you choose fertilizer items | ||
/// </summary> | ||
public string ItemUID { get; set; } | ||
/// <summary> | ||
/// Always 1 | ||
/// </summary> | ||
public byte ItemNum { get; set; } | ||
|
||
public class Serializer : EntitySerializer<CDataMyMandragoraBeginCraftFertilizerItem> | ||
{ | ||
public override void Write(IBuffer buffer, CDataMyMandragoraBeginCraftFertilizerItem obj) | ||
{ | ||
WriteMtString(buffer, obj.ItemUID); | ||
WriteByte(buffer, obj.ItemNum); | ||
} | ||
|
||
public override CDataMyMandragoraBeginCraftFertilizerItem Read(IBuffer buffer) | ||
{ | ||
CDataMyMandragoraBeginCraftFertilizerItem obj = new CDataMyMandragoraBeginCraftFertilizerItem(); | ||
obj.ItemUID = ReadMtString(buffer); | ||
obj.ItemNum = ReadByte(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.