diff -c ./expr.c ../../tf-50b7.1/src/expr.c *** ./expr.c Sun Apr 17 21:15:35 2005 --- ../../tf-50b7.1/src/expr.c Thu Sep 7 18:09:27 2006 *************** *** 970,975 **** --- 970,981 ---- (n>2 ? opdstd(n-2) : "")); return newint(i); + #if ENABLE_ATCP + case FN_atcp: + i = handle_atcp_function(opdstr(n), (n>1 ? opdstd(n-1) : NULL)); + return newint(i); + #endif + case FN_fake_recv: i = handle_fake_recv_function(opdstr(n), (n>1 ? opdstd(n-1) : NULL), (n>2 ? opdstd(n-2) : "")); diff -c ./funclist.h ../../tf-50b7.1/src/funclist.h *** ./funclist.h Sun Apr 17 21:15:35 2005 --- ../../tf-50b7.1/src/funclist.h Thu Sep 7 18:08:56 2006 *************** *** 17,22 **** --- 17,25 ---- funccode(ascii, 1, 1, 1), funccode(asin, 1, 1, 1), funccode(atan, 1, 1, 1), + #if ENABLE_ATCP + funccode(atcp, 0, 1, 2), + #endif funccode(char, 1, 1, 1), funccode(columns, 0, 0, 0), funccode(cos, 1, 1, 1), diff -c ./globals.h ../../tf-50b7.1/src/globals.h *** ./globals.h Sun Apr 17 21:15:35 2005 --- ../../tf-50b7.1/src/globals.h Thu Sep 7 02:18:43 2006 *************** *** 153,158 **** --- 153,159 ---- #define TFMAILPATH getstdvar(VAR_TFMAILPATH) #define alert_attr getattrvar(VAR_alert_attr) #define alert_time gettimevar(VAR_alert_time) + #define atcp getintvar(VAR_atcp) #define auto_fg getintvar(VAR_auto_fg) #define background getintvar(VAR_background) #define backslash getintvar(VAR_backslash) diff -c ./hooklist.h ../../tf-50b7.1/src/hooklist.h *** ./hooklist.h Sun Apr 17 21:15:35 2005 --- ../../tf-50b7.1/src/hooklist.h Thu Sep 7 02:27:40 2006 *************** *** 12,17 **** --- 12,20 ---- */ gencode(ACTIVITY, HT_ALERT | HT_XSOCK), + #if ENABLE_ATCP + gencode(ATCP, 0), + #endif gencode(BAMF, HT_WORLD | HT_XSOCK), gencode(BGTEXT, 0), gencode(BGTRIG, HT_ALERT | HT_XSOCK), diff -c ./socket.c ../../tf-50b7.1/src/socket.c *** ./socket.c Sun Apr 17 21:15:36 2005 --- ../../tf-50b7.1/src/socket.c Fri Sep 8 20:17:03 2006 *************** *** 436,441 **** --- 436,443 ---- /* 85 & 86 are not standard. See http://www.randomly.org/projects/MCCP/ */ #define TN_COMPRESS ((char)85) /* MCCP v1 */ #define TN_COMPRESS2 ((char)86) /* MCCP v2 */ + /* 200 is not standard. See http://www.ironrealms.com/rapture/manual/files/FeatATCP-txt.html */ + #define TN_ATCP ((char)200) /* ATCP */ #define UCHAR unsigned char *************** *** 608,613 **** --- 610,616 ---- telnet_label[(UCHAR)TN_CHARSET] = "CHARSET"; telnet_label[(UCHAR)TN_COMPRESS] = "COMPRESS"; telnet_label[(UCHAR)TN_COMPRESS2] = "COMPRESS2"; + telnet_label[(UCHAR)TN_ATCP] = "ATCP"; telnet_label[(UCHAR)TN_EOR] = "EOR"; telnet_label[(UCHAR)TN_SE] = "SE"; telnet_label[(UCHAR)TN_NOP] = "NOP"; *************** *** 2433,2438 **** --- 2436,2454 ---- return result; } + #if ENABLE_ATCP + int handle_atcp_function(conString *string, const char *world) + { + Sock *old_xsock = xsock; + + xsock = (!world || !*world) ? xsock : find_sock(world); + Sprintf(telbuf, "%c%c%c%s%c%c", TN_IAC, TN_SB, TN_ATCP, string->data, TN_IAC, TN_SE); + telnet_send(telbuf); + xsock = old_xsock; + return 1; + } + #endif + int handle_fake_recv_function(conString *string, const char *world, const char *flags) { *************** *** 2804,2809 **** --- 2820,2830 ---- case TN_COMPRESS2: xsock->flags |= SOCKCOMPRESS; break; + #if ENABLE_ATCP + case TN_ATCP: + do_hook(H_ATCP, NULL, "%s", xsock->subbuffer->data + 3); + break; + #endif default: break; } *************** *** 3098,3103 **** --- 3119,3127 ---- (rawchar == TN_COMPRESS && mccp) || (rawchar == TN_COMPRESS2 && mccp) || #endif + #if ENABLE_ATCP + (rawchar == TN_ATCP && atcp) || + #endif rawchar == TN_ECHO || rawchar == TN_SEND_EOR || rawchar == TN_BINARY) /* accept any of these */ diff -c ./socket.h ../../tf-50b7.1/src/socket.h *** ./socket.h Sun Apr 17 21:15:36 2005 --- ../../tf-50b7.1/src/socket.h Thu Sep 7 18:07:37 2006 *************** *** 45,50 **** --- 45,53 ---- extern int local_echo(int flag); extern int handle_send_function(conString *string, const char *world, const char *flags); + #if ENABLE_ATCP + extern int handle_atcp_function(conString *string, const char *world); + #endif extern int handle_fake_recv_function(conString *string, const char *world, const char *flags); extern int is_connected(const char *worldname); diff -c ./tfconfig.h.in ../../tf-50b7.1/src/tfconfig.h.in *** ./tfconfig.h.in Sun Apr 17 21:15:36 2005 --- ../../tf-50b7.1/src/tfconfig.h.in Thu Sep 7 01:57:54 2006 *************** *** 92,97 **** --- 92,98 ---- #define NO_PROCESS 0 #define NO_FLOAT 0 #define NCOLORS 16 + #define ENABLE_ATCP 0 #define HAVE_MCCP (HAVE_ZLIB_H && HAVE_LIBZ) diff -c ./varlist.h ../../tf-50b7.1/src/varlist.h *** ./varlist.h Sun Apr 17 21:15:36 2005 --- ../../tf-50b7.1/src/varlist.h Thu Sep 7 02:20:30 2006 *************** *** 43,48 **** --- 43,53 ---- varstrx(VAR_TZ, "TZ", NULL, ch_timezone) varstr (VAR_alert_attr, "alert_attr", "Br", ch_attr) vartime(VAR_alert_time, "alert_time", 5,0, NULL) + #if ENABLE_ATCP + varflag(VAR_atcp, "atcp", TRUE, NULL) + #else + varenum(VAR_atcp, "atcp", FALSE, NULL, enum_off) + #endif #if 0 varflag(VAR_auto_fg, "auto_fg", FALSE, NULL) #endif