Arisstath / roblox-dissector

Roblox UDP Protocol Dissector
MIT License
133 stars 16 forks source link

Refactor: Stop accessing DataModel from the parser's side #6

Closed Gskartwii closed 5 years ago

Gskartwii commented 5 years ago

At the moment, the parser is accessing the DataModel, effectively resulting in parser code firing DataModel events before the peer side gets a chance to react to them.

This becomes a problem when we introduce a server with multiple clients. Ideally, we would like to hook the DataModel events to broadcast changes to all clients. However, currently the parser fires the NewInstance event before the packet is even received by the client handler code, so the network owner of the instance can't be set before broadcasting it, and in the end we don't have a way to skip sending the instance to its owner.

Gskartwii commented 5 years ago

Additionally, this could potentially help us apply multithreading to parsing in the future. Ordering may still be problematic.

Gskartwii commented 5 years ago

This should be more or less resolved now.