Commit Graph

754 Commits

Author SHA1 Message Date
Florian Nücke
781670b47c Fix keyboard deserialization. 2022-02-04 09:30:41 +01:00
Florian Nücke
04ee0bc582 Fix not sending frame to client when they start observing a projector that's not changing. 2022-02-03 21:58:26 +01:00
Florian Nücke
c1679223bd Add SPDX header. 2022-02-03 21:42:17 +01:00
Florian Nücke
5e9dd1a4e5 Organize imports. 2022-02-03 21:33:04 +01:00
Florian Nücke
e28370ae1c Make projector emit some light while projecting something. 2022-02-03 21:24:20 +01:00
Florian Nücke
2b368cab05 Don't render projection if there's no way player can see it (too far in front of projector). 2022-02-03 20:22:03 +01:00
Florian Nücke
85363b8835 Add recipe for projector block.
Adjusted a few other recipes.
2022-02-03 19:55:56 +01:00
Florian Nücke
29b1d4eb08 Fix data generator breaking because apparently that's CLIENT side. 2022-02-03 19:37:24 +01:00
Florian Nücke
9af06ea459 Ensure client-side event listeners are only added on client. 2022-02-03 19:27:33 +01:00
Florian Nücke
fe2fdc9391 Make sides and front of projector non "solid" to avoid torch placement and such. 2022-02-03 19:11:44 +01:00
Florian Nücke
0f2c34f287 Don't do stuff with the VM in computers on client side. 2022-02-03 17:32:55 +01:00
Florian Nücke
4c4385f0ec Don't do stuff with the VM in robots on client side. 2022-02-03 17:31:33 +01:00
Florian Nücke
94318dceee Run all sending of framebuffer data through a load balancer, so we have more control over bandwidth use.
Penalize projectors that a) send to multiple clients, b) are far away from players.
2022-02-03 17:31:14 +01:00
Florian Nücke
ced5a0b5b4 Catch buffer overflow exceptions in encode, since apparently these can happen.
Only seen this when flooding with random, which is... esoteric. So silently swallow this to avoid users deliberately spamming server logs.
2022-02-02 02:08:01 +01:00
Florian Nücke
ee232dc049 Disable projection when occluded. 2022-02-02 01:33:16 +01:00
Florian Nücke
05c2f43abd Use frustum matrix for projector depth rendering, to allow flat projection onto surfaces while still offsetting upwards.
Ensure render bounds for projectors always work.
Render weather into projector depth so that rain casts shadows.
2022-02-02 01:06:09 +01:00
Florian Nücke
2361a84b8e Use actual projection rendering for projectors. 2022-02-01 20:18:55 +01:00
Florian Nücke
59a3a2b127 Trying to render level for projector depth. 2022-01-30 15:19:40 +01:00
Florian Nücke
3e2914ba9e Use annotations to register event listeners. 2022-01-30 15:19:40 +01:00
Florian Nücke
539beb4e0f Being reasonable is boring. 2022-01-30 15:19:40 +01:00
Florian Nücke
2f7b044b00 Fixed facing check. 2022-01-30 15:19:39 +01:00
Florian Nücke
c61c9f4b6b Small rename. 2022-01-30 15:19:39 +01:00
Florian Nücke
a1a1f3e887 Render no border without wonky GL settings. 2022-01-30 15:19:39 +01:00
Florian Nücke
8f89d318d4 Projector block. 2022-01-30 15:19:39 +01:00
Florian Nücke
d6a93605a8 Fix devices not being released when computer is destroyed while running. 2022-01-30 15:10:21 +01:00
Florian Nücke
ab69c6977a Fixed disk drives being read-only. Fixes #103. 2022-01-30 14:44:47 +01:00
Florian Nücke
f8899d361e Update Forge and simplify mixin stuff. 2022-01-28 18:33:20 +01:00
Florian Nücke
7be40b02e2 Can be an assert. 2022-01-28 13:26:33 +01:00
Florian Nücke
dc6089d347 Made block entity ticking a little nicer. 2022-01-28 13:26:01 +01:00
Florian Nücke
4793aee54a Update docs. 2022-01-28 10:07:29 +01:00
Florian Nücke
b4dc58edbd Fix computer running sound not stopping when stopped before initial delay expired. 2022-01-28 02:40:24 +01:00
Florian Nücke
a1217ba819 Various cleanup.
Removed pointless VMLifeCycleEvent.
Initialize block devices asynchronously.
2022-01-28 02:28:10 +01:00
Florian Nücke
cbb19eff70 Small rename. 2022-01-28 00:58:59 +01:00
Florian Nücke
b75f5cbca2 Simplify network device run state switching.
Can't remember why all the events were needed before.
Joining worker thread should be enough, since when unmounting one, we unmount all. So there should be no way to read/write from network device after vm devices were unmounted (and memory closed).
2022-01-28 00:56:32 +01:00
Florian Nücke
ae13fca2e9 Rework VMDevice to be more intuitive for typical cases.
unmount() is now called in addition to when suspend() was called before. dispose() is called after unmount() if cleanup is required (machine stopped, device removed).
2022-01-28 00:55:16 +01:00
Florian Nücke
82a6702b33 Rework RPCDevice to be more intuitive for typical cases.
unmount() is now called in addition to when suspend() was called before. dispose() is called after unmount() if cleanup is required (machine stopped, device removed).
2022-01-27 20:10:41 +01:00
Florian Nücke
bd1b46882e Mark chunk lazy dirty when charger charged something, so its stored energy changed. 2022-01-27 11:16:39 +01:00
Florian Nücke
a5cf919f23 Mark chunk dirty when bus interface name changes. 2022-01-27 11:15:58 +01:00
Florian Nücke
28304b1a28 Make some more block entities use custom base class for consistency. 2022-01-27 11:15:38 +01:00
Florian Nücke
1ab2b8ea24 Run firmware check first, as quasi-early exit, before checking vm devices. 2022-01-27 11:15:14 +01:00
Florian Nücke
d9c86cbca5 Add system to mark chunks as "lazy unsaved".
Avoids serialization of chunks with computers in them every single tick.
Since computers state changes every tick they're running, flagging the chunk unsaved every chunk would be necessary. However, this is undesirable, because it triggers an NBT serialization ever tick. Which is slow.
To avoid this, we now track a "lazy unsaved" flag for chunks, which computers can set. This flag is applied to the real unsaved flag during explicit saves, right before the unsaved flag is checked. Explicit saves include chunk unloads, pausing in single-player, server stopping and the save command, for example.
2022-01-27 11:13:22 +01:00
Florian Nücke
9410781c25 [BREAKING] Reworked RPC method API to be more flexible.
RPCDevices now return a list of RPCMethodGroups instead of RPCMethods directly.
RPCMethodGroups can be queried for a method based on an invocation. They can also optionally provide a list of all overloads, for documentation purposes (queried by VM).
Overloads are the old RPCMethods, now taking the same invocation information the lookup method takes.
For convenience, RPCMethods are also singleton RPCMethodGroups.
2022-01-26 03:13:30 +01:00
Florian Nücke
f2d69c1cd2 Add missing forwards in AbstractItemRPCDevice. 2022-01-26 00:18:52 +01:00
Florian Nücke
ba3bc7776c Add never called overrides with exception for clarity. 2022-01-26 00:16:07 +01:00
Florian Nücke
ded98fc652 Fixed synthetic devices being collected from sides that should not collect devices.
No real effect (ignored in method gathering because empty), but still unnecessary clutter.
2022-01-26 00:14:46 +01:00
Florian Nücke
5f892f2341 Fixed no bus scan being triggered when bus cable is placed after bus interface. 2022-01-26 00:13:59 +01:00
Florian Nücke
79ab0f08e0 Fix missing space in documentation. 2022-01-26 00:12:58 +01:00
Florian Nücke
929f13d240 fixup! Add option to clean up stuff (via unmount) when devices go missing. For block devices, this can happen when the block is broken while the computer is unloaded, for example. For items this is more esoteric, but it theoretically means items disappear while the container managing the item as a device is unloaded. 2022-01-25 20:29:17 +01:00
Florian Nücke
dbab733c77 Explicitly use RPCDeviceList type for tracked list devices, for clarity. 2022-01-25 20:28:15 +01:00
Florian Nücke
0c271732cb Add option to clean up stuff (via unmount) when devices go missing.
For block devices, this can happen when the block is broken while the computer is unloaded, for example. For items this is more esoteric, but it theoretically means items disappear while the container managing the item as a device is unloaded.
2022-01-25 19:57:43 +01:00