-
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.
Basic context handling (ENEMIES NOW SPAWN)
- Loading branch information
Showing
9 changed files
with
240 additions
and
10 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
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
53 changes: 53 additions & 0 deletions
53
Arrowgene.Ddon.Shared/Entity/PacketStructure/C2SContextGetSetContextReq.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,53 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class C2SContextGetSetContextReq : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.C2S_CONTEXT_GET_SET_CONTEXT_REQ; | ||
|
||
public C2SContextGetSetContextReq() | ||
{ | ||
ContextId=0; | ||
UniqueId=0; | ||
StageNo=0; | ||
EncountArea=0; | ||
MasterIndex=0; | ||
Unk0=0; | ||
} | ||
|
||
public uint ContextId { get; set; } // "Id" in the client code, renamed to ContextId to avoid collision with PacketId | ||
public ulong UniqueId { get; set; } | ||
public int StageNo { get; set; } | ||
public int EncountArea { get; set; } | ||
public int MasterIndex { get; set; } | ||
public uint Unk0 { get; set; } | ||
|
||
public class Serializer : EntitySerializer<C2SContextGetSetContextReq> | ||
{ | ||
public override void Write(IBuffer buffer, C2SContextGetSetContextReq obj) | ||
{ | ||
WriteUInt32(buffer, obj.ContextId); | ||
WriteUInt64(buffer, obj.UniqueId); | ||
WriteInt32(buffer, obj.StageNo); | ||
WriteInt32(buffer, obj.EncountArea); | ||
WriteInt32(buffer, obj.MasterIndex); | ||
WriteUInt32(buffer, obj.Unk0); | ||
} | ||
|
||
public override C2SContextGetSetContextReq Read(IBuffer buffer) | ||
{ | ||
C2SContextGetSetContextReq obj = new C2SContextGetSetContextReq(); | ||
obj.ContextId = ReadUInt32(buffer); | ||
obj.UniqueId = ReadUInt64(buffer); | ||
obj.StageNo = ReadInt32(buffer); | ||
obj.EncountArea = ReadInt32(buffer); | ||
obj.MasterIndex = ReadInt32(buffer); | ||
obj.Unk0 = ReadUInt32(buffer); | ||
return obj; | ||
} | ||
} | ||
|
||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CContextGetSetContextRes.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 S2CContextGetSetContextRes : ServerResponse | ||
{ | ||
public override PacketId Id => PacketId.S2C_CONTEXT_GET_SET_CONTEXT_RES; | ||
|
||
public class Serializer : EntitySerializer<S2CContextGetSetContextRes> | ||
{ | ||
public override void Write(IBuffer buffer, S2CContextGetSetContextRes obj) | ||
{ | ||
WriteServerResponse(buffer, obj); | ||
} | ||
|
||
public override S2CContextGetSetContextRes Read(IBuffer buffer) | ||
{ | ||
S2CContextGetSetContextRes obj = new S2CContextGetSetContextRes(); | ||
ReadServerResponse(buffer, obj); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CContext_35_14_16_Ntc.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 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 S2CContext_35_14_16_Ntc : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.S2C_CONTEXT_35_14_16_NTC; | ||
|
||
public S2CContext_35_14_16_Ntc() | ||
{ | ||
Unk0 = new List<CData_35_14_16>(); | ||
} | ||
|
||
public List<CData_35_14_16> Unk0 { get; set; } // Probably a list of heartbeats for the different contexts? | ||
|
||
public class Serializer : EntitySerializer<S2CContext_35_14_16_Ntc> | ||
{ | ||
public override void Write(IBuffer buffer, S2CContext_35_14_16_Ntc obj) | ||
{ | ||
WriteEntityList<CData_35_14_16>(buffer, obj.Unk0); | ||
} | ||
|
||
public override S2CContext_35_14_16_Ntc Read(IBuffer buffer) | ||
{ | ||
S2CContext_35_14_16_Ntc obj = new S2CContext_35_14_16_Ntc(); | ||
obj.Unk0 = ReadEntityList<CData_35_14_16>(buffer); | ||
return obj; | ||
} | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
Arrowgene.Ddon.Shared/Entity/PacketStructure/S2CInstanceEnemyRepopNtc.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.Shared.Entity.Structure; | ||
using Arrowgene.Ddon.Shared.Network; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.PacketStructure | ||
{ | ||
public class S2CInstanceEnemyRepopNtc : IPacketStructure | ||
{ | ||
public PacketId Id => PacketId.S2C_INSTANCE_13_40_16_NTC; | ||
|
||
public S2CInstanceEnemyRepopNtc() | ||
{ | ||
LayoutId = new CStageLayoutID(); | ||
EnemyData = new CDataLayoutEnemyData(); | ||
WaitSecond = 0; | ||
} | ||
|
||
public CStageLayoutID LayoutId { get; set; } | ||
public CDataLayoutEnemyData EnemyData { get; set; } | ||
public uint WaitSecond { get; set; } | ||
|
||
public class Serializer : EntitySerializer<S2CInstanceEnemyRepopNtc> | ||
{ | ||
public override void Write(IBuffer buffer, S2CInstanceEnemyRepopNtc obj) | ||
{ | ||
WriteEntity<CStageLayoutID>(buffer, obj.LayoutId); | ||
WriteEntity<CDataLayoutEnemyData>(buffer, obj.EnemyData); | ||
WriteUInt32(buffer, obj.WaitSecond); | ||
} | ||
|
||
public override S2CInstanceEnemyRepopNtc Read(IBuffer buffer) | ||
{ | ||
S2CInstanceEnemyRepopNtc obj = new S2CInstanceEnemyRepopNtc(); | ||
obj.LayoutId = ReadEntity<CStageLayoutID>(buffer); | ||
obj.EnemyData = ReadEntity<CDataLayoutEnemyData>(buffer); | ||
obj.WaitSecond = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Arrowgene.Buffers; | ||
|
||
namespace Arrowgene.Ddon.Shared.Entity.Structure | ||
{ | ||
public class CData_35_14_16 | ||
{ | ||
public CData_35_14_16() | ||
{ | ||
UniqueId=0; | ||
Unk0=0; | ||
} | ||
|
||
public ulong UniqueId { get; set; } | ||
public byte Unk0 { get; set; } | ||
|
||
public class Serializer : EntitySerializer<CData_35_14_16> | ||
{ | ||
public override void Write(IBuffer buffer, CData_35_14_16 obj) | ||
{ | ||
WriteUInt64(buffer, obj.UniqueId); | ||
WriteByte(buffer, obj.Unk0); | ||
} | ||
|
||
public override CData_35_14_16 Read(IBuffer buffer) | ||
{ | ||
CData_35_14_16 obj = new CData_35_14_16(); | ||
obj.UniqueId = ReadUInt64(buffer); | ||
obj.Unk0 = ReadByte(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