wiremod / wire-fpga

An addon for Garry's Mod that adds a programmable chip, that can be programmed using flow-based programming.
Apache License 2.0
15 stars 1 forks source link

Better serverside error checking #12

Open llysdal opened 3 years ago

llysdal commented 3 years ago

When a chip is uploaded, it is first validated, compiled, and then executed.

The validation step is to make sure that the player doesn't send some garbage that will just waste servertime, and possibly throw a lua error. It simplifies the other steps greatly that it's known that the data is valid.

Validation right now consists of:

  1. Check that gates exist
  2. Check for out of bounds input/output
  3. Type check between gates
  4. Check that connections are valid (destination exists)
  5. Check if gate is banned

To really make this work well, some sort of automated testing should be made. In general tests could be nice, to quickly verify that no security issues have been added with a feature, but it is a lot of effort to get started.