-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathCORE 05 - Database ID Manager - ID.txt
53 lines (35 loc) · 5.86 KB
/
CORE 05 - Database ID Manager - ID.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@@ DEPENDENCIES: Core
th u(NEWCOBJ,Database ID Manager <ID>,id,,,,WIZARD SAFE !NO_COMMAND,INHERIT SIDEFX SAFE)
&CMD`+ID`PENNMUSH [u(cobj,id)]=$^(?\:\+)?(id)(?\:/(\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+ID`MAIN
@set [u(cobj,id)]/CMD`+ID`PENNMUSH=regexp
&CMD`+ID`RHOSTMUSH [u(cobj,id)]=$^(?\:\+)?(id)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+ID`MAIN
@set [u(cobj,id)]/CMD`+ID`RHOSTMUSH=regexp
&CMD`+ID`MAIN [u(cobj,id)]=@attach %!/INC`GETSWITCH=%2;@attach %!/INC`[u(strfirstof,%q<switch>,MAIN)]=%3,%4
@set [u(cobj,id)]/CMD`+ID`[u(choosegame,RHOSTMUSH,PENNMUSH)]=no_command
&SYSTEM`NAME [u(cobj,id)]=ID
&SWITCHES`ADMIN [u(cobj,id)]=SEARCH|MERGE
&INC`MAIN [u(cobj,id)]=@attach %!/INC`CHECKPC=u(strfirstof,%0,%#),1;@attach %!/INC`MSG=The Database ID for %q<t1name> is: %q<t1id>
&INC`SEARCH [u(cobj,id)]=@pemit %#=u(header,Database IDs for Characters Like: %0);@pemit %#=ansi(u(color,%#,COLUMN_NAMES),align(1 6 30 36,D,ID,OBJID,Name));@pemit %#=u(separator);@dolist/inline/delimit [u(rsep)] [u(mysql3,SEARCH`CHARACTERS,sqlescape(%0))]={th u(setq,data,u(choosegame,%i0,%d0));@pemit %#=align(1 6 30 36,if(u(elements,%q<data>,1,u(fsep)),ansi(hr,X),%b),u(elements,%q<data>,2,u(fsep)),u(elements,%q<data>,3,u(fsep)),u(elements,%q<data>,4,u(fsep)))};@pemit %#=u(footer)
&Q`SEARCH`CHARACTERS [u(cobj,id)]=SELECT character_is_deleted,character_id,character_objid,character_name FROM volv_character WHERE character_name LIKE '%!%' ORDER BY character_name
&INC`MERGE [u(cobj,id)]=@attach %!/INC`CHECKPC=%0,1;@check u(setr,oldid,u(mysql,EXACT`CHARACTER_ID,%1))=@attach %!/INC`MSG=ERROR: Could not find deleted match for ID '%1';@attach %!/INC`VERIFY=[ansi(hr,WARNING:)] This will merge %q<t1name> into the Old Character ID '%1'. All scenes\, jobs\, and board posts of Character ID %q<t1id> will be assigned to the old ID. Other data associated with ID %q<t1id> will be lost. Is this okay? Enter the same command again in ten seconds to continue.,MERGE %q<t1> %q<oldid>;@dolist/inline JLINK BB BB2 PLOT ACTOR={@attach %!/INC`DOSQL=MERGE`##,%q<oldid>,%q<t1id>};@attach %!/INC`DOSQL=MERGE`DELETE_OLD,%q<t1id>;@attach %!/INC`DOSQL=MERGE`RESURRECT,%q<oldid>;@attach %!/INC`DOSQL=MERGE`OBJID,%q<t1objid>,%q<oldid>;th u(attrib_set,%q<t1>,D`ID,%q<oldid>);@attach %!/INC`MSG`CHAN=Re-Assigned %q<t1name> to the Old ID: %q<oldid>;@attach %!/INC`MSG`NOTICE=You were re-assigned the old character id: %q<oldid>,%q<t1>;@attach %!/INC`MSG=Reassignment complete.
&Q`EXACT`CHARACTER_ID [u(cobj,id)]=SELECT character_id FROM volv_character WHERE character_id=? LIMIT 1
&Q`MERGE`DELETE_OLD [u(cobj,id)]=DELETE from vol_entity WHERE entity_id=?
&Q`MERGE`OBJID [u(cobj,id)]=UPDATE vol_entity SET entity_objid=? WHERE entity_id=?
&Q`MERGE`RESURRECT [u(cobj,id)]=UPDATE vol_character SET character_is_deleted=0 WHERe character_id=?
&Q`MERGE`JLINK [u(cobj,id)]=UPDATE vol_jlink SET character_id=? WHERE character_id=?
&Q`MERGE`BB [u(cobj,id)]=UPDATE vol_bbpost SET entity_id=? WHERE entity_id=?
&Q`MERGE`BB2 [u(cobj,id)]=UPDATE vol_bbcomment SET entity_id=? WHERE entity_id=?
&Q`MERGE`PLOT [u(cobj,id)]=UPDATE vol_runner SET character_id=? WHERE character_id=?
&Q`MERGE`ACTOR [u(cobj,id)]=UPDATE vol_actor SET character_id=? WHERE character_id=?
&PLAYER`CREATE [u(cobj,id)]=@check words(u(setr,results,u(mysql3,SEARCH`CHARACTERS_NEW,sqlescape(%1))),u(rsep))={@attach %!/INC`MSG`CHAN=[ansi(hr,ALERT:)] Character '%1' (%0) Created! If this is a re-created old character\, check +shelp +id about re-assigning their old ID.,,,,%0;@select/inline isdbref(%#)=1,{@attach %!/INC`MSG=[ansi(hr,ALERT:)] Character '%1' (%0) Created! If this is a re-created old character\, check +shelp +id about re-assigning their old ID.,%#}};@attach %!/INC`MSG`CHAN=[ansi(hr,ALERT:)] Character '%1' (%0) Created! Possible re-creation of: [iter(%q<results>,u(elements,%i0,3,u(fsep)) - \([u(elements,%i0,1,u(fsep))]\, [u(elements,%i0,2,u(fsep))]\),u(rsep),\,%b)]. Check +shelp +id for info about re-assigning old ids.,,,,%0;@select/inline isdbref(%#)=1,{@attach %!/INC`MSG=[ansi(hr,ALERT:)] Character '%1' (%0) Created! Possible re-creation of: [iter(%q<results>,u(elements,%i0,3,u(fsep)) - \([u(elements,%i0,1,u(fsep))]\, [u(elements,%i0,2,u(fsep))]\),u(rsep),\,%b)]. Check +shelp +id for info about re-assigning old ids.,%#}
&Q`SEARCH`CHARACTERS_NEW [u(cobj,id)]=SELECT character_id,character_objid,character_name FROM volv_character WHERE character_name LIKE '%!%' AND character_is_deleted=1
&OBJECT`DESTROY [u(cobj,id)]=@select/inline %2=PLAYER,{@select/inline t(u(setr,id,u(mysql,SELECT`CHARACTER_FROM_OBJID,%0)))=1,{@attach %!/INC`DOSQL=DELETE`CHARACTER,%q<id>}}
&OBJECT`RENAME [u(Cobj,id)]=@select/inline t(u(setr,id,u(mysql,SELECT`ENTITY_FROM_OBJID,%0)))=1,{@attach %!/INC`DOSQL=RENAME`ENTITY,%1,%q<id>}
&Q`RENAME`ENTITY [u(cobj,id)]=UPDATE vol_entity SET entity_name=? WHERE entity_id=?
&Q`SELECT`CHARACTER_FROM_OBJID [u(cobj,id)]=SELECT character_id FROM volv_character WHERE character_objid=? AND character_is_deleted=0
&Q`SELECT`ENTITY_FROM_OBJID [u(cobj,id)]=SELECT entity_id FROM vol_entity WHERE entity_objid=?
&Q`DELETE`CHARACTER [u(Cobj,id)]=UPDATE vol_character SET character_is_deleted=1 WHERE character_id=?
&HLP`ID [u(cobj,id)]=Every character in the game has an ID used for SQL database purposes. This is relevant for any Wiki code! To see IDs:%R%R[ansi(h,+id <name>)] - Show the ID of a given character. Defaults to yourself if no name is provided.
+help/add Character/+id=[u(cobj,id)]/HLP`ID
&SHLP`ID [u(cobj,id)]=It is VERY IMPORTANT that any re-created characters be IMMEDIATELY re-assigned their old IDs before they participate in any logged scenes or start to fill out information.%R%R[ansi(hc,ID Management)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+id/search <name>)] - Searches for all characters with a name like <name> and displays old database records.%R[ansi(h,+id/merge <character>=<id>)] - Assigns the old <id> to the <character> specified.)]
+shelp/add Character/+id=[u(cobj,id)]/SHLP`ID