修正write函数WritePosition

This commit is contained in:
Longfeng Qin 2024-09-21 09:23:14 +08:00
parent c534a0e816
commit 4ca991a7ce
5 changed files with 4 additions and 15 deletions

View File

@ -30,7 +30,7 @@ namespace PSO2SERVER.Models
{
PacketWriter writer = new PacketWriter();
writer.WriteStruct(Header);
writer.Write(Position);
writer.WritePosition(Position);
writer.Seek(2, SeekOrigin.Current); // Padding I guess...
writer.WriteFixedLengthASCII(Name, 0x34);
writer.Write(ThingFlag);

View File

@ -41,7 +41,7 @@ namespace PSO2SERVER.Packets.PSOPackets
writer.WriteAccountHeader((uint)_character.Account.AccountId);
// Spawn position
writer.Write(Position);
writer.WritePosition(Position);
writer.Write((ushort)0); // padding?
writer.WriteFixedLengthASCII("Character", 32);

View File

@ -24,7 +24,7 @@ namespace PSO2SERVER.Packets.PSOPackets
{
PacketWriter writer = new PacketWriter();
writer.WriteStruct(_obj.Header);
writer.Write(_obj.Position);
writer.WritePosition(_obj.Position);
writer.Seek(2, SeekOrigin.Current); // Padding I guess...
writer.WriteFixedLengthASCII(_obj.Name, 0x34);
writer.Write(_obj.ThingFlag);

View File

@ -24,7 +24,7 @@ namespace PSO2SERVER.Packets.PSOPackets
{
PacketWriter writer = new PacketWriter();
writer.WriteStruct(_obj.Header);
writer.Write(_obj.Position);
writer.WritePosition(_obj.Position);
writer.Seek(2, SeekOrigin.Current); // Padding I guess...
writer.WriteFixedLengthASCII(_obj.Name, 0x20);

View File

@ -118,17 +118,6 @@ namespace PSO2SERVER.Packets
}
}
public void Write(PSOLocation s)
{
Write(Helper.FloatToHalfPrecision(s.RotX));
Write(Helper.FloatToHalfPrecision(s.RotY));
Write(Helper.FloatToHalfPrecision(s.RotZ));
Write(Helper.FloatToHalfPrecision(s.RotW));
Write(Helper.FloatToHalfPrecision(s.PosX));
Write(Helper.FloatToHalfPrecision(s.PosY));
Write(Helper.FloatToHalfPrecision(s.PosZ));
}
public void WriteAccountHeader(uint id)
{
Write(id);