Skip to content

Commit

Permalink
Training room request and response structures
Browse files Browse the repository at this point in the history
  • Loading branch information
alborrajo committed Jan 30, 2022
1 parent d96300d commit bf43826
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Arrowgene.Buffers;
using Arrowgene.Ddon.Shared.Network;

namespace Arrowgene.Ddon.Shared.Entity.PacketStructure
{
public class C2STraningRoomGetEnemyListReq : IPacketStructure
{
public PacketId Id => PacketId.C2S_INSTANCE_TRANING_ROOM_GET_ENEMY_LIST_REQ;
public class Serializer : EntitySerializer<C2STraningRoomGetEnemyListReq>
{
public override void Write(IBuffer buffer, C2STraningRoomGetEnemyListReq obj)
{
}

public override C2STraningRoomGetEnemyListReq Read(IBuffer buffer)
{
return new C2STraningRoomGetEnemyListReq();
}
}
}

}
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 C2STraningRoomSetEnemyReq : IPacketStructure
{
public PacketId Id => PacketId.C2S_INSTANCE_TRANING_ROOM_SET_ENEMY_REQ;

public uint ID { get; set; }
public uint Lv { get; set; }

public C2STraningRoomSetEnemyReq()
{
ID = 0;
Lv = 0;
}

public class Serializer : EntitySerializer<C2STraningRoomSetEnemyReq>
{
public override void Write(IBuffer buffer, C2STraningRoomSetEnemyReq obj)
{
WriteUInt32(buffer, obj.ID);
WriteUInt32(buffer, obj.Lv);
}

public override C2STraningRoomSetEnemyReq Read(IBuffer buffer)
{
C2STraningRoomSetEnemyReq obj = new C2STraningRoomSetEnemyReq();
obj.ID = ReadUInt32(buffer);
obj.Lv = ReadUInt32(buffer);
return obj;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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 S2CTraningRoomGetEnemyListRes : ServerResponse
{
public S2CTraningRoomGetEnemyListRes()
{
InfoList = new List<CDataTraningRoomEnemyHeader>();
MaxLv = 100;
}

public override PacketId Id => PacketId.S2C_INSTANCE_TRANING_ROOM_GET_ENEMY_LIST_RES;

public List<CDataTraningRoomEnemyHeader> InfoList { get; set; }
public uint MaxLv { get; set; }

public class Serializer : EntitySerializer<S2CTraningRoomGetEnemyListRes>
{
public override void Write(IBuffer buffer, S2CTraningRoomGetEnemyListRes obj)
{
WriteServerResponse(buffer, obj);
WriteEntityList<CDataTraningRoomEnemyHeader>(buffer, obj.InfoList);
WriteUInt32(buffer, obj.MaxLv);
}

public override S2CTraningRoomGetEnemyListRes Read(IBuffer buffer)
{
S2CTraningRoomGetEnemyListRes obj = new S2CTraningRoomGetEnemyListRes();
ReadServerResponse(buffer, obj);
obj.InfoList = ReadEntityList<CDataTraningRoomEnemyHeader>(buffer);
obj.MaxLv = ReadUInt32(buffer);
return obj;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Arrowgene.Buffers;
using Arrowgene.Ddon.Shared.Network;

namespace Arrowgene.Ddon.Shared.Entity.PacketStructure
{
public class S2CTraningRoomSetEnemyRes : ServerResponse
{
public override PacketId Id => PacketId.S2C_INSTANCE_TRANING_ROOM_SET_ENEMY_RES;

public class Serializer : EntitySerializer<S2CTraningRoomSetEnemyRes>
{
public override void Write(IBuffer buffer, S2CTraningRoomSetEnemyRes obj)
{
WriteServerResponse(buffer, obj);
}

public override S2CTraningRoomSetEnemyRes Read(IBuffer buffer)
{
S2CTraningRoomSetEnemyRes obj = new S2CTraningRoomSetEnemyRes();
ReadServerResponse(buffer, obj);
return obj;
}
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using Arrowgene.Buffers;

namespace Arrowgene.Ddon.Shared.Entity.Structure
{
public class CDataTraningRoomEnemyHeader
{
public CDataTraningRoomEnemyHeader()
{
ID = 0;
StrName = string.Empty;
}

public uint ID { get; set; }
public string StrName { get; set; }

public class Serializer : EntitySerializer<CDataTraningRoomEnemyHeader>
{
public override void Write(IBuffer buffer, CDataTraningRoomEnemyHeader obj)
{
WriteUInt32(buffer, obj.ID);
WriteMtString(buffer, obj.StrName);
}

public override CDataTraningRoomEnemyHeader Read(IBuffer buffer)
{
CDataTraningRoomEnemyHeader obj = new CDataTraningRoomEnemyHeader();
obj.ID = ReadUInt32(buffer);
obj.StrName = ReadMtString(buffer);
return obj;
}
}
}
}

0 comments on commit bf43826

Please sign in to comment.