Closed SquidDev closed 9 years ago
Nodes work fine, though I'm not sure peripheral invalidation works when creating new networks from existing ones (breaking networks).
Please don't kill me for rewriting bits :worried:.
@ElvishJerricco:
What are your thoughts on this. It fixes #49 which is great, but is a rewrite of large parts of the networking code. Should I merge this, change bits or just leave it?
Sorry I've been so uninvolved. Lot of things going on. Don't have much time.
Except for today! =P Took a quick look. This looks like the better system, I think. It seems more performant and overall cleaner. I like it if you like it.
This is an attempt to address some of the issues in #48 and #49. @ElvishJerricco is probably going to kill me. I might not merge this, I'm just going to see if it is any better.
There is lots of work still to be done on this - some of the logic is quite convoluted and most is untested.
What this changes
The core aim of this is to reduce network 'noise' - changing of networks, rescanning of peripherals, etc... Instead this provides an additional
invalidateNode(INetworkNode)
call which is used to only rescan for peripherals one one node. To make this easier, thenetworkInvalidated
signature now takes aoldPeripherals
andnewPeripherals
method, though this may be reverted (as discussed here).Packet sending is now done in a priority queue instead to (hopefully) ensure that the shortest route is always used. Knowing my luck I've got the logic the wrong way round though.
Internally connections are represented as
Point
s, these hold additional data for nodes, and also double asINetworkAccess
- though this may be removed. EachPoint
holds a cache of peripherals for that node as well as a map for what that node connects to.The caching of 'per-node' peripherals means we can just fetch peripherals for one node.
Closes #48, fixes #49 and closes #24