From 4371a216d1d6954bb8c5f59f73da26e7199ca117 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Wed, 17 Dec 2014 19:01:35 -0500 Subject: [PATCH 1/2] radio->rodeo state conversion --- main/app/rodeo/core.hook | 129 ++++++++++++++++++++++++++++----------- main/app/talk/core.hook | 30 ++++----- 2 files changed, 110 insertions(+), 49 deletions(-) diff --git a/main/app/rodeo/core.hook b/main/app/rodeo/core.hook index 70be3b004..0b338cccc 100644 --- a/main/app/rodeo/core.hook +++ b/main/app/rodeo/core.hook @@ -9,17 +9,28 @@ :: !: => |% :: data structures - ++ house ,[%0 house-0] :: full state + ++ house ,[%1 house-1] :: full state ++ house-any :: app history - $% [%0 house-0] :: 0: initial version + $% [%1 house-1] :: 1: rodeo + [%0 house-0] :: 0: initial version == :: - ++ house-0 :: + ++ house-1 :: $: parties=(map span party) :: conversations general=(set bone) :: meta-subscribe outbox=(pair ,@ud (map ,@ud thought)) :: urbit outbox sent=(map tid:twit serial) :: own tweets folks=(map ship human) :: human identities == :: + ++ house-0 :: legacy state + %+ map path :: + ,[p=(list zong) q=(map ship ,?)] :: + ++ zong :: legacy messages + $% $: %mess p=@da q=ship :: + $= r :: + $% [%do p=@t] :: + [%exp p=@t q=tank :: + [%say p=@t] :: + == == == :: ++ party :: a conversation $: count=@ud :: (lent grams) grams=(list telegram) :: all history @@ -96,11 +107,11 @@ [(flop moves) +>] :: ++ ra-emil :: ra-emit move list - |= mol=(list move) + |= mol=(list move) %_(+> moves (welp (flop mol) moves)) :: ++ ra-emit :: emit a move - |= mov=move + |= mov=move %_(+> moves [mov moves]) :: ++ ra-ever :: emit success @@ -112,7 +123,7 @@ (ra-emit ost %give %mean ~ msg ~) :: ++ ra-hiss :: emit http request - |= [pax=path hiz=hiss] + |= [pax=path hiz=hiss] (ra-emit ost %pass pax %e %them ~ hiz) :: ++ ra-house :: emit stations @@ -144,6 +155,7 @@ ?. (~(has by parties) p.cod) (ra-evil %radio-no-party) =. +>.$ (ra-config p.cod *config) + ra-ever(parties (~(del by parties) p.cod)) =. +>.$ (ra-config p.cod u.q.cod) ra-ever @@ -219,7 +231,7 @@ ?~ oot ~& [%ra-repeat-none num] +>.$ =. q.outbox (~(del by q.outbox) num) =. q.u.oot - %+ ~(put by q.u.oot) + %+ ~(put by q.u.oot) [%& her man] ?+ sih !! [%g %mean *] ~&([%radio-repeat-rejected num her man sih] %rejected) @@ -233,7 +245,7 @@ parties |- ^- (map span party) ?~ parties ~ - :- :- p.n.parties + :- :- p.n.parties %= q.n.parties guests (~(del by guests.q.n.parties) ost) viewers (~(del in viewers.q.n.parties) ost) @@ -251,24 +263,24 @@ ?: ?=([%am @ ~] pax) =+ pur=(~(get by parties) i.t.pax) ?~ pur - ~& [%bad-subscribe-party i.t.pax] + ~& [%bad-subscribe-party-a i.t.pax parties] (ra-evil %radio-no-party) pa-abet:(~(pa-watch pa i.t.pax u.pur) her) ?: ?=([%xm @ ~] pax) =+ pur=(~(get by parties) i.t.pax) ?~ pur - ~& [%bad-subscribe-party i.t.pax] + ~& [%bad-subscribe-party-b i.t.pax] (ra-evil %radio-no-party) pa-abet:(~(pa-master pa i.t.pax u.pur) her) - ?. ?=([%fm *] pax) - ~& [%bad-subscribe pax] + ?. ?=([%fm *] pax) + ~& [%bad-subscribe-a pax] (ra-evil %radio-bad-path) ?. &(?=([@ *] t.pax) ((sane %tas) i.t.pax)) - ~& [%bad-subscribe pax] + ~& [%bad-subscribe-b pax] (ra-evil %radio-bad-path) =+ pur=(~(get by parties) i.t.pax) ?~ pur - ~& [%bad-subscribe-party i.t.pax] + ~& [%bad-subscribe-party-c i.t.pax] (ra-evil %radio-no-party) pa-abet:(~(pa-listen pa i.t.pax u.pur) her t.t.pax) :: @@ -292,7 +304,7 @@ |- ^+ +>.^$ ?~ sul ra-ever =. +>.^$ $(sul t.sul) - ?- -.p.i.sul + ?- -.p.i.sul %| +>.^$ %& ?: =(`ship`p.p.p.i.sul our.hid) (ra-appear her q.p.p.i.sul q.i.sul) @@ -302,7 +314,7 @@ == :: ++ ra-appear :: review presence - |= [her=ship man=span per=presence] + |= [her=ship man=span per=presence] =^ who folks =+ who=(~(get by folks) her) ?^ who [u.who folks] @@ -320,8 +332,8 @@ :* %pass /provoke %g - %mess - [him /rodeo] + %mess + [him /rodeo] our.hid [%radio-command !>(`command`[%ping [[tay per] ~ ~]])] == @@ -367,17 +379,17 @@ ++ ra-transmit :: send to neighbor |= [cuz=cousin tip=thought] ^+ +> - =. +> + =. +> %+ ra-emit ost :* %pass /repeat/(scot %ud p.outbox)/(scot %p p.cuz)/[q.cuz] %g - %mess - [p.cuz /rodeo] + %mess + [p.cuz /rodeo] our.hid [%radio-command !>(`command`[%review tip ~])] == - +>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tip)) + +>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tip)) :: ++ pa :: party core |_ $: man=span @@ -427,7 +439,7 @@ =+ ^= reg :_ remotes |- ^- atlas - ?~ locals ~ + ?~ locals ~ [[p.n.locals q.q.n.locals] $(locals l.locals) $(locals r.locals)] ~& [%pa-display man reg] |- ^+ +>.^$ @@ -450,7 +462,7 @@ ^+ +> ?+ sih ~&([%radio-bad-friend sih] !!) [%g %nice ~] - ~& %pa-friend-nice + ~& %pa-friend-nice +>.$ :: [%g %rust %radio-report *] @@ -466,7 +478,7 @@ ^+ +> ?+ sih ~&([%radio-bad-friend sih] !!) [%g %nice ~] - ~& %pa-stalk-nice + ~& %pa-stalk-nice +>.$ :: [%g %rust %radio-report *] @@ -479,7 +491,7 @@ ++ pa-scrub :: pass forward |= [ost=bone bub=(list (pair path note))] %_ +>.$ - moves + moves (welp (flop (turn bub |=(a=(pair path note) [ost %pass a]))) moves) == :: @@ -591,10 +603,10 @@ |= riv=river ^+ +> =- =. +>.$ (pa-sauce ost [[%rust %radio-report %grams q.lab r.lab] ~]) - ?: p.lab + ?: p.lab (pa-sauce ost [[%mean ~] ~]) +>.$(guests (~(put by guests) ost riv)) - ^= lab + ^= lab =+ [end=count gaz=grams dun=| zeg=*(list telegram)] ~& [%river riv] |- ^- (trel ,? ,@ud (list telegram)) @@ -752,19 +764,68 @@ == :: ++ prep - |= old=(unit (unit house)) + |= old=(unit (unit house-any)) ^- [(list move) _+>] :- [0 %pass /time %t %wait (add ~s10 lat.hid)]~ ?> ?=(^ old) - ?^ u.old - ~& %rodeo-prep-old - +>(+<+ u.u.old) - ~& %rodeo-prep-new - +:ra-abet:(~(ra-apply ra 0 ~) our.hid %design %main `[~ [%| ~]]) + ?~ u.old + ~& %rodeo-prep-new + +:ra-abet:(~(ra-apply ra 0 ~) our.hid %design %main `[~ [%| ~]]) + ~& %rodeo-prep-old + |- + ?- -.u.u.old + %1 %_(+>.^$ +<+ u.u.old) + %0 $(u.u.old [%1 (house-0-to-house-1 +.u.u.old)]) + == :: ++ pull |= ost=bone ^- [(list move) _+>] ~& [%rodeo-pull ost] ra-abet:~(ra-cancel ra ost ~) +:: +++ house-0-to-house-1 + |= vat=house-0 + ^- house-1 + =- :* parties=- + general=~ + outbox=[0 ~] + sent=~ + folks=~ + == + ^- (map span party) + =- %- ~(run by -) + |= grams=(list telegram) + ^- party + :* count=(lent grams) + grams=grams + locals=~ + remotes=~ + sequence=~ + shape=[.(cordon [%| ~])]:*config + ^= known %- mo ^- (list ,[serial @]) =< + + (roll grams |=([telegram a=@ b=(list ,[serial @])] [+(a) [a p.q] b])) + guests=~ + viewers=~ + owners=~ + == + ^- (map span (list telegram)) + %- mo %+ turn (~(tap by vat)) + |= [a=path b=(list zong) c=(map ship ,?)] + =+ ^= par + ?: =(/ a) 'hub' + =+ (turn a |=(d=span leaf/(trip d))) + (crip ~(ram re %rose ["_" ~ ~] -)) + :- par + =+ aud=`audience`[[[%& our.hid par] %received] `~] + =+ ^= spe + |= r=_r:*zong ^- speech + ?- -.r + %say [%say p.r] + %do [%own p.r] + %exp [%exp p.r [~ q.r]] + == + %+ turn b + |= d=zong ^- telegram + [q.d (sham eny.hid d) aud p.d (spe r.d)] -- diff --git a/main/app/talk/core.hook b/main/app/talk/core.hook index 498d87a79..b83810699 100644 --- a/main/app/talk/core.hook +++ b/main/app/talk/core.hook @@ -190,7 +190,7 @@ ?~ live ~& %not-live !! - =- [[(send-rodeo ost [%publish - ~]) ~] +>.^$] + =- [[(send-radio ost [%publish - ~]) ~] +>.^$] =+ aud=destination ?~ aud ~& %no-audience @@ -199,7 +199,7 @@ [(shaf %foo eny.hid) aud [lat.hid p.u.rey]] :: %host - [[(send-rodeo ost [%design p.u.rey ~ `config`[~ [%| ~]]]) ~] +>.^$] + [[(send-radio ost [%design p.u.rey ~ `config`[~ [%| ~]]]) ~] +>.^$] :: %join ?~ live @@ -210,7 +210,7 @@ ~& %not-configured !! =. sources.u.shape.par (~(put in sources.u.shape.par) p.u.rey) - [[(send-rodeo ost [%design u.live `u.shape.par]) ~] +>.^$] + [[(send-radio ost [%design u.live `u.shape.par]) ~] +>.^$] :: %how :_ +>.^$ @@ -235,7 +235,7 @@ :_ ~ :* ost %pass /fm/backlog %g %show - [our.hid /rodeo] our.hid + [our.hid /radio] our.hid /fm/[u.live]/(scot sin)/(scot %da lat.hid) == == @@ -246,7 +246,7 @@ ~& [%pour-attach man] :* :* 0 %pass /fm/[man] %g %show - [our.hid /rodeo] our.hid + [our.hid /radio] our.hid /fm/[man] == (welp (send /out %give %rush %prompt prompt %text '') moz) @@ -259,7 +259,7 @@ :_ moz :* 0 %pass /fm/[man] %g %nuke - [our.hid /rodeo] our.hid + [our.hid /radio] our.hid == :: ++ pour-live @@ -306,12 +306,12 @@ ~& [%new-party man] :~ :* 0 %pass /am/[man] %g %show - [our.hid /rodeo] our.hid + [our.hid /radio] our.hid /am/[man] == :* 0 %pass /xm/[man] %g %show - [our.hid /rodeo] our.hid + [our.hid /radio] our.hid /xm/[man] == == @@ -323,11 +323,11 @@ ~& [%old-party man] :~ :* 0 %pass /am/[man] %g %nuke - [our.hid /rodeo] our.hid + [our.hid /radio] our.hid == :* 0 %pass /xm/[man] %g %nuke - [our.hid /rodeo] our.hid + [our.hid /radio] our.hid == == :: @@ -385,7 +385,7 @@ =+ taz=presentation ?~ taz ~ - [(send-rodeo 0 %ping taz) ~] + [(send-radio 0 %ping taz) ~] :: ++ peer |= [ost=bone you=ship pax=path] @@ -421,7 +421,7 @@ %cmd-ac ?+ +<.sih !! %nice [~ +>.$] - %mean ~&(%cmd-ac-mean +>.$) + %mean ~&(%cmd-ac-mean [~ +>.$]) ?(%rush %rust) ?> ?=(%type -.p.sih) =+ dom=`presence`?:(p.p.sih %talk %hear) @@ -486,7 +486,7 @@ ^- move :* ost %pass /server %g %show - [our.hid /rodeo] our.hid + [our.hid /radio] our.hid / == == @@ -498,11 +498,11 @@ %+ turn (~(tap in (~(get ju pus.hid) pax))) |=(ost=bone [ost msg]) :: -++ send-rodeo +++ send-radio |= [ost=bone cod=command] ^- move :* ost %pass /command - %g %mess [our.hid /rodeo] our.hid + %g %mess [our.hid /radio] our.hid [%radio-command !>(cod)] == -- From ee81f835262010527ef914ba42dfa3326b496784 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Wed, 17 Dec 2014 19:22:15 -0500 Subject: [PATCH 2/2] make disable chat --- main/app/chat/core.hook | 16 +++++++++------- main/app/rodeo/core.hook | 14 +++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/main/app/chat/core.hook b/main/app/chat/core.hook index 02984bf5c..776e18e37 100644 --- a/main/app/chat/core.hook +++ b/main/app/chat/core.hook @@ -59,6 +59,7 @@ $% [%mess p=hapt q=ship r=cage] [%nuke p=hapt q=ship] [%show p=hapt q=ship r=path] + [%cide p=span] == == == ++ sign $? $: %g @@ -328,13 +329,14 @@ ?: ?=(%radi-a i.pax) ~ [ost %give +.sih]~ ?: ?=(%mean +<.sih) - :_ +>.$ :_ ~ - =- ~& [%trying-again -] - - :* ost %pass pax %g %show - [pad.fal /radio] our.hid - ?-(i.pax %radi-a %amigos, %radi-m %mensajes) - sat.fal - == + ~& ':chat is no more, please use :talk' + [[ost %pass / %g %cide %$]~ +>.$] +:: =- ~& [%trying-again -] - +:: :* ost %pass pax %g %show +:: [pad.fal /radio] our.hid +:: ?-(i.pax %radi-a %amigos, %radi-m %mensajes) +:: sat.fal +:: == =+ ya=(grab t.pax) =. ya ?- i.pax diff --git a/main/app/rodeo/core.hook b/main/app/rodeo/core.hook index 0b338cccc..aa3ac3351 100644 --- a/main/app/rodeo/core.hook +++ b/main/app/rodeo/core.hook @@ -28,7 +28,7 @@ $% $: %mess p=@da q=ship :: $= r :: $% [%do p=@t] :: - [%exp p=@t q=tank :: + [%exp p=@t q=tank] :: [%say p=@t] :: == == == :: ++ party :: a conversation @@ -763,6 +763,12 @@ ra-abet:(~(ra-repeat ra ost ~) num her man sih) == :: +++ pull + |= ost=bone + ^- [(list move) _+>] + ~& [%rodeo-pull ost] + ra-abet:~(ra-cancel ra ost ~) +:: ++ prep |= old=(unit (unit house-any)) ^- [(list move) _+>] @@ -778,12 +784,6 @@ %0 $(u.u.old [%1 (house-0-to-house-1 +.u.u.old)]) == :: -++ pull - |= ost=bone - ^- [(list move) _+>] - ~& [%rodeo-pull ost] - ra-abet:~(ra-cancel ra ost ~) -:: ++ house-0-to-house-1 |= vat=house-0 ^- house-1