mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-22 03:05:16 +00:00
Add log packet and don't spam
This commit is contained in:
parent
104cb32f4b
commit
860f5c242b
2 changed files with 15 additions and 2 deletions
|
@ -57,7 +57,7 @@ server.PacketHandler = (c, p) => {
|
||||||
}
|
}
|
||||||
case PlayerPacket playerPacket when c.Id == lycel && c.Id != test && piss: {
|
case PlayerPacket playerPacket when c.Id == lycel && c.Id != test && piss: {
|
||||||
playerPacket.Position += Vector3.UnitY * 160;
|
playerPacket.Position += Vector3.UnitY * 160;
|
||||||
playerPacket.Rotation *= Quaternion.CreateFromRotationMatrix(Matrix4x4.CreateRotationX(MathF.PI));
|
playerPacket.Rotation *= Quaternion.CreateFromRotationMatrix(Matrix4x4.CreateRotationX(MathF.PI)) * Quaternion.CreateFromRotationMatrix(Matrix4x4.CreateRotationY(MathF.PI));
|
||||||
server.Broadcast(playerPacket, c);
|
server.Broadcast(playerPacket, c);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,6 @@ server.PacketHandler = (c, p) => {
|
||||||
if (to.Id == lycel) {
|
if (to.Id == lycel) {
|
||||||
sp.Position += Vector3.UnitY * 160;
|
sp.Position += Vector3.UnitY * 160;
|
||||||
sp.Rotation *= Quaternion.CreateFromRotationMatrix(Matrix4x4.CreateRotationX(MathF.PI)) * Quaternion.CreateFromRotationMatrix(Matrix4x4.CreateRotationY(MathF.PI));
|
sp.Rotation *= Quaternion.CreateFromRotationMatrix(Matrix4x4.CreateRotationX(MathF.PI)) * Quaternion.CreateFromRotationMatrix(Matrix4x4.CreateRotationY(MathF.PI));
|
||||||
Console.WriteLine($"piss and not lycel {to.Id}");
|
|
||||||
}
|
}
|
||||||
to.Send(sp, from);
|
to.Send(sp, from);
|
||||||
});
|
});
|
||||||
|
|
14
Shared/Packet/Packets/LogPacket.cs
Normal file
14
Shared/Packet/Packets/LogPacket.cs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Shared.Packet.Packets;
|
||||||
|
|
||||||
|
public struct LogPacket : IPacket {
|
||||||
|
public string Text;
|
||||||
|
public void Serialize(Span<byte> data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Deserialize(Span<byte> data) {
|
||||||
|
Text = Encoding.UTF8.GetString(data[..]).TrimNullTerm();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue