Commit Graph

2 Commits

Author SHA1 Message Date
Jonathan Coates f74c4cc83c
Add config options for a global bandwidth limit
This uses Netty's global traffic shaping handlers to limit the rate at
which packets can be sent and received. If the bandwidth limit is hit,
we'll start dropping packets, which will mean remote servers send
traffic to us at a much slower pace.

This isn't perfect, as there is only a global limit, and not a
per-computer one. As a result, its possible for one computer to use
all/most bandwidth, and thus slow down other computers.

This would be something to improve on in the future. However, I've spent
a lot of time reading the netty source code and docs, and the
implementation for that is significantly more complex, and one I'm not
comfortable working on right now.

For the time being, this satisfies the issues in #33 and hopefully
alleviates server owner's concerns about the http API. Remaining
problems can either be solved by moderation (with help of the
//computercraft track` command) or future updates.

Closes #33
2021-07-28 15:53:22 +01:00
Jonathan Coates 0f6db63020
Remove "*Proxy" classes
- Move registry code into the various *Registry classes.

   I'm not sure this is any more sensible, but things being registered
   in different places kinda irked me.

 - Everything else (i.e. event listeners) goes in a {Client,Common}Hooks
   class right now. It's not ideal, but I don't think we can split it up
   much.
2021-06-05 10:09:28 +01:00