aqua: stop DDoS'ing yourslef

This commit is contained in:
Ted Blackman 2019-08-16 01:37:20 -07:00
parent f26b71aa06
commit 25e04c2084

View File

@ -61,7 +61,7 @@
=. this =. this
?+ -.q.i.ufs.afs this ?+ -.q.i.ufs.afs this
%restore (handle-restore who.afs) %restore (handle-restore who.afs)
%send (handle-send i.ufs.afs) %send (handle-send who.afs i.ufs.afs)
== ==
$(ufs.afs t.ufs.afs) $(ufs.afs t.ufs.afs)
:: ::
@ -71,13 +71,30 @@
[%event who [//newt/0v1n.2m9vh %born ~]]~ [%event who [//newt/0v1n.2m9vh %born ~]]~
:: ::
++ handle-send ++ handle-send
|= [way=wire %send lan=lane:ames pac=@] |= [sndr=ship way=wire %send lan=lane:ames pac=@]
^+ this ^+ this
=/ hear [//newt/0v1n.2m9vh %hear lan pac] =/ rcvr=ship (lane-to-ship lan)
=? ships =(~ ships) =/ hear-lane (ship-to-lane sndr)
.^((list ship) %gx /(scot %p our)/aqua/(scot %da now)/ships/noun) ::~> %slog.0^leaf/"aqua: {(scow %p sndr)} -> {(scow %p rcvr)}"
%- emit-aqua-events %- emit-aqua-events
%+ turn ships [%event rcvr //newt/0v1n.2m9vh %hear hear-lane pac]~
|= who=ship :: +lane-to-ship: decode a ship from an aqua lane
[%event who hear] ::
++ lane-to-ship
|= =lane:ames
^- ship
::
?- -.lane
%& p.lane
%| `ship``@`p.lane
==
:: +ship-to-lane: encode a lane to look like it came from .ship
::
:: Never shows up as a galaxy, because Vere wouldn't know that either.
::
++ ship-to-lane
|= =ship
^- lane:ames
::
[%| `address:ames``@`ship]
-- --