Skip to content

Commit 95fe836

Browse files
committed
ye
1 parent 60b9df0 commit 95fe836

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ packet:send(data)
169169
| `packet:on(fn)` | `fn(data, sender, timestamp?)`. Returns a Connection. |
170170
| `packet:once(fn)` | Fires once, then disconnects. |
171171
| `packet:wait()` | Yields until next fire. Returns `data, sender, timestamp?`. |
172+
| `packet:name()` | Returns the packet name. |
173+
| `packet:stats()` | Returns `{ bytesSent, bytesReceived, fires, recvFires, drops }`. Requires stats enabled. |
172174

173175
## Queries
174176

@@ -192,6 +194,10 @@ Request-response built on packets. Returns `nil` on timeout.
192194
| `query:request(data)` | Client | Send to server, yield for response. |
193195
| `query:request(data, player)` | Server | Send to one client. |
194196
| `query:request(data, target)` | Server | Send to multiple. Returns `{ [Player]: response? }`. |
197+
| `query:name()` | Both | Returns the query name. |
198+
| `query:stats()` | Both | Combined stats for request and response channels. |
199+
200+
Each query consumes two packet IDs internally.
195201

196202
## Groups
197203

@@ -375,6 +381,8 @@ Global limit across all packets: `Lync.configure({ globalRateLimit = { maxPerSec
375381
| Option | Default | Description |
376382
|:-------|--------:|:------------|
377383
| `channelMaxSize` | 262,144 | Max buffer bytes per frame (4,096–1,048,576). |
384+
| `validationDepth` | 16 | Max recursion depth for input validation (4–32). |
385+
| `poolSize` | 16 | Buffer pool size (2–128). |
378386
| `bandwidthLimit` | none | `{ softLimit, maxStrikes }`. Per-player bandwidth throttle. |
379387
| `globalRateLimit` | none | `{ maxPerSecond }`. Global per-player rate limit. |
380388
| `stats` | `false` | Enables `packet:stats()` and `Lync.stats.player()`. |
@@ -385,6 +393,7 @@ Global limit across all packets: `Lync.configure({ globalRateLimit = { maxPerSec
385393
|:---------|:------------|
386394
| `Lync.configure(options)` | Set options before start. |
387395
| `Lync.start()` | Initialize transport. Call once after all definitions. |
396+
| `Lync.started` | Read-only boolean. `true` after `start()`. |
388397
| `Lync.flush()` | Force an immediate send. |
389398
| `Lync.flushRate(hz)` | Set flush rate. 1–60. Default 60. |
390399

@@ -398,6 +407,13 @@ Enable with `Lync.configure({ stats = true })`.
398407
| `Lync.stats.player(player)` | `{ bytesSent, bytesReceived }` — server only. |
399408
| `Lync.stats.reset()` | Zeros all counters. |
400409

410+
### Debug
411+
412+
| Function | Description |
413+
|:---------|:------------|
414+
| `Lync.debug.pending()` | Number of in-flight query requests. Useful for detecting leaks. |
415+
| `Lync.debug.registrations()` | Frozen array of `{ name, id, kind, isUnreliable }` for all registered packets and queries. |
416+
401417
## Limits
402418

403419
| Constraint | Limit |

0 commit comments

Comments
 (0)