mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-21 18:55:17 +00:00
Fix ChangeStage packet deserializer
This commit is contained in:
parent
a89471de54
commit
e75df1bbb4
1 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Shared.Packet.Packets;
|
||||
|
@ -20,6 +21,9 @@ public struct ChangeStagePacket : IPacket {
|
|||
MemoryMarshal.Write(data[(IdSize + StageSize + 1)..(IdSize + StageSize + 2)], ref SubScenarioType);
|
||||
}
|
||||
public void Deserialize(ReadOnlySpan<byte> data) {
|
||||
throw new NotImplementedException("This packet should not be sent by the client.");
|
||||
Stage = Encoding.UTF8.GetString(data[..StageSize]).TrimNullTerm();
|
||||
Id = Encoding.UTF8.GetString(data[StageSize..(IdSize + StageSize)]).TrimNullTerm();
|
||||
Scenario = MemoryMarshal.Read<sbyte>(data[(IdSize + StageSize)..(IdSize + StageSize + 1)]);
|
||||
SubScenarioType = MemoryMarshal.Read<byte>(data[(IdSize + StageSize + 1)..(IdSize + StageSize + 2)]);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue