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

Decode a bunch of MyRoom- and Mandragora-related packets. #521

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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
7 changes: 7 additions & 0 deletions Arrowgene.Ddon.GameServer/DdonGameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ private void LoadPacketHandler()
AddHandler(new MailSystemMailDeleteHandler(this));

AddHandler(new MandragoraGetMyMandragoraHandler(this));
AddHandler(new MandragoraGetSpeciesCategoryListHandler(this));
AddHandler(new MandragoraGetSpeciesListHandler(this));
AddHandler(new MandragoraGetCraftRecipeListHandler(this));
AddHandler(new MandragoraBeginCraftHandler(this));

AddHandler(new MyRoomFurnitureListGetHandler(this));
AddHandler(new MyRoomMyRoomBgmUpdateHandler(this));
Expand All @@ -422,8 +426,11 @@ private void LoadPacketHandler()
AddHandler(new OrbDevoteGetPawnReleaseOrbElementListHandler(this));
AddHandler(new OrbDevoteReleasePawnOrbElementHandler(this));

AddHandler(new PartnerPawnSetHandler(this));
AddHandler(new PartnerPawnPawnLikabilityReleasedRewardListGetHandler(this));
AddHandler(new PartnerPawnPawnLikabilityRewardListGetHandler(this));
AddHandler(new PartnerPawnPawnLikabilityRewardGetHandler(this));

