Skip to content

Commit

Permalink
Beta Preparations
Browse files Browse the repository at this point in the history
  • Loading branch information
volundmush committed Dec 2, 2013
1 parent c96b23c commit e8cefe8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
6 changes: 2 additions & 4 deletions CORE 15 - Bulletin Board System - BBS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,14 @@
&INC`ALERT u(bbs)=@switch/inline %0=BB,{th setq(members,filterbool(#lambda/u(FUN`CANREAD`BB,\%0,%2,,),setunion(lwho(),)))},GB,{th setq(members,filterbool(#lambda/isgroupmember(\%0,%q<gid1>),setunion(lwho(),)))};@dolist/inline %q<members>={@nspemit %i0=%3}
@@ %0 - Mode, GB or BB. %1 - Board number. %2 - Board DBREF. %3 - Message.

&INC`NEWGROUP u(bbs)=@assert strlen(%1%2)=@nspemit %#=announce(%q<ann>) ERROR: No name entered for the new board!;@assert valid(name,%1%2)=@nspemit %#=announce(%q<ann>) ERROR: That is not a suitable name for a board.;@tel setr(bb,create(%1%2))=switch(%0,BB,u(bbs),GB,u(gdb));@switch/inline %0=BB,{&groups u(bbs)=trim(cat(v(groups),%q<bb>))},GB,{&%q<gid1>`BOARDS u(gdb)=trim(cat(get(u(gdb)/%q<gid1>`BOARDS),%q<bb>))};@set %q<bb>=SAFE;@nspemit %#=announce(%q<ann>) Board '%1%2' created!
&INC`NEWGROUP u(bbs)=@assert strlen(%1%2)=@nspemit %#=announce(%q<ann>) ERROR: No name entered for the new board!;@assert valid(name,%1%2)=@nspemit %#=announce(%q<ann>) ERROR: That is not a suitable name for a board.;@tel setr(bb,create(%1%2))=switch(%0,BB,u(bbs),GB,u(gdb));@power %q<bb>=many_attribs;@switch/inline %0=BB,{&groups u(bbs)=trim(cat(v(groups),%q<bb>))},GB,{&%q<gid1>`BOARDS u(gdb)=trim(cat(get(u(gdb)/%q<gid1>`BOARDS),%q<bb>))};@set %q<bb>=SAFE;@nspemit %#=announce(%q<ann>) Board '%1%2' created!

&INC`CLEARGROUP u(bbs)=@include u(bbs)/INC`CHECK`FINDBB=%0,%1,WRITE;@include u(ccs)/INC`VERIFY={[ansi(hr,WARNING:)] Deleting %q<ann> Board %q<bbnum> will also delete all messages. This cannot be undone! Please enter the same command again within 10 seconds to verify.},CLEARGROUP %0 %1,%q<ann>;@set %q<bb>=!SAFE;@nuke %q<bb>;@nuke %q<bb>;@set u(bbs)=!SAFE;@wipe u(bbs)/BB`%q<bb>;@set u(bbs)=SAFE;@switch/inline %0=BB,{&groups u(bbs)=ldelete(v(groups),%q<bbnum>)},GB,{&%q<gid1>`BOARDS u(gdb)=ldelete(get(u(gdb)/%q<gid1>`BOARDS),%q<bbnum>)}

&INC`REMOVE u(bbs)=@include u(bbs)/INC`CHECK`FINDBB=%0,%1,WRITE;@assert strlen(%2)=@nspemit %#=announce(%q<ann>) ERROR: No posts entered to remove.;@assert words(setr(processed,filterbool(#lambda/if(strlen(setr(post,elements(u(FUN`LISTPOSTS,%q<bb>),\%0))),or(%q<isadmin>,strmatch(get(%q<bb>/\%q<post>`BYDB),%:))),setr(orig,u(FUN`MESSLIST,%#,%q<bb>,%2)))))=@nspemit %#=announce(%q<ann>) ERROR: No posts to remove.;@switch/inline gt(words(setr(cannot,setdiff(%q<processed>,%q<orig>,%b,n))),0)=1,{@nspemit %#=announce(%q<ann>) Could not remove posts: [itemize(%q<cannot>,%b,and,\,)]};@set %q<bb>=!SAFE;@dolist/inline %q<processed>={@wipe %q<bb>/[elements(u(FUN`LISTPOSTS,%q<bb>),%i0)];@nspemit %#=Message %i0 removed from group #%q<bbnum> ([name(%q<bb>)]).};@set %q<bb>=SAFE

&INC`READ u(bbs)=@switch/inline strlen(%1%2)=0,{@include u(bbs)/INC`READ`LISTGROUPS},{@switch/inline and(strlen(%1),strlen(%2))=1,{@include u(bbs)/INC`READ`CHECKPOST},{@switch/inline gt(strlen(%1),0)=1,{@include u(bbs)/INC`READ`LISTMESS},{@nspemit %#=announce(%q<ann>) ERROR: How the hell did we get here?}}}

@@ get(%i0/CANREAD):[get(%i0/CANWRITE)]:[u(%i0/CANWRITE,%#)]

&FUN`NAME u(bbs)=if(%1,get(u(gdb)/%1`NAME) GBS[if(strlen(%0),%b- [name(%0)])],mudname() BBS[if(strlen(%0),%b- [name(%0)])])

&INC`ALL u(bbs)=@assert words(setr(allunread,filterbool(#lambda/words(setdiff(lattr(\%0/*),get(%#/D`BB`\%0`READ))),u(FUN`VALIDGROUPS`%0,%#,READ))))=@nspemit %#=announce(%q<ann>) There are no Unread messages on the %q<ann>!;@dolist/inline %q<allunread>={@switch/inline %0=BB,{@force/inplace %#=+bbread %i0/u},GB,{@force/inplace %#=+gbread %i0/u}}
Expand Down Expand Up @@ -136,7 +134,7 @@

&STARTUP u(bbs)=@trigger u(bbs)/TRG`TIMEOUT

&TRG`TIMEOUT u(bbs)=@switch/inline u(FUN`CONFIG,autotimeout)=1,{@set u(bbs)=!SAFE;@dolist lattr(u(bbs)/BB`#*)={@assert isdbref(last(%i0,`))=@wipe u(bbs)/%i0;@switch/inline gt(u(FUN`CONFIG,last(%i0,`),timeout),0)=1,{@set last(%i0,`)=!SAFE;@dolist/inline lattr(last(%i0,`)/*)={@switch/inline gt(setr(timeoutsecs,strfirstof(get(last(%i1,`)/%i0`TIMEOUT),u(FUN`CONFIG,last(%i1,`),timeout))),0)=1,{@switch/inline gt(secs(),add(%q<timeoutsecs>,get(last(%i1,`)/%i0`ON)))=1,{@wipe last(%i1,`)/%i0}}};@set last(%i0,`)=SAFE}};@set u(bbs)=SAFE};@wait u(FUN`CONFIG,interval)=@trigger u(bbs)/TRG`TIMEOUT
&TRG`TIMEOUT u(bbs)=@switch/inline u(FUN`CONFIG,autotimeout)=1,{@set u(bbs)=!SAFE;@dolist lattr(u(bbs)/BB`#*)={@assert isdbref(last(%i0,`))=@wipe u(bbs)/%i0;@switch/inline gt(u(FUN`CONFIG,last(%i0,`),timeout),0)=1,{@set last(%i0,`)=!SAFE;@dolist/inline lattr(last(%i0,`)/*)={@switch/inline gt(setr(timeoutsecs,strfirstof(get(last(%i1,`)/%i0`TIMEOUT),u(FUN`CONFIG,last(%i1,`),timeout))),0)=1,{@switch/inline gt(secs(),add(%q<timeoutsecs>,strfirstof(get(last(%i1,`)/%i0`EDITED),get(last(%i1,`)/%i0`ON))))=1,{@wipe last(%i1,`)/%i0}}};@set last(%i0,`)=SAFE}};@set u(bbs)=SAFE};@wait u(FUN`CONFIG,interval)=@trigger u(bbs)/TRG`TIMEOUT

&INC`LOCK u(bbs)=@include u(bbs)/INC`CHECK`FINDBB=%0,%1,WRITE;@include u(ccs)/INC`PARTIAL=%2,read|write,|,%q<ann>,lock,lock;@switch/inline %0=BB,{@assert and(u(kls),u(kdb))=@nspemit %#=announce(%q<ann>) ERROR: Key System not installed, cannot continue.;@assert strlen(%3)=@nspemit %#=announce(%q<ann>) ERROR: No lock string entered. See [pueblize(+help +key)] for more information.;@assert eq(words(setr(choices,setdiff(%3,u(u(kls)/FUN`LISTLOCKS)))),0)=@nspemit %#=announce(KEY) ERROR: Following lock types not found: [itemize(%q<choices>,|,and,\,)];@lock/user:%q<lock> %q<bb>=iter(%3,@[u(kdb)]/%i0,%B,|);@lset %q<bb>/%q<lock>=v;@nspemit %#=announce(%q<ann>) You set the %q<lock> Lock on [name(%q<bb>)] to: %3},GB,{@assert strlen(%3)=@nspemit %#=announce(%q<ann>) ERROR: No lock rank entered.;@assert and(gte(%3,0),isint(%3))=@nspemit %#=announce(%q<ann>) ERROR: Ranks must be whole numbers 0 or greater.;&BB`%q<bb>`G%q<lock> u(bbs)=%3;@nspemit %#=announce(%q<ann>) You set the %q<lock> Lock on [name(%q<bb>)] to: %3}

Expand Down
19 changes: 19 additions & 0 deletions Patch - BB Comments.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@@ This is a strange little patch that adds the +bbcomment <board>/<post>/<subject>=<text> command to the BBS.

@switch/inline gt(match(get(u(bbs)/VAR`BB`PLAYCOMMS),COMMENT,|),0)=0,{&VAR`BB`PLAYCOMMS u(bbs)=cat(get(u(bbs)/VAR`BB`PLAYCOMMS),|COMMENT)}

&FUN`MSGFLAG u(bbs)=if(match(get(%0/D`BB`%1`READ),%2),if(nattr(%1/%2`COMM`*),if(match(get(%1/%2`COMMREAD),%#),,C)),U)

&INC`READ`SHOWPOST u(bbs)=@include u(bbs)/INC`CHECK`FINDPOST=%0,%1,%2;@nspemit %#=header(u(fun`name,%2,%q<gid1>));@nspemit %#=ljust(Message: [color(%#,%q<bbnum>/%q<postnum>,BBS`POSTNUM,n)] [color(%#,\([if(not(u(FUN`CONFIG,autotimeout)),No System Timeout,if(not(u(FUN`CONFIG,%q<bb>,timeout)),No Board Timeout,if(eq(get(%q<bb>/%q<post>`TIMEOUT),0),No Post Timeout,timestring(bound(abs(sub(secs(),add(strfirstof(get(%q<bb>/%q<post>`TIMEOUT),u(FUN`CONFIG,%q<bb>,timeout)),strfirstof(get(%q<bb>/%q<post>`EDITED),get(%q<bb>/%q<post>`ON))))),0)))))]\),BBS`POSTTIMEOUT,n)],35)Posted[space(8)]Author%r[ljust(color(%#,get(%2/%q<post>`HDR),BBS`POSTTITLE,n),35)][ljust(color(%#,timefmt($b $d $Y,lmath(max,firstof(get(%2/%q<post>`EDITED),get(%2/%q<post>`ON)))),BBS`POSTDATE,n),14)][left(color(%#,if(get(u(bbs)/BB`%q<bb>`ANONYMOUS),if(%q<isadmin>,([ansi(hx,get(%q<bb>/%q<post>`BY))]),default(u(bbs)/BB`%q<bb>`ANONYMOUS,Anonymous)),get(%q<bb>/%q<post>`BY)),BBS`POSTAUTHOR,n),21)]%R[header()];@nspemit %#=get(%q<bb>/%q<post>);th setq(oldids,setdiff(get(%#/D`BB`%2`READ),lattr(%2/*)));&D`BB`%2`READ %#=setunion(setdiff(get(%#/D`BB`%2`READ),%q<oldids>),%q<post>);@switch/inline gt(nattr(%q<bb>/%q<post>`COMM`*),0)=1,{@include u(bbs)/INC`READ`SHOWCOMMS;&%q<post>`COMMREAD %q<bb>=setunion(get(%q<bb>/%q<post>`COMMREAD),%#)},0,{@nspemit %#=header()}

&INC`READ`SHOWCOMMS u(bbs)=@dolist/inline sortkey(#lambda/last(\%0,`),lattr(%q<bb>/%q<post>`COMM`*))={@nspemit %#=header(Comment [last(%i0,`)] - Added [color(%#,timefmt($b $d $Y,get(%q<bb>/%i0`ON)),BBS`POSTDATE,n)]);@nspemit %#=ansi(h,get(%q<bb>/%i0`BY)) Commented:;@nspemit %#=get(%q<bb>/%i0)};@nspemit %#=header()

&INC`COMMENT u(bbs)=@include u(bbs)/INC`CHECK`FINDBB=%0,%1,WRITE;@include u(bbs)/INC`CHECK`FINDPOST=%0,before(%2,/),%q<bb>;@assert strlen(after(%2,/))=@nspemit %#=announce(%q<ann>) ERROR: Subject field empty!;@assert strlen(%3)=@nspemit %#=announce(%q<ann>) ERROR: Comment contents empty!;&[setr(attr,%q<post>`COMM`[nextslot(%q<bb>,%q<post>`COMM)])] %q<bb>=%3;&%q<attr>`BY %q<bb>=%n;&%q<attr>`BYDB %q<bb>=%:;&%q<attr>`HDR %q<bb>=after(%2,/);&%q<attr>`ON %q<bb>=secs();&%q<post>`EDITED %q<bb>=secs();@include u(bbs)/INC`ALERT=%0,%q<bbnum>,%q<bb>,{(New Comment added to [ucstr(%0)] Message ([pueblize(setr(messnum,%q<bbnum>/%q<postnum>),+[lcstr(%0)]read %q<messnum>)]) '[get(%q<bb>/%q<post>`HDR)]' on '[name(%q<bb>)]' by %n: [after(%2,/)])};@wipe %q<bb>/%q<post>`COMMREAD

&INC`SCAN u(bbs)=@assert words(setr(groups,filterbool(#lambda/or(strlen(setdiff(lattr(\%0/*),get(%#/D`BB`\%0`READ))),lmath(max,iter(lattr(\%0/*),strmatch(u(FUN`MSGFLAG,%#,\%0,\%i0),C)))),u(FUN`VALIDGROUPS`%0,%#,READ))))=@nspemit %#=announce(%q<ann>) There are no unread postings on the %q<ann>.;@nspemit %#=header(u(FUN`NAME) - Unread Postings);@dolist/inline %q<groups>={@nspemit %#=pueblize(name(%i0) (#[match(u(FUN`LISTGROUPS`%0),%i0)]),+[lcstr(%0)]read [match(u(FUN`LISTGROUPS`%0),%i0)]): [setr(num,words(setr(unread,sortkey(#lambda/baseconv(\%0,36,10),setunion(setdiff(lattr(%i0/*),get(%#/D`BB`%i0`READ)),filterbool(#lambda/strmatch(u(FUN`MSGFLAG,%#,%i0,\%0),C),lattr(%i0/*)))))))] unread ([itemize(iter(%q<unread>,pueblize(match(u(FUN`LISTPOSTS,%i1),%i0),+[lcstr(%0)]read [match(u(FUN`LISTGROUPS`%0),%i1)]/[match(u(FUN`LISTPOSTS,%i1),%i0)])),%b,and,\,)]);th setq(total,add(%q<total>,%q<num>))};@nspemit %#=header(Total Unread: %q<total>)

&INC`NEXT u(bbs)=@assert isdbref(setr(bb,first(filterbool(#lambda/or(strlen(setdiff(lattr(\%0/*),get(%#/D`BB`\%0`READ))),lmath(max,iter(lattr(\%0/*),strmatch(u(FUN`MSGFLAG,%#,\%0,\%i0),C)))),u(FUN`VALIDGROUPS`%0,%#,READ)))))=@nspemit %#=announce(%q<ann>) There are no unread postings on the %q<ann>.;th setq(msg,first(sortkey(#lambda/baseconv(\%0,36,10),setunion(setdiff(lattr(%q<bb>/*),get(%#/D`BB`%q<bb>`READ)),filterbool(#lambda/strmatch(u(FUN`MSGFLAG,%#,%q<bb>,\%0),C),lattr(%q<bb>/*))))));th setr(bbnum,match(u(FUN`LISTGROUPS`%0),%q<bb>));@include u(bbs)/INC`READ`SHOWPOST=%0,match(u(FUN`LISTPOSTS,%q<bb>),%q<msg>),%q<bb>

&INC`ALL u(bbs)=@assert words(setr(allunread,filterbool(#lambda/or(strlen(setdiff(lattr(\%0/*),get(%#/D`BB`\%0`READ))),lmath(max,iter(lattr(\%0/*),strmatch(u(FUN`MSGFLAG,%#,\%0,\%i0),C)))),u(FUN`VALIDGROUPS`%0,%#,READ))))=@nspemit %#=announce(%q<ann>) There are no Unread messages on the %q<ann>!;@dolist/inline %q<allunread>={@switch/inline %0=BB,{@force/inplace %#=+bbread %i0/u},GB,{@force/inplace %#=+gbread %i0/u}}

&FUN`MESSLIST u(bbs)=setunion(iter(%2,switch(1,valnum(%i0),%i0,regmatchi(%i0,^\\d+-\\d+$),setq(num1,abs(before(%i0,-)),num2,abs(after(%i0,-)))[setq(ord,sort(%q<num1> %q<num2>))][lnum(first(%q<ord>),last(%q<ord>))],strmatch(%i0,u),iter(setunion(setdiff(lattr(%1/*),get(%0/D`BB`%1`READ)),filterbool(#lambda/strmatch(u(FUN`MSGFLAG,%0,%1,\%0),C),lattr(%1/*))),match(u(FUN`LISTPOSTS,%1),%i0)),0),\,,%B),,%B,n)
8 changes: 1 addition & 7 deletions Patch - Scene System.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ th attrib_set(u(cco)/VAR`CATEGORIES,setunion(get(u(cco)/VAR`CATEGORIES),IC,|,|))

&INCLUDE`LASTPOSE`POSTPOSE u(scenesys)=@assert u(fn`is`ic,%1);@assert u(fn`get`activescene,u(fn`get`playerid,%1))=@nsremit %l=%B;;@dolist/inline [lockfilter(lastpose`post:1,lvplayers(%L))]=@pemit ##=center(<%b[u(fn`islogged,name(%1),%1,%0)]End of [ansi(hw,accname(%1))]'s pose%b>,78);&lastpose %#=%qR ; &lastpose`secs %#=[secs()] ; &observe %1=0

u(fn`get`activescene,u(fn`get`playerid,%1))

&FN`ISLOGGED u(scenesys)=if(and(not(u(fn`is`exitsimilar,%0,loc(%1))),not(u(fn`is`oocchatter,%2)),setr(PlayerID,u(fn`get`playerid,%1)),gte(words(%2),u(data`minposewords)),not(u(fn`is`exitsimilar,%0,loc(%1))),setr(SceneID,u(fn`get`activescene,%q<PlayerID>)),not(u(fn`is`spam,%q<SceneID>,%1,%q<PlayerID>))),\[[ansi(hg,LOG: %q<SceneID>)]\]%b)[if(setr(LocalScene,u(fn`get`scene`recentatloc,objid(loc(%1)),1)),[switch(%q<LocalScene>,u(fn`get`activescene,u(fn`get`playerid,%1)),,%b[ansi(hw,\[[ansi(hr,X)]\])]%b)])]


@@ This removes them entirely...
&INCLUDE`LASTPOSE`PREPOSE u(scenesys)

Expand All @@ -52,7 +49,4 @@ u(fn`get`activescene,u(fn`get`playerid,%1))

&OVERRIDE`SAY u(scenesys)=$say*:@assert or(not(%0),regmatch(%0,(?s)^\\s(.+), s p))=@nspemit %#=Huh? (Type "help" for help.); th [setr(r,speak(&%N,%qp))] ; @include/nobreak me/include`lastpose`prepose=%qr,%: ;@include u(pot)/INC`ALTMAIN=SAY,%0; @message/spoof/remit %l=%qr,sayformat,%0,%#,%n,[accname(%#)],%qp,%qr,[udefault(%#/saymodifier,says,%qp)],u(fn`islogged,%N,%:,%qr) ; @include/nobreak me/include`lastpose`postpose=%qr,%: ; @include me/include`lastpose`catchpose=trimpenn(%qr,%r),%:

&OVERRIDE`SEMIPOSE u(scenesys)=$semipose*:@assert or(not(%0),regmatch(%0,(?s)^\\s(.+), s p))=@nspemit %#=Huh? (Type "help" for help.); th [setr(r,speak(&%N,;%qp))] ; @include/nobreak me/include`lastpose`prepose=%qr,%: ;@include u(pot)/INC`ALTMAIN=SEMIPOSE,%0; @message/spoof/remit %l=%qr,semiposeformat,%0,%#,%n,[accname(%#)],%qp,%qr,,,u(fn`islogged,%N,%:,%qr) ; @include/nobreak me/include`lastpose`postpose=%qr,%: ; @include me/include`lastpose`catchpose=trimpenn(%qr,%r),%:


@include u(pot)/INC`ALTMAIN=SEMIPOSE,%0;
&OVERRIDE`SEMIPOSE u(scenesys)=$semipose*:@assert or(not(%0),regmatch(%0,(?s)^\\s(.+), s p))=@nspemit %#=Huh? (Type "help" for help.); th [setr(r,speak(&%N,;%qp))] ; @include/nobreak me/include`lastpose`prepose=%qr,%: ;@include u(pot)/INC`ALTMAIN=SEMIPOSE,%0; @message/spoof/remit %l=%qr,semiposeformat,%0,%#,%n,[accname(%#)],%qp,%qr,,,u(fn`islogged,%N,%:,%qr) ; @include/nobreak me/include`lastpose`postpose=%qr,%: ; @include me/include`lastpose`catchpose=trimpenn(%qr,%r),%:

0 comments on commit e8cefe8

Please sign in to comment.