# Patch by Jonathan A. Booth to # PennMUSH 1.7.2pl24 w/TCL patch. # You need this for the new features of the bbs 1.0.4 to work. # Unfortunatly it's not yet in the tcl distro, and with triv as # active as he hasn't been it may not make it there. # Right now it's unsupported. Then again the code isn't that # complex, it should go fine. Patch by hand if you need to. Index: src/bsd.c *** tcl.1/src/bsd.c Wed, 14 Apr 1999 23:29:04 -0500 kamikaze (pennmush/b/17_bsd.c 1.2 640) --- tcl.3/src/bsd.c Tue, 20 Apr 1999 11:05:16 -0500 kamikaze (pennmush/b/17_bsd.c 1.4 640) *************** *** 3443,3448 **** --- 3443,3453 ---- rnxt[j] = NULL; } + /* Call the tcl connection hook */ + #ifdef ENABLE_TCL + tclhook_connect(player); + #endif + /* do the person's personal connect action */ temp = atr_get(player, "ACONNECT"); if (temp) { *************** *** 3554,3559 **** --- 3559,3569 ---- wnxt[j] = NULL; rnxt[j] = NULL; } + + /* Call the tcl connection hook */ + #ifdef ENABLE_TCL + tclhook_disconnect(player); + #endif temp = atr_get(player, "ADISCONNECT"); if (temp) { Index: hdrs/penntcl.h *** tcl.1/hdrs/penntcl.h Wed, 14 Apr 1999 23:29:04 -0500 kamikaze (pennmush/c/32_penntcl.h 1.1 644) --- tcl.3/hdrs/penntcl.h Tue, 20 Apr 1999 11:05:16 -0500 kamikaze (pennmush/c/32_penntcl.h 1.3 644) *************** *** 70,76 **** #define EVENT_CREATE 4 #define EVENT_CLONE 5 #define EVENT_FREE 6 ! #define EVENT_MAX 7 /* ClientData? tcl_instance? Same thing :) */ #define TCLCMD(x) \ --- 70,78 ---- #define EVENT_CREATE 4 #define EVENT_CLONE 5 #define EVENT_FREE 6 ! #define EVENT_CONNECT 7 ! #define EVENT_DISCONNECT 8 ! #define EVENT_MAX 9 /* ClientData? tcl_instance? Same thing :) */ #define TCLCMD(x) \ *************** *** 128,133 **** --- 130,137 ---- void tclhook_create _((dbref new)); void tclhook_clone _((dbref new, dbref source)); void tclhook_free _((dbref item)); + void tclhook_connect _((dbref item)); + void tclhook_disconnect _((dbref item)); char *filebasename _((char *filename)); struct tcl_instance *tcl_spawn _((dbref player, char *name, char **result)); void tcl_init _((void)); Index: src/tcl.c *** tcl.1/src/tcl.c Wed, 14 Apr 1999 23:29:04 -0500 kamikaze (pennmush/c/33_tcl.c 1.1 644) --- tcl.3/src/tcl.c Tue, 20 Apr 1999 10:47:23 -0500 kamikaze (pennmush/c/33_tcl.c 1.2 644) *************** *** 779,784 **** --- 779,798 ---- tclhook_doem(EVENT_FREE, unparse_integer(item)); } + void + tclhook_connect(item) + dbref item; + { + tclhook_doem(EVENT_CONNECT, unparse_integer(item)); + } + + void + tclhook_disconnect(item) + dbref item; + { + tclhook_doem(EVENT_DISCONNECT, unparse_integer(item)); + } + /********************************************************************* * TinyMUSH 2.2.4 Compability Commands. * *************** *** 1126,1131 **** --- 1140,1149 ---- ht = EVENT_CLONE; else if (!strcmp(t, "FREE")) ht = EVENT_FREE; + else if (!strcmp(t, "CONNECT")) + ht = EVENT_CONNECT; + else if (!strcmp(t, "DISCONNECT")) + ht = EVENT_DISCONNECT; else { TCLERROR_STRING("addhook: unknown hooktype"); }