-
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.
Added the ability to save equipment presets.
- Loading branch information
1 parent
eda86d4
commit 128e728
Showing
15 changed files
with
440 additions
and
1 deletion.
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
21 changes: 21 additions & 0 deletions
21
Arrowgene.Ddon.GameServer/Handler/EquipGetEquipPresetListHandler.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,21 @@ | ||
|
||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class EquipGetEquipPresetListHandler : GameRequestPacketHandler<C2SEquipGetEquipPresetListReq, S2CEquipGetEquipPresetListRes> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(EquipGetEquipPresetListHandler)); | ||
|
||
public EquipGetEquipPresetListHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override S2CEquipGetEquipPresetListRes Handle(GameClient client, C2SEquipGetEquipPresetListReq request) | ||
{ | ||
return new S2CEquipGetEquipPresetListRes(); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Arrowgene.Ddon.GameServer/Handler/EquipUpdateEquipPresetHandler.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,31 @@ | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Model; | ||
using Arrowgene.Logging; | ||
using System.Collections.Generic; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class EquipUpdateEquipPresetHandler : GameRequestPacketHandler<C2SEquipUpdateEquipPresetReq, S2CEquipUpdateEquipPresetRes> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(EquipUpdateEquipPresetHandler)); | ||
|
||
public EquipUpdateEquipPresetHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override S2CEquipUpdateEquipPresetRes Handle(GameClient client, C2SEquipUpdateEquipPresetReq request) | ||
{ | ||
var result = new S2CEquipUpdateEquipPresetRes(); | ||
|
||
result.EquipPreset.PresetName = request.PresetName; | ||
result.EquipPreset.PresetNo = request.PresetNo; | ||
result.EquipPreset.PresetEquipInfoList = client.Character.Equipment.AsCDataPresetEquipInfo(EquipType.Performance); | ||
result.EquipPreset.Job = client.Character.Job; | ||
|
||
return result; | ||
} | ||
} | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
Arrowgene.Ddon.GameServer/Handler/EquipUpdateEquipPresetNameHandler.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,24 @@ | ||
using Arrowgene.Ddon.Server; | ||
using Arrowgene.Ddon.Shared.Entity.PacketStructure; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Model; | ||
using Arrowgene.Logging; | ||
using System.Collections.Generic; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Handler | ||
{ | ||
public class EquipUpdateEquipPresetNameHandler : GameRequestPacketHandler<C2SEquipUpdateEquipPresetNameReq, S2CEquipUpdateEquipPresetNameRes> | ||
{ | ||
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(EquipUpdateEquipPresetNameHandler)); | ||
|
||
public EquipUpdateEquipPresetNameHandler(DdonGameServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override S2CEquipUpdateEquipPresetNameRes Handle(GameClient client, C2SEquipUpdateEquipPresetNameReq request) | ||
{ | ||
return new S2CEquipUpdateEquipPresetNameRes(); | ||
} | ||
} | ||
} | ||
|
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.Shared/Entity/PacketStructure/C2SEquipGetEquipPresetListReq.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.Buffers; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class C2SEquipGetEquipPresetListReq : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.C2S_EQUIP_GET_EQUIP_PRESET_LIST_REQ; | ||
|
||
public class Serializer : PacketEntitySerializer<C2SEquipGetEquipPresetListReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SEquipGetEquipPresetListReq obj) | ||
{ | ||
} | ||
|
||
public override C2SEquipGetEquipPresetListReq Read(IBuffer buffer) | ||
{ | ||
C2SEquipGetEquipPresetListReq obj = new C2SEquipGetEquipPresetListReq(); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SEquipUpdateEquipPresetNameReq.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,34 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class C2SEquipUpdateEquipPresetNameReq : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.C2S_EQUIP_UPDATE_EQUIP_PRESET_NAME_REQ; | ||
|
||
public C2SEquipUpdateEquipPresetNameReq() | ||
{ | ||
} | ||
|
||
public uint PresetNo { get; set; } | ||
public string PresetName { get; set; } | ||
|
||
public class Serializer : PacketEntitySerializer<C2SEquipUpdateEquipPresetNameReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SEquipUpdateEquipPresetNameReq obj) | ||
{ | ||
WriteUInt32(buffer, obj.PresetNo); | ||
WriteMtString(buffer, obj.PresetName); | ||
} | ||
|
||
public override C2SEquipUpdateEquipPresetNameReq Read(IBuffer buffer) | ||
{ | ||
C2SEquipUpdateEquipPresetNameReq obj = new C2SEquipUpdateEquipPresetNameReq(); | ||
obj.PresetNo = ReadUInt32(buffer); | ||
obj.PresetName = ReadMtString(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SEquipUpdateEquipPresetReq.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,41 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class C2SEquipUpdateEquipPresetReq : IPacketStructure | ||
{ | ||
public C2SEquipUpdateEquipPresetReq() | ||
{ | ||
PresetName = string.Empty; | ||
} | ||
|
||
public PacketId Id => PacketId.C2S_EQUIP_UPDATE_EQUIP_PRESET_REQ; | ||
|
||
public uint PresetNo { get; set; } | ||
public uint PawnId { get; set; } | ||
public uint Type { get; set; } | ||
public string PresetName { get; set; } | ||
|
||
public class Serializer : PacketEntitySerializer<C2SEquipUpdateEquipPresetReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SEquipUpdateEquipPresetReq obj) | ||
{ | ||
WriteUInt32(buffer, obj.PresetNo); | ||
WriteUInt32(buffer, obj.PawnId); | ||
WriteUInt32(buffer, obj.Type); | ||
WriteMtString(buffer, obj.PresetName); | ||
} | ||
|
||
public override C2SEquipUpdateEquipPresetReq Read(IBuffer buffer) | ||
{ | ||
C2SEquipUpdateEquipPresetReq obj = new C2SEquipUpdateEquipPresetReq(); | ||
obj.PresetNo = ReadUInt32(buffer); | ||
obj.PawnId = ReadUInt32(buffer); | ||
obj.Type = ReadUInt32(buffer); | ||
obj.PresetName = ReadMtString(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CEquipGetEquipPresetListRes.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 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 S2CEquipGetEquipPresetListRes : ServerResponse | ||
{ | ||
public override PacketId Id => PacketId.S2C_EQUIP_GET_EQUIP_PRESET_LIST_RES; | ||
|
||
public S2CEquipGetEquipPresetListRes() | ||
{ | ||
EquipPresetList = new List<CDataEquipPreset>(); | ||
} | ||
|
||
public List<CDataEquipPreset> EquipPresetList; | ||
|
||
public class Serializer : PacketEntitySerializer<S2CEquipGetEquipPresetListRes> | ||
{ | ||
public override void Write(IBuffer buffer, S2CEquipGetEquipPresetListRes obj) | ||
{ | ||
WriteServerResponse(buffer, obj); | ||
WriteEntityList(buffer, obj.EquipPresetList); | ||
} | ||
|
||
public override S2CEquipGetEquipPresetListRes Read(IBuffer buffer) | ||
{ | ||
S2CEquipGetEquipPresetListRes obj = new S2CEquipGetEquipPresetListRes(); | ||
ReadServerResponse(buffer, obj); | ||
obj.EquipPresetList = ReadEntityList<CDataEquipPreset>(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CEquipUpdateEquipPresetNameRes.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 Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class S2CEquipUpdateEquipPresetNameRes : ServerResponse | ||
{ | ||
public override PacketId Id => PacketId.S2C_EQUIP_UPDATE_EQUIP_PRESET_NAME_RES; | ||
|
||
public S2CEquipUpdateEquipPresetNameRes() | ||
{ | ||
} | ||
|
||
public class Serializer : PacketEntitySerializer<S2CEquipUpdateEquipPresetNameRes> | ||
{ | ||
public override void Write(IBuffer buffer, S2CEquipUpdateEquipPresetNameRes obj) | ||
{ | ||
WriteServerResponse(buffer, obj); | ||
} | ||
|
||
public override S2CEquipUpdateEquipPresetNameRes Read(IBuffer buffer) | ||
{ | ||
S2CEquipUpdateEquipPresetNameRes obj = new S2CEquipUpdateEquipPresetNameRes(); | ||
ReadServerResponse(buffer, obj); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CEquipUpdateEquipPresetRes.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 Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class S2CEquipUpdateEquipPresetRes : ServerResponse | ||
{ | ||
public override PacketId Id => PacketId.S2C_EQUIP_UPDATE_EQUIP_PRESET_RES; | ||
|
||
public S2CEquipUpdateEquipPresetRes() | ||
{ | ||
EquipPreset = new CDataEquipPreset(); | ||
} | ||
|
||
public CDataEquipPreset EquipPreset { get; set; } | ||
|
||
public class Serializer : PacketEntitySerializer<S2CEquipUpdateEquipPresetRes> | ||
{ | ||
public override void Write(IBuffer buffer, S2CEquipUpdateEquipPresetRes obj) | ||
{ | ||
WriteServerResponse(buffer, obj); | ||
WriteEntity(buffer, obj.EquipPreset); | ||
} | ||
|
||
public override S2CEquipUpdateEquipPresetRes Read(IBuffer buffer) | ||
{ | ||
S2CEquipUpdateEquipPresetRes obj = new S2CEquipUpdateEquipPresetRes(); | ||
ReadServerResponse(buffer, obj); | ||
obj.EquipPreset = ReadEntity<CDataEquipPreset>(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
Arrowgene.Ddon.Shared/Entity/Structure/CDataEquipPreset.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,46 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Model; | ||
using System.Collections.Generic; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.Structure | ||
{ | ||
public class CDataEquipPreset | ||
{ | ||
public CDataEquipPreset() | ||
{ | ||
PresetName = string.Empty; | ||
PresetEquipInfoList = new List<CDataPresetEquipInfo>(); | ||
PresetJobItemList = new List<CDataEquipJobItem>(); | ||
} | ||
|
||
public uint PresetNo { get; set; } | ||
public string PresetName { get; set; } | ||
public JobId Job { get; set; } | ||
public List<CDataPresetEquipInfo> PresetEquipInfoList { get; set; } | ||
public List<CDataEquipJobItem> PresetJobItemList { get; set; } | ||
|
||
|
||
public class Serializer : EntitySerializer<CDataEquipPreset> | ||
{ | ||
public override void Write(IBuffer buffer, CDataEquipPreset obj) | ||
{ | ||
WriteUInt32(buffer, obj.PresetNo); | ||
WriteMtString(buffer, obj.PresetName); | ||
WriteByte(buffer, (byte) obj.Job); | ||
WriteEntityList(buffer, obj.PresetEquipInfoList); | ||
WriteEntityList(buffer, obj.PresetJobItemList); | ||
} | ||
|
||
public override CDataEquipPreset Read(IBuffer buffer) | ||
{ | ||
CDataEquipPreset obj = new CDataEquipPreset(); | ||
obj.PresetNo = ReadUInt32(buffer); | ||
obj.PresetName = ReadMtString(buffer); | ||
obj.Job = (JobId)ReadByte(buffer); | ||
obj.PresetEquipInfoList = ReadEntityList<CDataPresetEquipInfo>(buffer); | ||
obj.PresetJobItemList = ReadEntityList<CDataEquipJobItem>(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.