]> git.lizzy.rs Git - hydra-dragonfire.git/blob - doc/hydra.md
fd916e07fbd481c6ca3067cfbc687b0a5785105c
[hydra-dragonfire.git] / doc / hydra.md
1 # Hydra namespace
2 Source code: [hydra.go](../hydra.go)
3
4 The `hydra` table contains functions necessary to handle connections.
5
6 ## Constants
7
8 - `hydra.BS`: (`= 10.0`) Size of node in floating-point units. Many floating point positions contained in packets received need to be divided by this constant to obtain a position in node space. Likewise, many positions contained in packets sent need to be multiplied by this constant.
9 - `hydra.serialize_ver`: Supported serialization version.
10 - `hydra.proto_ver`: Supported protocol version.
11
12 ## Functions
13
14 - `hydra.client(address)`: Returns a new client. Address must be a string. For client functions, see [client.md](client.md).
15 - `hydra.dtime()`: Utility function that turns the elapsed time in seconds (floating point) since it was last called (or since program start).
16 - `hydra.poll(clients, [timeout])`: Polls events from all clients in `clients` (table). For behavior and return value, see [poll.md](poll.md).
17 - `hydra.close(clients)`: Closes all clients in `clients` (table) that are currently connected. See `client:close()` in [client.md](client.md) for more info.