AddHandler(new PartyMemberSetValueHandler(this));
AddHandler(new PartyPartyBreakupHandler(this));
AddHandler(new PartyPartyChangeLeaderHandler(this));
Expand Down
1,281 changes: 1,281 additions & 0 deletions Arrowgene.Ddon.GameServer/Dump/InGameDump.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Arrowgene.Ddon.GameServer/GameStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static void CDataPawnInfo(CDataPawnInfo cDataPawnInfo, Pawn pawn)
cDataPawnInfo.Version = 0;
cDataPawnInfo.Name = pawn.Name;
cDataPawnInfo.EditInfo = pawn.EditInfo;
cDataPawnInfo.State = 0; // TODO: ?
cDataPawnInfo.State = pawn.State;
cDataPawnInfo.MaxHp = pawn.StatusInfo.MaxHP;
cDataPawnInfo.MaxStamina = pawn.StatusInfo.MaxStamina;
cDataPawnInfo.JobId = pawn.Job;
Expand Down Expand Up @@ -159,7 +159,7 @@ public static void CDataPawnInfo(CDataPawnInfo cDataPawnInfo, Pawn pawn)
cDataPawnInfo.ShareRange = 1;
cDataPawnInfo.Likability = 2;
cDataPawnInfo.TrainingStatus = pawn.TrainingStatus.GetValueOrDefault(pawn.Job, new byte[64]);
cDataPawnInfo.Unk1 = new CData_772E80() {Unk0 = 0x7530, Unk1 = 0x3, Unk2 = 0x3, Unk3 = 0x1, Unk4 = 0x3};
cDataPawnInfo.PawnTrainingProfile = new CDataPawnTrainingProfile() {TrainingExp = 1422, DialogCount = 1, DialogCountMax = 3, AttackFrequencyAndDistance = 5, TrainingLv = 5};
cDataPawnInfo.SpSkillList = pawn.SpSkills.GetValueOrDefault(pawn.Job, new List<CDataSpSkill>());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public override void Handle(GameClient client, StructurePacket<C2SCharacterDecid
new CDataCharacterReleaseElement(ContentsRelease.DressEquipment),
new CDataCharacterReleaseElement(ContentsRelease.FeryanaWildernessWorldQuests),
new CDataCharacterReleaseElement(ContentsRelease.LestaniaNews),
// new CDataCharacterReleaseElement(ContentsRelease.MandragoraBreeding),
new CDataCharacterReleaseElement(ContentsRelease.MandragoraBreeding),
new CDataCharacterReleaseElement(ContentsRelease.JobTrainingLog),
new CDataCharacterReleaseElement(ContentsRelease.YourRoomsTerrace),
new CDataCharacterReleaseElement(ContentsRelease.DragonForceAugmentation),
Expand All @@ -80,7 +80,7 @@ public override void Handle(GameClient client, StructurePacket<C2SCharacterDecid
new CDataCharacterReleaseElement(ContentsRelease.ExtremeMission1),
new CDataCharacterReleaseElement(ContentsRelease.ChangeVocations),
new CDataCharacterReleaseElement(ContentsRelease.ExtremeMission2),
// new CDataCharacterReleaseElement(ContentsRelease.CreateandJoinClans),
new CDataCharacterReleaseElement(ContentsRelease.CreateandJoinClans),
new CDataCharacterReleaseElement(ContentsRelease.ExtremeMission3),
new CDataCharacterReleaseElement(ContentsRelease.MainMenu),
new CDataCharacterReleaseElement(ContentsRelease.AppraisalExchangeofDragonArmor),
Expand Down
18 changes: 18 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/CraftGetCraftProductHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Arrowgene.Ddon.Server;
using Arrowgene.Ddon.Shared.Entity.PacketStructure;
using Arrowgene.Ddon.Shared.Entity.Structure;
Expand Down Expand Up @@ -34,6 +35,23 @@ public override C2SCraftGetCraftProductRes Handle(GameClient client, C2SCraftGet

Server.Database.DeletePawnCraftProgress(client.Character.CharacterId, request.CraftMainPawnID);

client.Character.Pawns.First(p => p.PawnId == request.CraftMainPawnID).State = PawnState.None;
Pawn supportPawn1 = client.Character.Pawns.FirstOrDefault(p => p.PawnId == craftProgress.CraftSupportPawnId1, null);
if (supportPawn1 != null)
{
supportPawn1.State = PawnState.None;
}
Pawn supportPawn2 = client.Character.Pawns.FirstOrDefault(p => p.PawnId == craftProgress.CraftSupportPawnId2, null);
if (supportPawn2 != null)
{
supportPawn2.State = PawnState.None;
}
Pawn supportPawn3 = client.Character.Pawns.FirstOrDefault(p => p.PawnId == craftProgress.CraftSupportPawnId3, null);
if (supportPawn3 != null)
{
supportPawn3.State = PawnState.None;
}

return craftGetCraftProductRes;
}
}
Expand Down
4 changes: 4 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/CraftStartCraftHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ public override S2CCraftStartCraftRes Handle(GameClient client, C2SCraftStartCra
}

Server.Database.InsertPawnCraftProgress(craftProgress);
foreach (Pawn pawn in pawns)
{
pawn.State = PawnState.Craft;
}

// Subtract craft price
CDataUpdateWalletPoint updateWalletPoint = Server.WalletManager.RemoveFromWallet(client.Character, WalletType.Gold,
Expand Down
50 changes: 50 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/MandragoraBeginCraftHandler.cs
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;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
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 MandragoraGetCraftRecipeListHandler : GameRequestPacketHandler<C2SMandragoraGetCraftRecipeListReq, S2CMandragoraGetCraftRecipeListRes>
{
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(MandragoraGetCraftRecipeListHandler));

public MandragoraGetCraftRecipeListHandler(DdonGameServer server) : base(server)
{
}

public override S2CMandragoraGetCraftRecipeListRes Handle(GameClient client, C2SMandragoraGetCraftRecipeListReq request)
{
S2CMandragoraGetCraftRecipeListRes res = new S2CMandragoraGetCraftRecipeListRes();


// TODO: what to do with request.Unk0 after choosing "raise"
// TODO: very likely category requested and category answered
res.Unk0 = request.Unk0;
res.MandragoraCraftRecipeList = new List<CDataMyMandragoraCraftRecipe>
{
new CDataMyMandragoraCraftRecipe
{
RecipeId = 123,
ItemId = 17923, // Bonus Dungeon Ticket XP
Time = 64800,
Unk3 = 3000,
Unk4 = new List<CDataMyMandragoraCraftRecipeUnk4>
{
new CDataMyMandragoraCraftRecipeUnk4
{
Unk0 = 1,
Unk1 = 1
}
},
Unk5 = false,
CraftMaterialList = new List<CDataMDataCraftMaterial>
{
new CDataMDataCraftMaterial
{
ItemId = 17881,
Num = 2,
SortNo = 1,
IsSp = false
},
new CDataMDataCraftMaterial
{
ItemId = 7896,
Num = 5,
SortNo = 2,
IsSp = false
}
}
},
new CDataMyMandragoraCraftRecipe
{
RecipeId = 456,
ItemId = 17924, // Bonus Dungeon Ticket RIM
Time = 64800,
Unk3 = 3000,
Unk4 = new List<CDataMyMandragoraCraftRecipeUnk4>
{
new CDataMyMandragoraCraftRecipeUnk4
{
Unk0 = 1,
Unk1 = 1
}
},
Unk5 = true,
CraftMaterialList = new List<CDataMDataCraftMaterial>
{
new CDataMDataCraftMaterial
{
ItemId = 17881,
Num = 1,
SortNo = 1,
IsSp = false
},
new CDataMDataCraftMaterial
{
ItemId = 14190,
Num = 1,
SortNo = 2,
IsSp = false
},
new CDataMDataCraftMaterial
{
ItemId = 7896,
Num = 3,
SortNo = 3,
IsSp = false
}
}
},
new CDataMyMandragoraCraftRecipe
{
RecipeId = 789,
ItemId = 18663, // Mandragora Leaf
Time = 64800,
Unk3 = 3000,
Unk4 = new List<CDataMyMandragoraCraftRecipeUnk4>
{
new CDataMyMandragoraCraftRecipeUnk4
{
Unk0 = 1,
Unk1 = 1
}
},
Unk5 = false,
CraftMaterialList = new List<CDataMDataCraftMaterial>
{
new CDataMDataCraftMaterial
{
ItemId = 7824,
Num = 1,
SortNo = 1,
IsSp = false
},
new CDataMDataCraftMaterial
{
ItemId = 17886,
Num = 1,
SortNo = 2,
IsSp = false
},
new CDataMDataCraftMaterial
{
ItemId = 17884,
Num = 2,
SortNo = 3,
IsSp = false
}
}
},
new CDataMyMandragoraCraftRecipe
{
RecipeId = 101112,
ItemId = 18664, // Mandragora Twig
Time = 64800,
Unk3 = 3000,
Unk4 = new List<CDataMyMandragoraCraftRecipeUnk4>
{
new CDataMyMandragoraCraftRecipeUnk4
{
Unk0 = 1,
Unk1 = 1
}
},
Unk5 = true,
CraftMaterialList = new List<CDataMDataCraftMaterial>
{
new CDataMDataCraftMaterial
{
ItemId = 7824,
Num = 1,
SortNo = 1,
IsSp = false
},
new CDataMDataCraftMaterial
{
ItemId = 17886,
Num = 1,
SortNo = 2,
IsSp = false
},
new CDataMDataCraftMaterial
{
ItemId = 18507,
Num = 2,
SortNo = 3,
IsSp = false
}
}
}
};


return res;
}
}
}
Loading
Loading