You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But why? args.Index is the start of the packet data, not packet type byte. I think it's logical that args.Msg.readBuffer.Skip(args.Index).Take(args.Length) returns packet data. But instead it's packet data plus next packet's length and we have to take args.Length - 1 for some reason.
Also if i need to seek data at the end of the packet i instinctively use args.Msg.readBuffer[args.Index + args.Length - 1], which will return incorrect byte.
Console.WriteLine((PacketTypes.PlayerSpawn, args.Length, 10));
writes(PlayerSpawn, 11, 10)
where 10 is the actual packet size (https://tshock.readme.io/docs/multiplayer-packet-structure#spawn-player-12). Same for other packets.The text was updated successfully, but these errors were encountered: