-
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.
Handler for the packet that gets sent when a non party leader throws …
…a barrel
- Loading branch information
Showing
6 changed files
with
129 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
30 changes: 30 additions & 0 deletions
30
Arrowgene.Ddon.GameServer/Handler/ContextMasterThrowHandler.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,30 @@ | ||
using System.Linq; | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Server.Network; | ||
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; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class ContextMasterThrowHandler : GameStructurePacketHandler<C2SContextMasterThrowReq> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(ContextMasterThrowHandler)); | ||
|
||
public ContextMasterThrowHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override void Handle(GameClient client, StructurePacket<C2SContextMasterThrowReq> packet) | ||
{ | ||
client.Send(new S2CContextMasterThrowRes()); | ||
|
||
client.Party.SendToAll(new S2CContextMasterThrowNtc() | ||
{ | ||
Info = packet.Structure.Info | ||
}); | ||
} | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SContextMasterThrowReq.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,35 @@ | ||
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 C2SContextMasterThrowReq : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.C2S_CONTEXT_MASTER_THROW_REQ; | ||
|
||
public C2SContextMasterThrowReq() | ||
{ | ||
Info = new List<CDataMasterInfo>(); | ||
} | ||
|
||
public List<CDataMasterInfo> Info { get; set; } | ||
|
||
public class Serializer : PacketEntitySerializer<C2SContextMasterThrowReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SContextMasterThrowReq obj) | ||
{ | ||
WriteEntityList<CDataMasterInfo>(buffer, obj.Info); | ||
} | ||
|
||
public override C2SContextMasterThrowReq Read(IBuffer buffer) | ||
{ | ||
C2SContextMasterThrowReq obj = new C2SContextMasterThrowReq(); | ||
obj.Info = ReadEntityList<CDataMasterInfo>(buffer); | ||
return obj; | ||
} | ||
} | ||
|
||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CContextMasterThrowNtc.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,35 @@ | ||
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 S2CContextMasterThrowNtc : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.S2C_CONTEXT_MASTER_THROW_NTC; | ||
|
||
public S2CContextMasterThrowNtc() | ||
{ | ||
Info = new List<CDataMasterInfo>(); | ||
} | ||
|
||
public List<CDataMasterInfo> Info { get; set; } | ||
|
||
public class Serializer : PacketEntitySerializer<S2CContextMasterThrowNtc> | ||
{ | ||
public override void Write(IBuffer buffer, S2CContextMasterThrowNtc obj) | ||
{ | ||
WriteEntityList<CDataMasterInfo>(buffer, obj.Info); | ||
} | ||
|
||
public override S2CContextMasterThrowNtc Read(IBuffer buffer) | ||
{ | ||
S2CContextMasterThrowNtc obj = new S2CContextMasterThrowNtc(); | ||
obj.Info = ReadEntityList<CDataMasterInfo>(buffer); | ||
return obj; | ||
} | ||
} | ||
|
||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CContextMasterThrowRes.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,25 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class S2CContextMasterThrowRes : ServerResponse | ||
{ | ||
public override PacketId Id => PacketId.S2C_CONTEXT_MASTER_THROW_RES; | ||
|
||
public class Serializer : PacketEntitySerializer<S2CContextMasterThrowRes> | ||
{ | ||
public override void Write(IBuffer buffer, S2CContextMasterThrowRes obj) | ||
{ | ||
WriteServerResponse(buffer, obj); | ||
} | ||
|
||
public override S2CContextMasterThrowRes Read(IBuffer buffer) | ||
{ | ||
S2CContextMasterThrowRes obj = new S2CContextMasterThrowRes(); | ||
ReadServerResponse(buffer, obj); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |