examples: net_sync's raw buffer inside unsafe, now that a query's body is checked
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
253d8d3632
commit
4919c9c2fc
1 changed files with 16 additions and 14 deletions
|
|
@ -21,6 +21,7 @@ program NetSync {
|
||||||
|
|
||||||
entry {
|
entry {
|
||||||
spawn Player { Position { x: 3, y: 4 }, Health { hp: 50, max: 100 } }
|
spawn Player { Position { x: 3, y: 4 }, Health { hp: 50, max: 100 } }
|
||||||
|
unsafe { # a raw snapshot buffer on purpose: built with --unsafe (L7)
|
||||||
for (Position, Health) in query [Position, Health, {Player}] {
|
for (Position, Health) in query [Position, Health, {Player}] {
|
||||||
let e = self()
|
let e = self()
|
||||||
let buf = bytes(64)
|
let buf = bytes(64)
|
||||||
|
|
@ -37,4 +38,5 @@ program NetSync {
|
||||||
print(Health.max) # 999 — kept (unsynced)
|
print(Health.max) # 999 — kept (unsynced)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue