1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

let the past begone in cvs land. welcome to igit igit!

This commit is contained in:
PSYC 2009-01-26 20:21:29 +01:00
commit 4e601cf1c7
509 changed files with 77963 additions and 0 deletions

1
world/net/tn/clear.vt Normal file
View file

@ -0,0 +1 @@


1
world/net/tn/msg-end.vt Normal file
View file

@ -0,0 +1 @@
 8

View file

@ -0,0 +1 @@
7 

96
world/net/tn/server.c Normal file
View file

@ -0,0 +1,96 @@
// $Id: server.c,v 1.17 2007/08/27 16:54:14 lynx Exp $ // vim:syntax=lpc
#include <net.h>
#include <person.h>
#include <server.h>
#define emit binary_message
qScheme() { return "tn"; }
logon() {
// first check limits and authlocal, then show banner
if (::logon()) {
// unless (nick) {
cat(TELNET_PATH "clear.vt");
cat("/local/banner.txt");
// }
// takes a little tweaking to use T() here
emit("Name: ");
}
}
password(a) {
// send IAC + WONT + ECHO to go to echo-mode again
#ifdef OLD_HACKS_WE_PROBABLY_NO_LONGER_NEED
binary_message(({255, 252, 1}));
#endif
emit("\n\n");
return ::password(a);
}
promptForPassword() {
string me;
me = user->vQuery("me");
if (me) emit("\n"+ nick +" "+ me +".\n");
// takes a little tweaking to use T() here
emit("Password: ");
#ifdef OLD_HACKS_WE_PROBABLY_NO_LONGER_NEED
// send IAC + WILL + ECHO to go to noecho-mode
binary_message(({255, 251, 1}));
#endif
// this time we do use the telnet echo off feature
// sowohl in alt und in neu
input_to(#'password, INPUT_IGNORE_BANG + INPUT_NOECHO);
return 1;
}
keepUserObject(user) {
// D(S("tn: %O, %O\n", user, abbrev(TELNET_PATH "user", o2s(user))));
return abbrev(TELNET_PATH "user", o2s(user));
// return user->v("scheme") == "tn";
}
createUser(nick) {
return named_clone(TELNET_PATH "user", nick);
}
hello(ni) {
unless (ni && ni != "") {
// MUD tradition expects you to close on empty username
QUIT
return 1;
}
// we'll filter out proxy scanners (usually coming from IRCNETs to which we
// sent our IRCGATE).
//
// only the PROMUVE will need this, as the freemuve isn't accepting "." and
// ":" in nicknames anyways (PROMUVE converts those to "_").
#ifdef PRO_PATH
# if 0
{ int i1, i2, i3, i4, i5;
if (strstr(ni, "://") > 0 ||
sscanf(ni, "%d.%d.%d.%d:%d", i1, i2, i3, i4, i5) == 5) {
emit("C'mon, you're a proxyscanner, aren't you?\n");
QUIT
}
}
// doesn't catch CONNECTirc·bas·ch·eu or POSThttp___scanner·e TODO
if (strstr(ni, " /") > 3) {
emit("Dumbhead.\n<h1>Don't you have a telnet client?</h1>\n");
QUIT
return 1;
}
# else
if (abbrev("GET ", ni) || abbrev("POST ", ni)
|| abbrev("CONNECT ", ni)) {
// hehe.. we could htredirect proxyscanners to our www port ;)
emit("Dumbhead.\n<h1>Don't you have a telnet client?</h1>\n");
QUIT
return 1;
}
# endif
#endif
return ::hello(ni);
}

16
world/net/tn/sslserver.c Normal file
View file

@ -0,0 +1,16 @@
// $Id: sslserver.c,v 1.4 2006/04/18 13:32:31 fippo Exp $ // vim:syntax=lpc
//
// just a little trick to get TLS telnet to work properly
#include <net.h>
inherit TELNET_PATH "server";
/* do not write anything before handshake is complete!
* TODO: what if handshake fails
* TODO: is this object necessary for modern drivers?
*/
logon() {
tls_init_connection(ME, #'::logon);
}

135
world/net/tn/user.c Normal file
View file

@ -0,0 +1,135 @@
// $Id: user.c,v 1.44 2008/01/05 13:38:10 lynx Exp $ // vim:syntax=lpc
//
// telnet roxx, still ;)
//
#include <net.h>
#include <user.h>
#include <status.h>
input(a, dest) {
next_input_to(#'input);
if (!a || a=="") {
unless (v("clearscreen") == "off") cat(TELNET_PATH "clear.vt");
showStatus(VERBOSITY_STATUS_AUTOMATIC);
} else {
::input(a, dest);
}
prompt();
return 1;
}
logon(failure) {
// bei failure und fippo meint auch bei skurrilen tls zuständen
if (this_interactive()) {
set_prompt("");
cat(TELNET_PATH "clear.vt");
}
vSet("scheme", "tn");
vDel("layout");
vDel("agent");
::logon();
// sTextPath(0, "de", "tn");
next_input_to(#'input);
prompt();
}
prompt() {
// should we want to iconv the prompt,
// then it is a good idea to cache it..
//
// we should get _notice's or signaling every time the
// current place or query change, so we update the prompt.. TODO
#if 0
if (ME && find_call_out(#'quit) == -1)
binary_message("\n"+( v("query") ? v("query")+" ~> " :
( place ? v("place")+" @> " : CHATNAME " <> " )));
#else
if (ME && find_call_out(#'quit) == -1) {
string p = v("query");
if (p)
p = "\n"+ p +" ~> ";
else if (place && stringp(place))
return;
else if (p = v("place"))
p = "\n"+ p +" @> ";
else
p = "\n" CHATNAME " <> ";
binary_message(p);
}
#endif
}
w(string mc, string data, mapping vars, mixed source) {
if (abbrev("_request_attention", mc)) vars["_beep"] = " ";
return ::w(mc, data, vars, source);
}
// inherit output functions per protocol?
protected emit(message) {
#ifdef LETS_NOT_USE_TELL_OBJECT
int l, rc;
#endif
unless (strlen(message)) {
PT(("%O got empty emit call in tn/user\n", ME))
#if DEBUG > 1
tell_object(ME, "**EMPTY**");
raise_error("empty");
#endif
return;
}
# if __EFUN_DEFINED__(convert_charset)
if (v("charset") && v("charset") != SYSTEM_CHARSET) {
// this breaks when it encounters an old log or history which
// is already/still in the target charset thus not utf8. waah!
P3(("telnet»%s: %s\n", v("charset"), message || "(null!?)"))
iconv(message, SYSTEM_CHARSET, v("charset"));
}
# endif
#ifdef LETS_NOT_USE_TELL_OBJECT
// this solution does NOT work when viewing /history with
// prefixes. should we ever want to use this code again,
// we need to do a regreplace from \n to \r\n
message += "\r";
l = strlen(message);
// iso-latin-1 output with amylaar's gd
rc = binary_message(message);
D1( if (rc != l && rc != -1)
D(S("emit: %O of %O returned for %O from %O.\n",
rc, l, MYNICK, v("host"))); )
return rc == l;
#else
tell_object(ME, message);
#endif
}
errorParse(s) {
#ifdef TN_FIX
if (!s || s == "") {
#endif
object o;
exec(o = clone_object(TELNET_PATH "server"), ME);
o->logon();
#ifdef TN_FIX
} else if (s == "fixit") {
next_input_to(#'input);
prompt();
} else {
internalError();
}
#endif
}
internalError() {
emit(">> BROKEN PARSER: This server will not accept anything you send "
"unless you relogin. You can, however, press enter and then relogin "
"without reconnecting.\n"
#ifdef TN_FIX
" Also, you can order me to repair things by sending 'fixit' "
"(without ticks!)\n"
#endif
);
next_input_to(#'errorParse);
}

4
world/net/tn/vthack.c Normal file
View file

@ -0,0 +1,4 @@
main() {
// printf("\033\067\033[H \033[7m ");
printf(" \033[m \033\068");
}