@@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ SGP patch installer - 25 April 2001 @@ @@ This is a quotable installer file that updates SGP code released to the SGP @@ website (http://sgp.erisian.net) prior to 25 April 01. @@ Code taken from the SGP website and installed AFTER 25 April 01 will already @@ have these changes or will be covered by a subsequent set of bugfixes. @@ @@ DO NOT USE THIS FILE if you are installing SGP into a blank database. All @@ of these changes are included as part of the standard installers. @@ @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ This file adds the following features to standard installations: @@ @@ - Fixes a broken uselock on the Wizard Globals @@ - Replaces the +motd after previous was removed at author's request. New @@ code is backwards compatible with previous implementation. Many thanks go @@ to Ashen-Shugar for recoding and for adding new functionality. MUX users @@ should get the updated helpfiles and add them to your plushelp.txt and @@ staffhelp.txt @@ - Updates +staff/add and +staff/remove to improve performance. @@ - Updates +wizhelp +motd in softcoded +help systems. @@ @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ All of these features can be applied to uncustomized SGP code without fear @@ of screwing up your globals. This is all new code, not bugfixes. @@ All code ports cleanly to PennMUSH, TinyMUSH 2.2.x, MUX 2.0 and RhostMUSH @@ and worked on the unmodified test servers. @@ @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ @@ Using this file: @@ @@ ALL code in this file is uncommented and will quote to the game with your @@ MUSH client's uploading commands. @@ @@ Quote this file into the game in the master room for the changes to take @@ effect. Otherwise, change the names of the objects with the DBREF of the @@ object as it exists in your game. @@ @@ Make sure you run a test of the affected code and report any problems to the @@ SGP bug page. We like to get things fixed as soon as possible. @@ @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @pemit me=Updating object permissions. Moment.... &ISWIZARD SGP - Wizard Globals=[hasflag(%#,WIZARD)] @lock/use SGP - Wizard Globals=ISWIZARD/1 @pemit me=Patching +staff/add and +staff/remove. Moment.... &CMD-STAFF-ADD SGP - Wizard Globals=$+staff/add *:@pemit me=[setq(0,switch(isdbref(%0),1,%0,num(*%0)))];@switch/first 1=not(strmatch(type(%q0),PLAYER)),{@pemit %#=%0 is not a player!},match(get(v(db)/STAFF-LIST),%q0),{@pemit %#=That player is already listed in +staff.},{@wait 0=&STAFF-LIST [v(db)]=[get(v(db)/STAFF-LIST)]%B%q0;@pemit %#=You have added [name(%q0)] to the +staff listing.} &CMD-STAFF-REMOVE SGP - Wizard Globals=$+staff/remove *:@pemit me=[setq(0,switch(isdbref(%0),1,%0,num(*%0)))];@switch/first 1=not(strmatch(type(%q0),PLAYER)),{@pemit %#=%0 is not a player!},not(match(get(v(db)/STAFF-LIST),%q0)),{@pemit %#=That player is not listed in +staff.},{&STAFF-LIST [v(db)]=remove(get(v(db)/STAFF-LIST),%q0);@pemit %#=You have removed [name(%q0)] from the +staff listing.} @pemit me=Replacing +motd. Moment.... &CMD-MOTD_SET SGP - Wizard Globals=$+motd/set *=*:@pemit %#=[setq(0,[match(general wizard full down,%0)][setq(9,isstaff(%#))][r(9)])][setq(6,mid(r(0),0,1))][switch(r(0),?0,Permission denied.,0?,+Motd: ERROR - '[secure(%0)]' not a valid MOTD type.,1?,+Motd: General MOTD set.,2?,+Motd: Wizard MOTD set.,3?,+Motd: Full MOTD set.,4?,+Motd: Down MOTD set.)];&MOTD-[setq(1,extract(GEN_LIST WIZ_LIST FULL DOWN,r(6),1))][r(1)] [switch([r(9)][setq(3,gt(r(6),0))][r(3)],11,v(DB),#-1)]=[setunion(get([v(DB)]/MOTD-[r(1)]),secs())];&MOTD-[switch([setq(4,lt(r(6),3))][r(4)],1,[secs()],extract(X X FULL DOWN,r(6),1))] [switch([r(3)][r(9)],11,v(DB),#-1)]=[secure(%1)];@swi [r(0)]=11,{@motd [iter(get([v(DB)]/MOTD-GEN_LIST),%r[get([v(DB)]/MOTD-##)]%r)];@pemit/list lwho()=+Motd: [name(%#)] has set a new general MOTD.},21,{@motd/wizard [iter(get([v(DB)]/MOTD-WIZ_LIST),%r[get([v(DB)]/MOTD-##)]%r)]},31,{@motd/full %1},41,{@motd/down %1} &CMD-MOTD_DEL SGP - Wizard Globals=$+motd/del *=*:@pemit %#=[setq(0,[match(general wizard full down,%0)][setq(9,isstaff(%#))][r(9)])][setq(6,mid(r(0),0,1))][switch(r(0),?0,Permission denied.,0?,+Motd: ERROR - '[secure(%0)]' not a valid MOTD type.,1?,+Motd: [setq(8,and(lte(%1,words(get([v(DB)]/motd-gen_list))),gt(%1,0)))][switch(r(8),0,Invalid general MOTD number,You remove MOTD #[add(0,%1)] from general)],2?,+Motd: [setq(8,and(lte(%1,words(get([v(DB)]/motd-wiz_list))),gt(%1,0)))][switch(r(8),0,Invalid wizard MOTD number,You remove MOTD #[add(0,%1)] from wizard)],3?,+Motd: You remove the full MOTD,4?,+Motd: You remove the down MOTD)];&MOTD-[setq(1,extract(GEN_LIST WIZ_LIST FULL DOWN,r(6),1))][r(1)] [switch([r(9)][setq(3,gt(r(6),0))][r(3)],11,v(DB),#-1)]=[setdiff(get([v(DB)]/MOTD-[r(1)]),[setq(7,extract(get([v(DB)]/MOTD-[r(1)]),%1,1))][r(7)])];&MOTD-[switch([setq(4,lt(r(6),3))][r(4)],1,[r(7)],extract(X X FULL DOWN,r(6),1))] [switch([r(3)][r(9)],11,v(DB),#-1)];@swi [r(0)]=11,{@motd [iter(get([v(DB)]/motd-gen_list),%r[get([v(DB)]/MOTD-##)]%r)]},21,{@motd/wizard [iter(get([v(DB)]/motd-wiz_list),%r[get([v(DB)]/MOTD-##)]%r)]},31,{@motd/full;@wipe [v(DB)]/MOTD-FULL},41,{@motd/down;@wipe [v(DB)]/MOTD-DOWN} &CMD-MOTD_LIST SGP - Wizard Globals=$+motd/list:@pemit %#=[center(Currently Set MOTD,78,=)]%rGeneral:[iter(get([v(DB)]/motd-gen_list),%r[member(get([v(DB)]/motd-gen_list),##)]> [get([v(DB)]/motd-##)]%r)]%rWizard:[iter(get([v(DB)]/motd-wiz_list),%r[member(get([v(DB)]/motd-wiz_list),##)]> [get([v(DB)]/motd-##)]%r)]%rFull:%r[get([v(DB)]/motd-full)]%r%rDown:%r[get([v(DB)]/motd-down)]%r[u(v(db)/footer)] &CMD-MOTD_RESET SGP - Wizard Globals=$+motd/reset:@motd [iter(get([v(DB)]/motd-gen_list),%r[get([v(DB)]/MOTD-##)]%r)];@motd/wizard [iter(get([v(DB)]/motd-wiz_list),%r[get([v(DB)]/MOTD-##)]%r)];@motd/down [get([v(DB)]/motd-down)];@motd/full [get([v(DB)]/motd-full)] &CMD-MOTD_CLEAR SGP - Wizard Globals=$+motd/clear *:@swi/first [match(general wizard full down all,%0)][isstaff(%#)]=?0,{@pemit %#=Permission denied.},0?,{@pemit %#=+Motd: ERROR - Invalid MOTD type},1?,{@pemit %#=+Motd: You have cleared the general MOTD;@dolist [get([v(DB)]/motd-gen_list)]=@wipe [v(DB)]/MOTD-##;@wipe [v(DB)]/motd-gen_list;@motd},2?,{@pemit %#=+Motd: You have cleared the wizard MOTD;@dolist [get([v(DB)]/motd-wiz_list)]=@wipe [v(DB)]/MOTD-##;@wipe [v(DB)]/motd-wiz_list;@motd/wizard},3?,{@pemit %#=+Motd: You have cleared the full MOTD;@wipe [v(DB)]/motd-full;@motd/full},4?,{@pemit %#=+Motd: You have cleared the down MOTD;@wipe [v(DB)]/motd-down;@motd/down},5?,{@pemit %#=+Motd: You have cleared ALL of the MOTD's.;@motd;@motd/full;@motd/down;@motd/wizard} &CREDITS-+MOTD SGP - Global Parent Object=Created from scratch by Ashen-Shugar (c) 2001, All rights reserved. This code, with permission, belongs to the SGP code development. All issues with credibility, ownership, or code herein should be brought to the distributors of SGP. This code is original and is not based (other than syntax and attribute compatability) off any other code. @pemit me=Checking server and version. Moment.... @switch version()=MUX*,{@pemit me=Be sure to get the file SGP-+help-update4-01.txt and add the changes to your helpfiles!!!},{@pemit me=Patching +wizhelp to replace the change in +motd. Moment....;&WIZHELP_+MOTD SGP - Help Data=%[repeat%(-%,78%)%]%%R+motd%%R%%R%[space%(2%)%]SYNTAX: +motd/list%%R%[space%(10%)%]+motd/set =%%R%[space%(10%)%]+motd/del =%%R%[space%(10%)%]+motd/clear %%R%[space%(10%)%]+motd/reset%[space%(3%)%]%%R%%R%[space%(2%)%]This code allows for easier manipulation of the @motd command and the use of %%R%[space%(2%)%]softcoded MOTD to create semi-permanent MOTD.%[space%(2%)%]%%R%[space%(2%)%]%%R%[space%(2%)%]The first command lists the stored MOTD messages in order from oldest to %%R%[space%(2%)%]newest%, by MOTD type.%[space%(2%)%]The types listed are: general%, wizard%, down%, and %%R%[space%(2%)%]full.%[space%(2%)%]%%R%[space%(2%)%]%%R%[space%(2%)%]The second command sets an MOTD attribute to the global parent.%[space%(2%)%]You select %%R%[space%(2%)%]the type from the above list and set the message of your choosing.%[space%(2%)%]%%R%[space%(2%)%]%%t%%R%[space%(2%)%]> +motd/set general=This is an MOTD.%%R%%R%[space%(2%)%]The third command removes a selected MOTD # from a given MOTD listing.%[space%(2%)%]In %%R%[space%(2%)%]the above example%, the message number is 1 in the general list. %%R%%R%[space%(2%)%]> +motd/del general=1 %%R%%R%[space%(2%)%]The fourth command clears all the MOTD of a given type.%%R%%R%[space%(2%)%]> +motd/clear general %%R%[space%(2%)%]%%R%[space%(2%)%]The last command resets the +motd system so that the game will read the %%R%[space%(2%)%]MOTDs appropriately.%[space%(2%)%]This code is called as part of the @startup for the %%R%[space%(2%)%]object.%%R%[repeat%(-%,78%)%]} @pemit me=Updating +version. +version/update [num(SGP - Wizard Globals)]/patchlevel=042501 Patch +version/update [num(SGP - Wizard Globals)]/history=042501 Patch-permissions fix +motd +staff/add +staff/remove fixes +version/update [num(SGP - Global Parent Object)]/patchlevel=042501 Patch +version/update [num(SGP - Global Parent Object)]/history=042501 Patch-amended CREDITS @switch version()=MUX*,{},{+version/update [num(SGP - Help Data)]/patchlevel=042501 Patch;+version/update [num(SGP - Help Data)]/history=042501 Patch +motd} @pemit me=Done!