-
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.
Merge pull request #10 from alborrajo/feature/warp
Basic Warp support from Portcrystals
- Loading branch information
Showing
16 changed files
with
322 additions
and
64 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
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
42 changes: 42 additions & 0 deletions
42
Arrowgene.Ddon.GameServer/Handler/WarpRegisterFavoriteWarpHandler.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,42 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.GameServer.Dump; | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Server.Network; | ||
using Arrowgene.Ddon.Shared.Entity; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class WarpRegisterFavoriteWarpHandler : PacketHandler<GameClient> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(WarpRegisterFavoriteWarpHandler)); | ||
|
||
public WarpRegisterFavoriteWarpHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override PacketId Id => PacketId.C2S_WARP_REGISTER_FAVORITE_WARP_REQ; | ||
|
||
public override void Handle(GameClient client, Packet packet) | ||
{ | ||
// Read request | ||
C2SWarpRegisterFavoriteWarpReq req = EntitySerializer.Get<C2SWarpRegisterFavoriteWarpReq>().Read(packet.AsBuffer()); | ||
|
||
// Write response | ||
IBuffer resBuffer = new StreamBuffer(); | ||
resBuffer.WriteInt32(0, Endianness.Big); // error | ||
resBuffer.WriteInt32(0, Endianness.Big); // result | ||
|
||
// TODO: Figure out what they do | ||
S2CWarpRegisterFavoriteWarpRes res = new S2CWarpRegisterFavoriteWarpRes(); | ||
res.slotNo = 0; | ||
res.warpPointID = 0; | ||
|
||
EntitySerializer.Get<S2CWarpRegisterFavoriteWarpRes>().Write(resBuffer, res); | ||
Packet resPacket = new Packet(PacketId.S2C_WARP_REGISTER_FAVORITE_WARP_RES, resBuffer.GetAllBytes()); | ||
client.Send(resPacket); | ||
} | ||
} | ||
} |
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,42 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.GameServer.Dump; | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Server.Network; | ||
using Arrowgene.Ddon.Shared.Entity; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class WarpWarpHandler : PacketHandler<GameClient> { | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(WarpGetWarpPointListHandler)); | ||
|
||
|
||
public WarpWarpHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override PacketId Id => PacketId.C2S_WARP_WARP_REQ; | ||
|
||
public override void Handle(GameClient client, Packet packet) | ||
{ | ||
// Read request | ||
C2SWarpReq req = EntitySerializer.Get<C2SWarpReq>().Read(packet.AsBuffer()); | ||
|
||
// Write response | ||
IBuffer resBuffer = new StreamBuffer(); | ||
resBuffer.WriteInt32(0, Endianness.Big); // error | ||
resBuffer.WriteInt32(0, Endianness.Big); // result | ||
|
||
// TODO: Figure out what they do | ||
S2CWarpRes res = new S2CWarpRes(); | ||
res.warpPointID = 0; | ||
res.rim = 0; | ||
|
||
EntitySerializer.Get<S2CWarpRes>().Write(resBuffer, res); | ||
Packet resPacket = new Packet(PacketId.S2C_WARP_WARP_RES, resBuffer.GetAllBytes()); | ||
client.Send(resPacket); | ||
} | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SWarpRegisterFavoriteWarpReq.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,32 @@ | ||
using Arrowgene.Buffers; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class C2SWarpRegisterFavoriteWarpReq | ||
{ | ||
public C2SWarpRegisterFavoriteWarpReq() { | ||
slotNo = 0; | ||
warpPointID = 0; | ||
} | ||
|
||
public uint slotNo; | ||
public uint warpPointID; | ||
} | ||
|
||
public class C2SWarpRegisterFavoriteWarpReqSerializer : EntitySerializer<C2SWarpRegisterFavoriteWarpReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SWarpRegisterFavoriteWarpReq obj) | ||
{ | ||
WriteUInt32(buffer, obj.slotNo); | ||
WriteUInt32(buffer, obj.warpPointID); | ||
} | ||
|
||
public override C2SWarpRegisterFavoriteWarpReq Read(IBuffer buffer) | ||
{ | ||
C2SWarpRegisterFavoriteWarpReq obj = new C2SWarpRegisterFavoriteWarpReq(); | ||
obj.slotNo = ReadUInt32(buffer); | ||
obj.warpPointID = ReadUInt32(buffer); | ||
return obj; | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SWarpReq.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; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class C2SWarpReq { | ||
|
||
public C2SWarpReq() { | ||
currentPointID = 0; | ||
destPointID = 0; | ||
price = 0; | ||
} | ||
|
||
public uint currentPointID; | ||
public uint destPointID; | ||
public uint price; | ||
|
||
} | ||
|
||
public class C2SWarpReqSerializer : EntitySerializer<C2SWarpReq> { | ||
public override void Write(IBuffer buffer, C2SWarpReq obj) | ||
{ | ||
WriteUInt32(buffer, obj.currentPointID); | ||
WriteUInt32(buffer, obj.destPointID); | ||
WriteUInt32(buffer, obj.price); | ||
} | ||
|
||
public override C2SWarpReq Read(IBuffer buffer) | ||
{ | ||
C2SWarpReq obj = new C2SWarpReq(); | ||
obj.currentPointID = ReadUInt32(buffer); | ||
obj.destPointID = ReadUInt32(buffer); | ||
obj.price = 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
Oops, something went wrong.