-
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.
- Loading branch information
Showing
7 changed files
with
130 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
23 changes: 23 additions & 0 deletions
23
Arrowgene.Ddon.GameServer/Handler/InstanceEnemyKillHandler.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,23 @@ | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Server.Network; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class InstanceEnemyKillHandler : StructurePacketHandler<GameClient, C2SInstanceEnemyKillReq> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(InstanceEnemyKillHandler)); | ||
|
||
|
||
public InstanceEnemyKillHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override void Handle(GameClient client, StructurePacket<C2SInstanceEnemyKillReq> packet) | ||
{ | ||
client.Send(new S2CInstanceEnemyKillRes()); | ||
} | ||
} | ||
} |
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
65 changes: 65 additions & 0 deletions
65
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SInstanceEnemyKillReq.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,65 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class C2SInstanceEnemyKillReq : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.C2S_INSTANCE_ENEMY_KILL_REQ; | ||
|
||
public C2SInstanceEnemyKillReq() | ||
{ | ||
LayoutId=new CStageLayoutID(); | ||
SetId=0; | ||
InnerId=0; | ||
DropPosX=0; | ||
DropPosY=0; | ||
DropPosZ=0; | ||
IsNoBattleReword=false; | ||
Unk0=false; | ||
RegionFlag=0; | ||
} | ||
|
||
public CStageLayoutID LayoutId { get; set; } | ||
public uint SetId { get; set; } | ||
public uint InnerId { get; set; } | ||
public double DropPosX { get; set; } | ||
public float DropPosY { get; set; } | ||
public double DropPosZ { get; set; } | ||
public bool IsNoBattleReword { get; set; } | ||
public bool Unk0 { get; set; } // It's possible that IsNoBattleReword is this data instead | ||
public uint RegionFlag { get; set; } | ||
|
||
public class Serializer : EntitySerializer<C2SInstanceEnemyKillReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SInstanceEnemyKillReq obj) | ||
{ | ||
WriteEntity<CStageLayoutID>(buffer, obj.LayoutId); | ||
WriteUInt32(buffer, obj.SetId); | ||
WriteUInt32(buffer, obj.InnerId); | ||
WriteDouble(buffer, obj.DropPosX); | ||
WriteFloat(buffer, obj.DropPosY); | ||
WriteDouble(buffer, obj.DropPosZ); | ||
WriteBool(buffer, obj.IsNoBattleReword); | ||
WriteBool(buffer, obj.Unk0); | ||
WriteUInt32(buffer, obj.RegionFlag); | ||
} | ||
|
||
public override C2SInstanceEnemyKillReq Read(IBuffer buffer) | ||
{ | ||
C2SInstanceEnemyKillReq obj = new C2SInstanceEnemyKillReq(); | ||
obj.LayoutId = ReadEntity<CStageLayoutID>(buffer); | ||
obj.SetId = ReadUInt32(buffer); | ||
obj.InnerId = ReadUInt32(buffer); | ||
obj.DropPosX = ReadDouble(buffer); | ||
obj.DropPosY = ReadFloat(buffer); | ||
obj.DropPosZ = ReadDouble(buffer); | ||
obj.IsNoBattleReword = ReadBool(buffer); | ||
obj.Unk0 = ReadBool(buffer); | ||
obj.RegionFlag = ReadUInt32(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CInstanceEnemyKillRes.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,36 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class S2CInstanceEnemyKillRes : ServerResponse | ||
{ | ||
public override PacketId Id => PacketId.S2C_INSTANCE_ENEMY_KILL_RES; | ||
|
||
public S2CInstanceEnemyKillRes() | ||
{ | ||
EnemyId = 0; | ||
KillNum = 0; | ||
} | ||
|
||
public uint EnemyId { get; set; } | ||
public uint KillNum { get; set; } | ||
|
||
public class Serializer : EntitySerializer<S2CInstanceEnemyKillRes> | ||
{ | ||
public override void Write(IBuffer buffer, S2CInstanceEnemyKillRes obj) | ||
{ | ||
WriteUInt32(buffer, obj.EnemyId); | ||
WriteUInt32(buffer, obj.KillNum); | ||
} | ||
|
||
public override S2CInstanceEnemyKillRes Read(IBuffer buffer) | ||
{ | ||
S2CInstanceEnemyKillRes obj = new S2CInstanceEnemyKillRes(); | ||
obj.EnemyId = ReadUInt32(buffer); | ||
obj.KillNum = ReadUInt32(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
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