Skip to content

Commit

Permalink
Add more handler to stay in game
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-heinz committed Jan 13, 2022
1 parent 49942d5 commit e45f0be
Show file tree
Hide file tree
Showing 18 changed files with 291 additions and 9 deletions.
10 changes: 10 additions & 0 deletions Arrowgene.Ddon.GameServer/DdonGameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private void LoadPacketHandler()
AddHandler(new AchievementAchievementGetReceivableRewardListHandler(this));

AddHandler(new AreaGetAreaBaseInfoListHandler(this));
AddHandler(new AreaGetAreaQuestHintListHandler(this));
AddHandler(new AreaGetLeaderAreaReleaseListHandler(this));

AddHandler(new BattleContentInfoListHandler(this));
Expand Down Expand Up @@ -122,10 +123,19 @@ private void LoadPacketHandler()
AddHandler(new PawnGetNoraPawnListHandler(this));
AddHandler(new PawnGetRentedPawnListHandler(this));

AddHandler(new QuestGetAdventureGuideQuestNoticeHandler(this));
AddHandler(new QuestGetAreaBonusListHandler(this));
AddHandler(new QuestGetCycleContentsStateListHandler(this));
AddHandler(new QuestGetLevelBonusListHandler(this));
AddHandler(new QuestGetMainQuestListHandler(this));
AddHandler(new QuestGetPackageQuestListHandler(this));
AddHandler(new QuestGetPartyQuestProgressInfoHandler(this));
AddHandler(new QuestGetPriorityQuestHandler(this));
AddHandler(new QuestGetQuestCompletedListHandler(this));
AddHandler(new QuestGetQuestPartyBonusListHandler(this));
AddHandler(new QuestGetTutorialQuestListHandler(this));
AddHandler(new QuestGetWorldManageQuestListHandler(this));
AddHandler(new QuestQuestProgressHandler(this));

AddHandler(new ServerGameTimeGetBaseinfoHandler(this));
AddHandler(new ServerGetGameSettingHandler(this));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class AreaGetAreaQuestHintListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(AreaGetAreaQuestHintListHandler));


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

public override PacketId Id => PacketId.C2S_AREA_GET_AREA_QUEST_HINT_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_148);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ public ConnectionMoveInServerHandler(DdonGameServer server) : base(server)

public override void Handle(GameClient client, Packet packet)
{
client.Send(InGameDump.Dump_7);
// NTC
client.Send(GameFull.Dump_4);
// client.Send(GameFull.Dump_5);
// client.Send(GameFull.Dump_6);

client.Send(GameFull.Dump_7);


}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public ItemGetStorageItemListHandler(DdonGameServer server) : base(server)
public override void Handle(GameClient client, Packet packet)
{
client.Send(InGameDump.Dump_40);
client.Send(InGameDump.Dump_42);
client.Send(InGameDump.Dump_44);
}
}
}
5 changes: 5 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/LobbyLobbyJoinHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public LobbyLobbyJoinHandler(DdonGameServer server) : base(server)
public override void Handle(GameClient client, Packet packet)
{
client.Send(InGameDump.Dump_13);

// NTC
client.Send(GameFull.Dump_14);
client.Send(InGameDump.Dump_15);
client.Send(InGameDump.Dump_16);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public PartyPartyCreateHandler(DdonGameServer server) : base(server)
public override void Handle(GameClient client, Packet packet)
{
client.Send(InGameDump.Dump_103);
client.Send(InGameDump.Dump_104);
client.Send(InGameDump.Dump_105);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetAdventureGuideQuestNoticeHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetAdventureGuideQuestNoticeHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_GET_ADVENTURE_GUIDE_QUEST_NOTICE_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_162);
}
}
}
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/QuestGetAreaBonusListHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetAreaBonusListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetAreaBonusListHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_GET_AREA_BONUS_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_284);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

namespace Arrowgene.Ddon.GameServer.Handler
{
public class WarpGetFavoriteWarpPointListHandler : PacketHandler<GameClient>
public class QuestGetCycleContentsStateListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(WarpGetFavoriteWarpPointListHandler));
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetCycleContentsStateListHandler));


public WarpGetFavoriteWarpPointListHandler(DdonGameServer server) : base(server)
public QuestGetCycleContentsStateListHandler(DdonGameServer server) : base(server)
{
}

Expand Down
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/QuestGetLevelBonusListHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetLevelBonusListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetLevelBonusListHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_GET_LEVEL_BONUS_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_286);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetPackageQuestListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetPackageQuestListHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_GET_PACKAGE_QUEST_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_159);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetPartyQuestProgressInfoHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetPartyQuestProgressInfoHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_GET_PARTY_QUEST_PROGRESS_INFO_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_142);
}
}
}
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/QuestGetPriorityQuestHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetPriorityQuestHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetPriorityQuestHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_GET_PRIORITY_QUEST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_144);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetQuestPartyBonusListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetQuestPartyBonusListHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_GET_QUEST_PARTY_BONUS_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_164);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetTutorialQuestListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetTutorialQuestListHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_GET_TUTORIAL_QUEST_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_157);
}
}
}
38 changes: 38 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/QuestQuestProgressHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestQuestProgressHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestQuestProgressHandler));


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

public override PacketId Id => PacketId.C2S_QUEST_QUEST_PROGRESS_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameFull.Dump_166);
client.Send(GameFull.Dump_168);
client.Send(GameFull.Dump_170);
client.Send(GameFull.Dump_172);
client.Send(GameFull.Dump_175);
client.Send(GameFull.Dump_177);
client.Send(GameFull.Dump_179);
client.Send(GameFull.Dump_181);
client.Send(GameFull.Dump_185);
client.Send(GameFull.Dump_188);
client.Send(GameFull.Dump_190);
client.Send(GameFull.Dump_294);
client.Send(GameFull.Dump_297);
client.Send(GameFull.Dump_299);
client.Send(GameFull.Dump_524);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

namespace Arrowgene.Ddon.GameServer.Handler
{
public class QuestGetCycleContentsStateListHandler : PacketHandler<GameClient>
public class WarpGetFavoriteWarpPointListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(QuestGetCycleContentsStateListHandler));
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(WarpGetFavoriteWarpPointListHandler));


public QuestGetCycleContentsStateListHandler(DdonGameServer server) : base(server)
public WarpGetFavoriteWarpPointListHandler(DdonGameServer server) : base(server)
{
}

Expand Down
7 changes: 5 additions & 2 deletions Arrowgene.Ddon.Server/Network/PacketFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,16 @@ public byte[] Write(Packet packet)
{
// temporary solution to attach original packet name to custom packet names
PacketId knownPacketId = _packetIdResolver.Get(packet.Id.GroupId, packet.Id.HandlerId, packet.Id.HandlerSubId);
if (knownPacketId != PacketId.UNKNOWN && knownPacketId.Name != packet.Id.Name)
if (knownPacketId != PacketId.UNKNOWN
&& !packet.Id.Name.Contains("->")
&& knownPacketId.Name != packet.Id.Name
)
{
string combinedName = knownPacketId.Name + "->" + packet.Id.Name;
packet.Id = new PacketId(packet.Id.GroupId, packet.Id.HandlerId, packet.Id.HandlerSubId, combinedName);
}
}

if (packet.Id.HandlerSubId == 16)
{
// only increase for _NTC packets
Expand Down

0 comments on commit e45f0be

Please sign in to comment.