Ashita v3.0.0.8 Released

Find news and updates about the Ashita project posted here.
User avatar
Site Admin
Posts: 457
Joined: Sat May 14, 2016 5:13 pm

Ashita v3.0.0.8 Released

Post by atom0s » Sun Jan 15, 2017 7:24 pm

Hello everyone,

Tonight I have released Ashita v3.0.0.8 which contains some major internal changes to how the packet handlers deal with modified packets and the original packet buffer. This is going to be a breaking change for some addons and plugins in the near future with the next part of this update which will be pushed in the upcoming week. So please, if you are an addon or plugin developer, read this post carefully and be sure you are following the new guidelines of using packets!

Packet Handler Changes

With Ashita v2, developers grew accustomed to how modifying packet data worked as well as blocking packets or resending them manually. With Ashita v3, the ability to view modified data, blocked packets, and such was added to give developers more control of the packet system. With Ashita v3.0.0.8, this has been further enhanced by modifying some of the internal handlings of the data. The plugin callbacks for HandleIncomingPacket and HandleOutgoingPacket are exactly the same, but the parameters data is different to a degree.

The prototypes of these functions are still the same, as follows:

Code: Select all

bool HandleIncomingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked) override
bool HandleOutgoingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked) override
However, the data and modified parameters have changed.

  • Prior to this change, data contained the current packet data being processed and nothing else. Now, with v3.0.0.8 and forward, data is now a pointer to the packet data in the original buffer. What this means is that data can now be used to look behind and look ahead manually at the data within the buffer. This greatly enhances what plugins are able to do as some packets have limits and restrictions on when they can and can't be sent. This change gives developers a way to read other packets in the current chunk to determine if what they plan to do is possible due to other data in the chunk.

    With this change, data is also now considered constant. Meaning that any changes you make to data directly WILL BE UNDONE!
    Any and all changes you wish to make to the buffer should be done within modified now, this is now mandatory and not optional!
  • The modified buffer is now required to be used for any packet changes that developers wish to make to the buffer.
    Changes directly to the data will be ignored and undone after the handler has been processed rendering the change useless.
Developers should take the next few days to update their plugins and addons to conform with these new adjustments to ensure their extensions of the Ashita project continue to work after v3.0.0.9 is released in the upcoming week. (v3.0.0.9 will be enforcing the changes to data once it is live.)

Huge thanks and full credit goes to Lolwutt for these changes!
Lead Ashita Developer

Want to donate to say thanks?