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
place/africa.c Normal file
View file

@ -0,0 +1 @@
#include <place.gen>

12
place/aljazeera.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "AlJazeera"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://english.aljazeera.net/NR/exeres/4D6139CD-6BB5-438A-8F33-96A7F25F40AF.htm?ArticleGuid=55ABE840-AC30-41D2-BDC9-06BBE2A36665"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

52
place/allostack.c Normal file
View file

@ -0,0 +1,52 @@
// stack implementation donated by psyc://psyced.org/~allo
//
#include <net.h>
#define ON_COMMAND if (mycmd(command, args, source)) return 1;
#include <place.gen>
mycmd(a, args, source) {
unless (source) source = previous_object(); // really needed???
string *stack=allocate(0);
if (v("stack")){
stack=v("stack");
}
switch (a){
case "push":
stack=stack + ({ARGS(1)});
vSet("stack", stack);
castmsg(ME, "_notice_public_stack_add", "Eintrag #[_num] hinzugefuegt: "+stack[sizeof(stack)-1], (["_nick": "stack", "_num": sizeof(stack)]));
break;
case "get":
if(sizeof(stack)>0){
if(sizeof(args)==1){
castmsg(ME, "_notice_public_stack", "Eintrag #[_num]: "+stack[sizeof(stack)-1], (["_nick": "stack", "_num": sizeof(stack)]));
}else{
args[1]=to_int(args[1]);
if(sizeof(stack)>=args[1]){
castmsg(ME, "_notice_public_stack", "Eintrag #[_num]: "+stack[(args[1])-1], (["_nick": "stack", "_num": args[1]]));
}
}
}
break;
case "pop":
if(sizeof(args)==1){
if(sizeof(stack)>0){
castmsg(ME, "_notice_public_stack_delete", "Eintrag #[_num] entfernt: "+stack[sizeof(stack)-1], (["_nick": "stack", "_num": sizeof(stack)]));
stack=stack - ({stack[sizeof(stack)-1]});
vSet("stack", stack);
}
}else{
args[1]=to_int(args[1]);
if(sizeof(stack)>=to_int(args[1])){
castmsg(ME, "_notice_public_stack_delete", "Eintrag #[_num] entfernt: "+stack[(args[1])-1], (["_nick": "stack", "_num": args[1]]));
stack=stack - ({stack[args[1]-1]});
vSet("stack", stack);
}
}
default:
return 0;
break;
}
return 1;
}

1
place/america.c Normal file
View file

@ -0,0 +1 @@
#include <place.gen>

1
place/asia.c Normal file
View file

@ -0,0 +1 @@
#include <place.gen>

1
place/australia.c Normal file
View file

@ -0,0 +1 @@
#include <place.gen>

11
place/auto.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Auto"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Auto.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

7
place/babeldos.c Normal file
View file

@ -0,0 +1,7 @@
// vim:syntax=lpc
#define NAME "BabelDoS"
#define TRANSLATION "de_en"
#define TRANSLATION2 "en_de"
#include "babeldos.i"

115
place/babeldos.i Normal file
View file

@ -0,0 +1,115 @@
// vim:noexpandtab:syntax=lpc
// $Id: babeldos.i,v 1.3 2007/10/08 11:00:30 lynx Exp $
/*
* this is one of the most impressive abuses of psyc rooms i've seen
* so far.. have fun with it.. then maybe patch it in a fashion that
* it becomes potentially actually useful. yet another drunken master-
* piece coded by heldensaga and elridion.
*/
#include <input_to.h>
#include <ht/http.h>
#define INHERIT_CONNECT
start();
babel();
#define CRESET start();
inherit "net/connect";
#include <place.gen>
#define emit binary_message
volatile int has_con, is_translating, is_con;
volatile mixed *current;
volatile string krank, buffer;
start() {
qInit(ME, 1000, 100);
unless (has_con || is_con) {
is_con = 1;
call_out(#'connect, 0, "babelfish.altavista.com", 80);
}
}
escape(data) {
return regreplace(data, "[^a-zA-Z0-9]", (: return sprintf("%%%x", $1[0]); :), 1);
}
disconnect() {
has_con = 0;
switch (pointerp(current) ? current[0] : "") {
string k;
case TRANSLATION:
if (sscanf(buffer, "%~s<td bgcolor=white class=s><div style=padding:10px;>%s</div></td>%~s", k)) {
krank = k;
}
#ifdef TRANSLATION2
babel(TRANSLATION2, current[1], current[2], krank, current[4]);
break;
case TRANSLATION2:
if (sscanf(buffer, "%~s<td bgcolor=white class=s><div style=padding:10px;>%s</div></td>%~s", k)) {
krank = k;
}
#endif
::msg(current[1], current[2], replace(krank, "&quot;", "\""), current[4]);
default:
current = 0;
start();
}
}
parse(data) {
buffer += data + " ";
input_to(#'parse, INPUT_IGNORE_BANG);
}
logon(int f) {
is_con = 0;
unless (::logon(f)) {
return;
}
has_con = 1;
input_to(#'parse, INPUT_IGNORE_BANG);
if (qSize(ME)) {
funcall(lambda(({}), ({ #'babel }) + shift(ME) ));
} else {
is_translating = 0;
}
}
translat(source, mc, data, mapping vars, count) {
if (is_translating) {
//debug_message("enqueing: " + data + "\n");
enqueue(ME, ({ TRANSLATION, source, mc, data, vars }));
} else {
//debug_message("babeling: " + data + "\n");
is_translating = 1;
babel(TRANSLATION, source, mc, data, vars);
}
return 1;
}
babel(mode, source, mc, data, mapping vars) {
unless (has_con) {
unshift(ME, ({ mode, source, mc, data, vars }));
start();
return;
}
buffer = "";
krank = 0;
current = ({ mode, source, mc, data, vars });
emit("GET /tr?lp=" + mode + "&urltext=" + escape(data) + " HTTP/1.1\r\n"
"Host: babelfish.altavista.com\r\n\r\n");
}
msg(source, mc, data, mapping vars) {
if (abbrev("_message_public", mc) && data) {
return translat(source, mc, data, vars);
}
return ::msg(source, mc, data, vars);
}

8
place/babelen.c Normal file
View file

@ -0,0 +1,8 @@
#define TRANSLATION "en_de"
#define TRANSLATION2 "de_en"
#ifdef ADMINISTRATORS
# define PLACE_OWNED ADMINISTRATORS
#endif
#include "babeldos.i"

127
place/basic.c Normal file
View file

@ -0,0 +1,127 @@
/* Last Change SNAKE at DM0TUI1S on Fri, 27 Jul 1990 15:32:10 CES */
/* C64 version by CURBOIS Software, Holland.
* Amiga/UNIX/VM version by LYNX, Teldor, 1990.
* PSYC LPC version by symlynX, Berlin, 2003.
*
* $Id: basic.c,v 1.12 2007/08/15 23:58:06 lynx Exp $
*/
sys42336();
sys64738();
sys64764();
#define NAME "BASIC"
#define PLACE_HISTORY_EXPORT
#define ON_ENTER sys64738(source);
#define ON_CONVERSE sys42336(source, mc, data, vars);
#define CREATE sys64764();
#include <place.gen>
static int listflag = 0;
static int chanzcount = 0;
static mapping tab;
static string *chanz;
sys64764() {
tab = ([
"RUN": "RUN, RUN, RUN, DOESN'T ANYONE THINK OF MY LEGS?",
"?": "YOU AND YOUR ABBREVIATIONS...\nIF YOU MEAN 'PRINT' THEN WHY NOT JUST TYPE 'PRINT' ?",
"PRINT": "PRINT? DO YOU THINK I HAVE NOTHING BETTER TO DO\nTHAN TO CATER TO YOUR EVERY WHIM? LEAVE ME ALONE!",
"LOAD": "IF I THOUGHT YOU HAD ANYTHING WORTHWHILE, I WOULD",
"SAVE": "PRESS PLAY AND RECORD ON NEAREST STEREO",
"GOTO": "GO THERE YOURSELF, BUDDY!\nSEE HOW YOU LIKE IT",
"VERIFY": "NO NEED TO START THE TAPE\nI'LL VOUCH FOR IT",
"NEW": "BOY, AM I GLAD YOU GOT RID OF THAT GARBAGE\nWHY DON'T YOU LET ME REST NOW?",
"POKE": "OUCH!!!!! YOU LOOKING FOR A FAT LIP?",
"SYS": "SYS? WHAT SYS?",
"CALL": "YAAAAOOO!!! NO ANSWER",
"OPEN": "HAVE YOU GOT A CORKSCREW?",
"CLOSE": "I THINK I'LL JUST LEAVE IT OPEN, YOU'LL NEED IT LATER",
"DIM": "YEA? WELL YOU'RE NOT SO BRIGHT EITHER",
"CLR": "HMM. WOULD YOU MIND IF I HELP MYSELF TO A GUMMY BEAR?",
"FOR": "? FOR WITHOUT TO ERROR",
"GOSUB": "IF I GOSUB I MIGHT NOT RETURN!!",
"RETURN": "? RETURN WITHOUT NEXT ERROR IN 4404",
"STOP": "BREAK IN 536.5^2",
"INPUT": "YEAH, I'D EAT ANYTHING *HUNGRY*",
"TRON": "SAW THE MOVIE, EH?",
"TROFF": "WILL YOU MAKE THE MOVIE FOR THIS ONE?",
"REST": "I FORGOT HOW TO DO THAT ONE",
"DELETE": "OK, I'LL DELETE THAT GARBAGE AND ALL OTHER...",
"DATA": "23 57 89 23 60 58 30 69 94 76 48 90 47 21 83 23.",
"KILL": "NO, PLEASE DONT DO THAT, IT'S JUST A BABY!",
"LET": "YEAH, LET THERE BE ROCK",
"LLIST": "SEND ME A PRINTER IN AN EMAIL AND I'LL DO IT.",
"PEEK": "KEEP YOUR HANDS OFF, YOU MACHO!",
"END": "EVERYTHING HAS AN END, EXCEPT ME.",
"WHILE": "MEANWHILE I'LL FORMAT THE HARDDISK",
"READ": "I ALREADY ERASED IT, SORRY, I THOUGHT YOU WERE NOT GOING TO NEED IT.",
"REM": "REMARKS ARE NO USE, YOU WON'T UNDERSTAND THE PROGRAM ANYWAY.",
"WAIT": "WHAT DO YOU THINK I'M DOING?? *YAWN*",
"HELP": "NO HUMAN CAN HELP YOU NOW.",
"ERASE": "IS THERE ANYTHING LEFT TO ERASE?"
]);
/* edit erase exit get if lprint merge next
restore troff wait ... help */
chanz = ({
"? PERMISSION DENIED",
"REDO FROM HALFWAY",
"? WIND WITHOUT WELL ERROR",
"? STRING TOO MEANINGLESS ERROR",
"? DEVICE NOT PRESENTABLE ERROR",
"? TOO MANY FINGERS ON KEYBOARD ERROR",
"? ILLEGAL MOTION IN BACKFIELD ERROR",
"I THINK I HEARD A MEMORY CHIP EXPLODE!",
"I'M WRITING ON YOUR DISK !!!",
"? UNDEFINED PARACHUTE ERROR",
"? STRANGE OUT OF RANGE ERROR",
"SIT BACK A WAYS, YOU'LL RUIN YOUR EYES"
});
}
#define puts(string) castmsg(ME, "_notice_application_basic", string, ([]))
#define tell(user,string) sendmsg(user,"_notice_application_basic",string,([]))
sys64738(source) {
tell(source, "**** CBM BASIC V2 ****");
tell(source, "49152 BASIC BYTES FREE");
tell(source, "READY.");
}
sys42336(source, mc, data, mapping vars) {
string t;
if (stringp(data)) {
sscanf(data, "%s %s", data, t);
data = upper_case(data);
if (tab[data]) puts(tab[data]);
else if (data == "LIST") {
listflag = !listflag;
if (listflag) {
puts ("DIDN'T YOU WRITE IT DOWN SOMEWHERE?");
puts ("YOU KNOW HOW UNRELIABLE COMPUTERS CAN BE");
puts ("MAYBE TRY AGAIN");
} else {
puts ("10 DIMA(-5):FRY=1TO10:NEXTWEEK:POKE99,OUCH!:WAITFORIT:OPENFILEORRASP");
puts ("20 IF 1 HEN CAN LAY 3 EGGS IN ONE DAY");
puts ("30 HOW LONG WOULD IT TAKE A ROOSTER TO");
puts ("40 LAY A GOLDEN DOORKNOB?");
puts ("41.5 IFPEEKABOO(53280)=EGG THEN HALT AND CATCH FIRE");
puts ("50 END OF THE BEGINNING");
}
} else if (data == "DIR") {
puts("DIRECTORY OF BERLIN, IOWA:");
puts(" HELLO.BAS GOTOSLEEP.BAS");
puts(" WHOLEPILACRAP.BAS IRC.BAS");
puts("8734123445782 BYTES OF PIZZA IN 4 BOXES.");
} else if (random(4) < 1) {
if (!chanzcount) chanzcount = sizeof(chanz);
puts (chanz[--chanzcount]);
}
else return;
puts ("READY.");
}
}

12
place/bbc.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "BBC"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/bbcvideo.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "BBCvideo"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://newsrss.bbc.co.uk/rss/newsplayer_uk_edition/front_page/rss.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

14
place/bbcworld.c Normal file
View file

@ -0,0 +1,14 @@
#include <net.h>
// unfortunately http://www.bbcworld.com/Pages/News.aspx?feedName=world
// doesn't exist as feed, so this is really BBC UK's world feed.
#define NAME "BBCworld"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://newsrss.bbc.co.uk/rss/newsplayer_uk_edition/world/rss.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

2
place/berlin.c Normal file
View file

@ -0,0 +1,2 @@
#define PLACE_HISTORY_EXPORT
#include <place.gen>

200
place/blackjack.c Normal file
View file

@ -0,0 +1,200 @@
#include <net.h>
/* a room that plays 17+4
*
* output messages are not multilingual/textdb compliant. :(
* they are also all missing trailing periods.. ;)
*/
#define ON_COMMAND if (mycmd(command, args, source)) return 1;
#define NAME "BLACKJACK"
#include <place.gen>
#define DECK_SIZE 52
#define GAME_RUNNING sizeof(players)
volatile array(int) deck;
volatile int deck_top; // oberste karte
volatile array(mixed) cards;
volatile array(int) deny;
volatile array(object) players;
volatile int currentplayer;
volatile mapping colormap = ([ 0 : "Herz", 1 : "Karo", 2: "Pik", 3: "Kreuz" ]);
volatile mapping facemap = ([0:"As", 1:"2", 2:"3", 3:"4", 4:"5", 5:"6", 6:"7", 7:"8", 8:"9", 9:"10", 10:"Bube", 11:"Dame", 12:"Koenig" ]);
volatile mapping valuemap = ([0:11, 1:2, 2:3, 3:4, 4:5, 5:6, 6:7, 7:8, 8:9, 9:10, 10:10, 11:10, 12:10 ]);
#define card_name(i) colormap[i / 13] + " " + facemap[i % 13]
#define card_value(i) valuemap[i % 13]
#define PLAYER(o) (objectp(o) ? o->qName() : o)
void shuffle() {
deck = allocate(DECK_SIZE);
for (int i = 0; i < DECK_SIZE; i++)
deck[i] = i;
for (int i=0; i<DECK_SIZE-1; i++) {
int r = i + random(DECK_SIZE-i);
{ // swap
int t = deck[i];
deck[i] = deck[r];
deck[r] = t;
}
}
deck_top = 0;
}
int calculate_value() {
int sum = 0;
for (int i = 0; i < sizeof(cards[currentplayer]); i++)
sum += card_value(cards[currentplayer][i]);
return sum;
}
int next_player() {
for (int next = (currentplayer+1) % sizeof(players);
next != currentplayer;
next = (next + 1) % sizeof(players))
if (!deny[next])
return next;
if (!deny[currentplayer])
return currentplayer;
return -1;
}
end_game() {
int winner_sum = 0;
int winner = -1;
int draw = 0;
// evaluate statistics for each player
for (currentplayer = 0; currentplayer < sizeof(players); currentplayer++) {
int val = calculate_value();
if (val > 21)
continue;
if (val > winner_sum) {
winner_sum = val;
winner = currentplayer;
draw = 0;
} else if (val == winner_sum) {
if (sizeof(cards[currentplayer]) < sizeof(cards[winner])) {
winner = currentplayer;
} else if (sizeof(cards[currentplayer]) == sizeof(cards[winner])) {
draw = 1;
}
}
}
if (winner == -1 || draw) {
castmsg(ME, "_notice_place_game_end_draw", "Game over. It's a draw.", ([ ]));
} else {
castmsg(ME, "_notice_place_game_end",
"Game over. " + PLAYER(players[winner]) + " gewinnt mit " + winner_sum + " Punkten.",
([ ]));
}
// reset globals
currentplayer = 0;
players = ({ });
}
// deals a card (and shows everyone (public_card=1) or just the player
void deal_card(int public_card) {
int current_card = deck[deck_top];
deck_top++;
cards[currentplayer] += ({ current_card });
if (public_card) {
castmsg(ME, "_notice_place_game_card",
PLAYER(players[currentplayer]) + " zieht " + card_name(current_card)+". " + calculate_value() + " Punkte.",
([ ]));
} else {
sendmsg(players[currentplayer], "_notice_place_game_card",
"Du ziehst " + card_name(current_card) + ". " + calculate_value() + " Punkte.",
([ "_nick_place" : MYNICK ]));
}
if (current_card == DECK_SIZE) {
end_game();
}
}
start_game() {
shuffle();
players = m_indices(_u);
deny = allocate(sizeof(players), 0);
cards = allocate(sizeof(players), ({ }));
castmsg(ME, "_notice_place_game_start", "Das Spiel beginnt.", ([ ]));
// two rounds for everyone, first one public
for (currentplayer = 0; currentplayer < sizeof(players); currentplayer++) {
deal_card(1);
}
for (currentplayer = 0; currentplayer < sizeof(players); currentplayer++) {
deal_card(0);
}
// no one can lose currently
currentplayer = 0;
castmsg(ME, "_notice_place_game_player_next", PLAYER(players[currentplayer]) + " ist am Zug", ([ ]));
}
take_card(object theplayer) {
if (theplayer == players[currentplayer]) {
deal_card(0);
if (calculate_value() > 21) { // verloren
// potentiell offenlegen
castmsg(ME, "_notice_place_game_player_lose",
PLAYER(players[currentplayer]) + " verliert mit mehr als 21 Punkten", ([ ]));
deny[currentplayer] = 1;
}
if (players) {
currentplayer = next_player();
if (currentplayer != -1)
castmsg(ME, "_notice_place_game_player_next", PLAYER(players[currentplayer]) + " ist am Zug", ([ ]));
else
end_game();
}
return 1;
} else {
P0(("%O ist nicht dran, %O ist am zug\n", theplayer, players[currentplayer]))
// FIXME: du bist nicht dran
}
}
deny_card(object theplayer) {
if (theplayer == players[currentplayer]) {
deny[currentplayer] = 1;
castmsg(ME, "_notice_place_game_deny", PLAYER(players[currentplayer]) + " zieht keine Karte.", ([ ]));
currentplayer = next_player();
if (currentplayer != -1)
castmsg(ME, "_notice_place_game_player_next", PLAYER(players[currentplayer]) + " ist am Zug", ([ ]));
else
end_game();
} else {
// hm... not taking a card may be decided in advance?
}
}
mycmd(a, args, source) {
switch (a) {
case "start":
if (GAME_RUNNING) {
// FIXME: game is running, error
start_game();
} else {
start_game();
}
return 1;
case "take":
if (GAME_RUNNING) {
take_card(source);
} else {
P0(("take card went wrong, no game is running\n"))
// FIXME: no game running
}
return 1;
case "deny":
if (GAME_RUNNING) {
deny_card(source);
} else {
P0(("deny card went wrong, no game is running\n"))
// FIXME: no gaming running
}
return 1;
}
}

19
place/blog.c Normal file
View file

@ -0,0 +1,19 @@
// experimental: example of a blog type room
// which probably needs some work to get running
//
#include <net.h>
#define NAME "blog"
#define THREADS
#define HISTORY_GLIMPSE 12
#ifdef ADMINISTRATORS
// psyconf puts ADMINISTRATORS into psyconf.h
# define PLACE_OWNED ADMINISTRATORS
#else
// example set-up
# define PLACE_OWNED "fippo", "lynx", "bartman"
#endif
#define UNIFORM_STYLE "http://www.your-community.de/fippo/blog.css"
#include <place.gen>

11
place/brennpunkte.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Brennpunkte"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Brennpunkte.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

16
place/buper.c Normal file
View file

@ -0,0 +1,16 @@
#define NAME "Buper"
#include <place.gen>
/* fun room */
msg(source, mc, data, mapping vars) {
string a;
if (stringp(data)) {
// does this need special treatment now that system
// charset is utf8 ? iconv before and after ? lol.
data = regreplace(data, "(^| )([aeiouüöäAEIOUÜÖÄ])", "\\1b\\2", 1);
data = regreplace(data, "\\<[a-zA-Z]", "b", 1);
}
return ::msg(source, mc, data, vars);
}

29
place/cnet.c Normal file
View file

@ -0,0 +1,29 @@
#include <net.h>
#define NAME "CNET"
#define SILENCE
/* this is an example for an RSS-based newsfeed room for PSYC
* just copy it and enter your favourite RSS URL. you can also
* specify a RESET_INTERVAL in minutes. please don't run your
* own news gateway if one already exists - PSYC packets are
* much much more efficient than polling RSS files, therefore
* if you like getting cnet news, simply /subscribe or /enrol
* to psyc://psyced.org/@cnet (until cnet catch the
* drift and provide such a PSYC news service themselves ;))
* see also http://rss.news.com/
*
* by the way, RSS is not the only newsfeed interface to PSYC -
* in the perlpsyc distribution is an email filter script which
* parses dpa news coming by email and creates PSYC notices out
* of it. the best idea would obviously be if publishing tools
* learned how to notify changes directly to a PSYC newsroom.
* it's really simple.. just connect and dump a few lines!
*/
#ifdef BRAIN
# define NEWSFEED_RSS "http://news.com.com/2547-1_3-0-5.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/cnn.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "CNN"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://rss.cnn.com/rss/cnn_topstories.rss"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/cnnvideo.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "CNNvideo"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://rss.cnn.com/rss/cnn_freevideo.rss"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/computertechnik.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define SILENCE
#define NAME "ComputerTechnik"
#ifdef BRAIN
// # define NEWSFEED_RSS "http://www.stern.de/standard/rss.php?channel=computer-technik"
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/HighTech.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/cryptochat.c Normal file
View file

@ -0,0 +1,12 @@
// this room lets people in who are either connected via a SSL/TLS
// protocol or are coming from the localhost (probably SSH users).
//
// both cases are no absolute guarantee for safety.. it is still
// in the hands of each user in the room to safeguard true secrecy
//
// -lynX 2004
#define NAME "CryptoChat"
#define SECURE
#include <place.gen>

13
place/deutschewelle.c Normal file
View file

@ -0,0 +1,13 @@
#include <net.h>
#define SILENCE
#define NAME "deutschewelle"
#ifdef BRAIN
# define NEWSFEED_RSS "http://rss.dw-world.de/rdf/rss-en-all"
# define RESET_INTERVAL 40 // minutes
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/diezeit.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "DieZeit"
#ifdef BRAIN
# define NEWSFEED_RSS "http://newsfeed.zeit.de/index"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/digdl.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "DigDL"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://blogs.forbes.com/digitaldownload/index.rdf"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/economist.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "Economist"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.economist.com/rss/news_analysis_and_views_rss.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/economistaudio.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "EconomistAudio"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://feeds.newyorker.com/services/rss/feeds/online.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

View file

@ -0,0 +1,16 @@
#define NAME "ElridionsHanfGarten"
#define PLACE_HISTORY
#define HISTORY_GLIMPSE 8
#include <place.gen>
msg(source, mc, data, mapping vars) {
string a;
a = ::msg(source, mc, data, vars);
if (stringp(data)) {
if (strstr(lower_case(data), "marihuana") != -1) {
castmsg(ME, "_notice_kidding_CSU", "Halt - CSU! Hat hier jemand Marihuana gesagt?", ([ ]));
}
}
return a;
}

11
place/enwiki.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "enWiki"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://feeds.feedburner.com/WikinewsLatestNews"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/enwikiaudio.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "enWikiAudio"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://feeds.feedburner.com/AudioWikinewsNewsBriefs"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/enwikirecent.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "enWikiRecent"
#ifdef BRAIN
// irc://irc.wikimedia.org/en.wikinews
# define CONNECT_IRC "irc.wikimedia.org"
# define CHAT_CHANNEL "en.wikinews"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/erotik.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Erotik"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Erotik.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/euronews-de.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "EuroNews-DE"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.euronews.net/rss/euronews_ge.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/euronews-en.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "EuroNews-EN"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.euronews.net/rss/euronews_en.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/euronews-es.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "EuroNews-ES"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.euronews.net/rss/euronews_sp.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/euronews-fr.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "EuroNews-FR"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.euronews.net/rss/euronews_fr.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/euronews-it.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "EuroNews-IT"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.euronews.net/rss/euronews_it.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/euronews-pt.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "EuroNews-PT"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.euronews.net/rss/euronews_po.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/euronews-ru.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "EuroNews-RU"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.euronews.net/rss/euronews_ru.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

1
place/europa.c Normal file
View file

@ -0,0 +1 @@
#include <place.gen>

13
place/faz.c Normal file
View file

@ -0,0 +1,13 @@
#define NAME "FAZ"
#define SILENCE
#include <net.h>
/*
#ifdef BRAIN
# define NEWSFEED_RSS "http://bootleg-rss.g-blog.net/faz_net.php?ressort=politik"
#else
# define CONNECT_DEFAULT
#endif
*/
#include <place.gen>

11
place/fm4.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "FM4"
#ifdef BRAIN
# define NEWSFEED_RSS "http://rss.orf.at/fm4.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/forbes.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "Forbes"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.forbes.com/feeds/mostemailed.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/forbesvideo.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "ForbesVideo"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.forbes.com/video/index.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

24
place/freenode.c Normal file
View file

@ -0,0 +1,24 @@
#include <net.h>
#define NAME "freeNode"
//
// «freenode:TomSawyer» TomSawyer sagt Dir: you're able to talk to me, not because I'm an admin, but because I have /msg nickserv set unfiltered on
// «freenode:TomSawyer» TomSawyer sagt Dir: once you register, /msg nickserv set unfiltered on
// «freenode:TomSawyer» TomSawyer sagt Dir: that will ensure you are able to get messages from unregistered users
//
// ok weiss bescheid, aber ist eh netter wenn man unseren gate nur als
// registrierter user benutzen kann.. basst scho.. jdf gut zu wissen
//
#ifdef BRAIN
# echo BRAIN: connecting to freenode IRC server
# define CONNECT_IRC "irc." NAME ".net"
//# define CHAT_CHANNEL "esp"
//# define CHAT_CHANNEL "23c3"
# define PASS_IRC IRCGATE_FREENODE
#else
# echo SLAVE: connecting to psyced.org for freenode gateway
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/freizeit.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Freizeit"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Freizeit.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/futurezone.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "futureZone"
#ifdef BRAIN
# define NEWSFEED_RSS "http://rss.orf.at/futurezone.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/gesundheit.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Gesundheit"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Gesundheit.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/golem.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "Golem"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.golem.de/golem_backend.rdf"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/guardian.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Guardian"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.guardian.co.uk/rss"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

38
place/heise.c Normal file
View file

@ -0,0 +1,38 @@
#include <net.h>
#define SILENCE
#define NAME "Heise"
/* this is an example for a RSS-based newsfeed room for PSYC
* just copy it and enter your favourite RSS URL. you can also
* specify a RESET_INTERVAL in minutes. please don't run your
* own news gateway if one already exists - PSYC packets are
* much much more efficient than polling RSS files, therefore
* if you like getting heise news, simply /subscribe or /enrol
* to psyc://psyced.org/@heise (until heise catch the
* drift and provide such a PSYC news service themselves ;))
*
* by the way, RSS is not the only newsfeed interface to PSYC -
* in the perlpsyc distribution is an email filter script which
* parses dpa news coming by email and creates PSYC notices out
* of it. the best idea would obviously be if publishing tools
* learned how to notify changes directly to a PSYC newsroom.
* it's really simple.. just connect and dump a few lines!
*/
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.heise.de/newsticker/heise.rdf"
# define RESET_INTERVAL 3 // heise is very popular and lively
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>
#ifdef BRAIN
publish(link, headline, channel) {
if (strstr(link, "/from/rss", -12) != -1)
link = link[0 .. <12];
return ::publish(link, headline, channel);
}
#endif

41
place/helpdesk.c Normal file
View file

@ -0,0 +1,41 @@
#define NAME "HelpDesk"
#define PLACE_HISTORY_EXPORT
#define HISTORY_GLIMPSE 0
// HelpDesk currently disabled.. all questions are about PSYC anyway
#define REDIRECT "psyc://psyced.org/@welcome"
#include <place.gen>
#if 0
static mapping adms;
enter(a) {
unless (mappingp(adms))
adms = ([ ]);
if (boss(a))
adms += ([ a ]);
if (sizeof(adms))
sendmsg(a, "_status_available_help", "Stell deine Frage! Sie wird bald beantwortet werden.", ([ "_helpav" : 1 ]));
else
#ifdef WEBMASTER_EMAIL
sendmsg(a, "_failure_unavailable_help",
"Zur Zeit ist leider niemand online, der dir helfen kann. "
"Bitte mail deine Frage / dein Problem an [_email_support]!",
([
"_helpav" : 0,
"_email_support" : WEBMASTER_EMAIL
]));
#endif
return ::enter(a);
}
leave(a) {
if(boss(a))
adms -= ([ a ]);
return ::leave(a);
}
#endif

12
place/heute.c Normal file
View file

@ -0,0 +1,12 @@
#define NAME "heute"
#define SILENCE
#include <net.h>
#ifdef BRAIN
//# define NEWSFEED_RSS "http://bootleg-rss.g-blog.net/heute_t-online_de.php"
# define NEWSFEED_RSS "http://www.heute.de/ZDFheute/inhalt/rss/20/0,6704,20,00.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

20
place/indigestion.c Normal file
View file

@ -0,0 +1,20 @@
#include <place.gen>
msg(source, mc, data, mapping vars) {
int rc = ::msg(source, mc, data, vars);
if (abbrev("_message", mc) && stringp(data)) {
#if __EFUN_DEFINED__(crypt)
castmsg(ME, "_notice_digest_crypt",
"\tcrypt: [_text_crypt]", ([ "_text_crypt" : md5(data) ]) );
#endif
#if __EFUN_DEFINED__(md5)
castmsg(ME, "_notice_digest_md5",
"\t MD5: [_text_md5]", ([ "_text_md5" : md5(data) ]) );
#endif
#if __EFUN_DEFINED__(sha1)
castmsg(ME, "_notice_digest_sha1",
"\t SHA1: [_text_sha1]", ([ "_text_sha1" : sha1(data) ]) );
#endif
}
return rc;
}

11
place/inland.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Inland"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Inlandspolitik.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

33
place/irc.c Normal file
View file

@ -0,0 +1,33 @@
#include <net.h>
#define NAME "IRC"
// gatebot to ircnet
//
// just put this file into init.ls if you want it to
// activate at boot time. addressing irc:nickname
// should work also when this isn't loaded however.
//
//#define CONNECT_IRC "irc.freenet.de" // an ircnet server
//#define CONNECT_IRC "us.ircnet.org"
#define CONNECT_IRC "irc1.us.ircnet.net"
//
// other example configuration
//
//#define CONNECT_IRC "test.example.org", 6777
//#define CHAT_CHANNEL "PSYC" // enter #PSYC
//#define PASS_IRC "wooboowaha" // server password
//#define IRC_HIDE
//
// Some networks have unusual policies, thus sometimes hacks were
// necessary, like so:
//
//#define ON_CONNECT emit("PRIVMSG NickServ :IDENTIFY " PASSWORD "\n");
//#define ON_CONNECT call_out("emit", 9, "JOIN :#" CHAT_CHANNEL "\n");
#include <place.gen>
// See also http://about.psyc.eu/gateway
//
// To change the nickname of the gatebot you need to #define IRCGATE_NICK
// in your local.h, not here. It applies to all gatebots on this server.

18
place/irc.c-fly Normal file
View file

@ -0,0 +1,18 @@
#include <net.h>
#define NAME "IRC"
// gateway to ircnet
//
// just put this file into init.ls if you want it to
// activate at boot time. addressing irc:nickname
// should work also when this isn't loaded however.
//
#ifdef fly
# define CONNECT_IRC "irc.freenet.de" // an ircnet server
#else
# define CONNECT "beta.ve.symlynX.com"
#endif
#include <place.gen>

70
place/ircgate.c Normal file
View file

@ -0,0 +1,70 @@
// example configuration for a server-level gateway to an ircnet
// called "ircgate" running on localhost.
//
// this is not a C file. this is a room definition for psyced.
// it belongs into psyced's "place" directory.
//
// to make this work you need to add the following to local.h:
//
// #define RELAY "ircgate"
//
// do not use in existing psyced communities in the current set up
// as currently all incoming traffic is presumed to be meant for the
// ircnet. a future version of this ircgate will let psyc users and
// ircnet users coexist peacefully on a single psyced installation.
//
// configuring the ircgate into an ircd. add the following two lines:
//
// C:127.0.0.1:pw:PSYC.EU::51
// N:127.0.0.1:pw:PSYC.EU::51
//
// yes, the server name is "PSYC.EU" here, but you can define what it
// should be further below. syntax details may vary for your ircd
// implementation, but if somebody took the time to patch your ircd flavor,
// (s)he probably also published syntax details on how to configure it.
// of course pick a better password than 'pw'
//
// TESTING: start up psyced, wait until it has linked with the ircnet
// then from the ircnet issue
//
// /m <uniform> hello
//
// the uniform can be anything psyced can handle, most notably psyc:
// and xmpp: urls
#include <net.h>
// pasword belongs into an unreadable config file like admins.h
#define IRCGATE_NAME "PSYC.EU"
#define IRCGATE_LOCAL "pw"
#define NAME "IRCgate"
#define ON_CONNECT login();
#define CONNECT_IRC "localhost", 7000
#define EMULATE_SERVER // don't be a bot
#include <place.gen>
login() {
PT(("ircgate serving into "+query_ip_number()+"\n"))
// login procedure may vary with different flavors of ircd,
// that's why we keep it entirely here
emit("PASS "+ IRCGATE_LOCAL +" TS\r\n"
"SERVER " IRCGATE_NAME " 1 " SERVER_VERSION
" :psyced.org http://about.psyc.eu/gateway\r\n"
"LUSERS\r\n");
// myself as pseudo subserver? needs extra hub config on ircd.
// "SERVER " SERVER_HOST " 2 " SERVER_VERSION
// " :psyced.org http://about.psyc.eu/gateway\r\n"
}
// testing:
#if 0
PASS pw TS
SERVER x.x 1 telnet/44.04 :telnet
PONG :base.psyc.eu
NICK JACK 1 1163580418 +i lynx 127.0.0.1 127.0.0.1 x.x :Get psyced.
:JACK PRIVMSG psyc://beta.ve.symlynx.com/~lynx :test
#endif

27
place/kernel.c Normal file
View file

@ -0,0 +1,27 @@
#include <net.h>
#define SILENCE
#define NAME "kernel"
/* this is an example for a RSS-based newsfeed room for PSYC
* just copy it and enter your favourite RSS URL. you can also
* specify a RESET_INTERVAL in minutes. please don't run your
* own news gateway if one already exists - PSYC packets are
* much much more efficient than polling RSS files, therefore
* if you like getting heise news, simply /subscribe or /enrol
* to psyc://psyced.org/@heise (until heise catch the
* drift and provide such a PSYC news service themselves ;))
*
* by the way, RSS is not the only newsfeed interface to PSYC -
* in the perlpsyc distribution is an email filter script which
* parses dpa news coming by email and creates PSYC notices out
* of it. the best idea would obviously be if publishing tools
* learned how to notify changes directly to a PSYC newsroom.
* it's really simple.. just connect and dump a few lines!
*/
#ifdef BRAIN
# define NEWSFEED_RSS "http://kernel.org/kdist/rss.xml"
# define RESET_INTERVAL 6 * 60 // anyone need this to be fast?
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/kultur.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Kultur"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Kultur.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/kurioses.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Kurioses"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Kurioses.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/larepubblica.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "laRepubblica"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.repubblica.it/rss/homepage/rss2.0.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/larepubblicaaudio.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "laRepubblicaAudio"
#ifdef BRAIN
# define NEWSFEED_RSS "http://tv.repubblica.it/xml/podcast.php"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/larepubblicavideo.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "laRepubblicaVideo"
#ifdef BRAIN
# define NEWSFEED_RSS "http://tv.repubblica.it/xml/videopodcast.php"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/lebenskunst.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Lebenskunst" // necessary for places that connect
#define SILENCE
#ifdef BRAIN
// # define NEWSFEED_RSS "http://www.stern.de/standard/rss.php?channel=lifestyle"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

1
place/london.c Normal file
View file

@ -0,0 +1 @@
#include <place.gen>

137
place/maxlink.c Normal file
View file

@ -0,0 +1,137 @@
// dieser raum implementiert eine kommunikation mit dem netzwerkport der
// MAX software.. ein kultiges ding mit dem man graphisch objektorientiert
// midi, audio, video zusammenstöpseln und generieren kann. also nicht zu
// verwechseln mit der raytracing software "3d studio max." kiritan, der VJ
// der euRoClAsh.com parties, gedenkt chatmaterial als input für seine
// visuals zu verwenden. dies ist der nötige code dazu.
//
// heldensaga hat sich entschlossen diesen code ganz ausführlich zu
// kommentieren, weswegen er generell als leitfaden gelten kann wie man
// gateway-räume zu verrückten zwecken erzeugen kann (siehe aber auch
// gatebot.c für befehlsgewalt in gateways sowie die net/protokoll
// verzeichnisse für richtig integrierte implementationen von protokollen).
//
// net.h beliefert uns mit allem möglichen zeugs, unter anderem mit unless
// und NET_PATH. es ist die grundvoraussetzung, damit LPC was von PSYC weiß.
#include <net.h>
// wir müssen start() als prototyp definieren, weil wir es (im place.gen)
// benutzen, bevor wir es definiert haben
start();
// hier bitten wir darum, dass start() aufgerufen wird, wenn der raum geladen
// wird
#define CREATE start(1);
// NET_PATH "connect" beliefert uns mit der fähigkeit, (tcp)verbindungen zu
// öffnen
inherit NET_PATH "connect";
// place.gen beliefert uns mit den unteren ebenen des raums, die unter anderem
// die nachricht an alle anwesenden user verteilen und joins/leaves handhaben
#include <place.gen>
// wir brauchen noch INPUT_IGNORE_BANG, das is so ne LPC-eigenheit
#include <input_to.h>
// hier sagen wir, wohin wir verbinden wollen
#define TO_HOST "example.org"
#define TO_PORT 4444
// emit als alias für binary_message, binary_message sendet an unsere
// verbindung (zu max/scp)
#define emit binary_message
// has_con ist 1 wenn wir eine verbindung haben, is_con ist 1, wenn wir uns
// gerade verbinden
volatile int has_con, is_con;
// im prinzip sind beide variablen nicht notwendig, weil sie folgenden
// bytecodes entsprechen:
// has_con == interactive()
// is_con == find_call_out(#'connect)
// und in LPC sind bytecodes ja schneller & effizienter als variablen ;)
// blödsinn. is_con ist solange true bis die verbindung established _ist_.
// find_call_out(#'connect) != -1 ist solange true bis wir versuchen zu
// verbinden. um die zeit in der schwebe abzudecken, brauchen wir also is_con.
// diese funktion wird aufgerufen, wenn der raum geladen wird
// sowie jedes mal wenn jemand etwas tippt und wir nicht verbunden sind
start(when) {
// wenn wir uns grade im verbindungsaufbau befinden oder schon eine
// verbindung haben, wäre ein neuer verbindungsaufbau reichlich sinnlos
unless (has_con || is_con) {
is_con = 1;
// im prinzip das gleiche wie connect(TO_HOST, TO_PORT). allerdings
// wird der aktuelle event-loop (die befehlskette) unterbrochen.
// eigentlich brauchen wir die unterbrechung hier nicht, aber schaden
// tuts auch nicht. connect() wird also erst ausgeführt wenn die
// dinge, die uns hierhergeführt haben (vermutlich ein user der diesen
// raum als erster betreten hat), abgearbeitet sind.
call_out(#'connect, when, TO_HOST, TO_PORT);
}
}
// wenn die gegenseite uns was schickt, kommt es hier an..
// wir schicken das einfach als debugmeldung auf die console
// und sichern ab, dass die nächste zeile auch wieder hier ankommen wird
// man könnte hier natürlich auch psyc-nachrichten erzeugen..
input(t) {
P1(("%O got %O\n", ME, t))
input_to(#'input, INPUT_IGNORE_BANG);
}
// diese funktion wird aufgerufen, wenn die verbindung zustande gekommen ist
// oder nicht aufgebaut werden konnte
logon (f) {
is_con = 0;
// wenn ::logon(f) (logon() aus einer unteren ebene, NET_PATH "connect")
// nicht wahr ist, konnte die verbindung nicht hergestellt werden
unless (::logon(f)) {
return;
}
// wir haben eine verbindung
has_con = 1;
// alle eingaben aus dieser verbindung nach input() schicken
input_to(#'input, INPUT_IGNORE_BANG);
}
// msg() wird aufgerufen, wenn jemand eine nachricht an den raum sendet
msg(source, mc, data, mapping vars) {
if (abbrev("_message", mc)) {
// wenn wir eine verbindung haben
if (has_con) {
// und text (data) mitgesendet wurde (und data ein string ist)
if (stringp(data)) {
string sendout;
// werfen wir sonderzeichen heraus oder wandeln sie um
sendout = replace(data, ";", ":");
sendout = replace(sendout, ",", "");
sendout = replace(sendout, "\\", "");
sendout = replace(sendout, "ä", "ae"); // is das noch
sendout = replace(sendout, "ö", "oe"); // aktuell mit utf8 !?
sendout = replace(sendout, "ü", "ue");
sendout = replace(sendout, "ß", "ss");
sendout = replace(sendout, "Ä", "Ae");
sendout = replace(sendout, "Ö", "Oe");
sendout = replace(sendout, "Ü", "Ue");
// und senden die nachricht an max/scp
emit("<" + vars["_nick"] + "> " + sendout + ";\n");
}
// wenn nicht (keine verbindung), versuchen wir, eine aufzubauen
} else {
// versuche in 48 sekunden erst wieder, sonst könnte das weh tun
start(48);
}
}
// wir leiten die nachricht an die unteren ebenen des raumes weiter, die
// sie an alle anwesenden user verteilen etc etc
return ::msg(source, mc, data, vars);
}
// disconnect() wird aufgerufen, wenn die verbindung abbricht
disconnect() {
has_con = 0;
// wir versuchen die verbindung wieder aufzubauen
//start(4);
// nö wir warten ob jemand was tippt, also die verbindung haben will
}

11
place/membersonly.c Normal file
View file

@ -0,0 +1,11 @@
/* owned room which is accessible by members only
* the members are managed as aides of the room */
#define PLACE_OWNED ADMINISTRATORS
// TODO: could use a simplification...
#ifdef PLACE_OWNED
#define REQUEST_ENTER return objectp(source) && qOwner(source -> qName()) || qAide(source);
#endif
#include <place.gen>

13
place/minusvisionen.c Normal file
View file

@ -0,0 +1,13 @@
#include <net.h>
#define SILENCE
#define NAME "minusvisionen"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.minusvisionen.de/rss.xml"
# define RESET_INTERVAL 17 * 60 // many hours
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/mondediplo.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "MondeDiplo"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.monde-diplomatique.fr/recents.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

46
place/monitor.c Normal file
View file

@ -0,0 +1,46 @@
#define ALLOW_EXTERNAL
#define SILENT
#define PRIVATE
// if you don't want your users to be able to enter this and
// receive monitor reports, you have to restrict entry here
#include <net.h>
#ifndef ADMINISTRATORS
# ifdef CONFIG_PATH
# include CONFIG_PATH "admins.h"
# endif
#endif
#ifdef ADMINISTRATORS
# define PLACE_OWNED ADMINISTRATORS
# define RESTRICTED
#else
# echo Warning: Monitor room is not restricted.
#endif
#if 0
#define ON_ANY \
D(S("monitor catch: %O got %O from %O\n", ME, mc, source)); \
if (abbrev("_error", mc) || abbrev("_failure", mc) \
|| abbrev("_warning", mc)) { \
D(S("monitor1: %O got %O from %O\n", ME, mc, source)); \
return 0; \
}
#endif
#include <place.gen>
error(source, mc, data, vars) {
//D("monitor error handling 2 got called\n");
unless (source == ME) castmsg(source, mc, data, vars);
//return ::error(source, mc, data, vars);
}
cmd(a, args, b, source) {
if (b && a == "report") {
monitor_report("_warning_monitor_report_test",
S("%O is testing monitor_report: %O",
source || previous_object(), args));
return 1;
}
return ::cmd(a, args, b, source);
}

11
place/n-tv.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "n-tv"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.n-tv.de/23.rss"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/n24.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "N24"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.n24.de/rss/?rubrik=home"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/nature.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.nature.com/news/rss.rdf"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/naturepod.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "NaturePod"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.nature.com/nature/podcast/rss/nature.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

2
place/newyork.c Normal file
View file

@ -0,0 +1,2 @@
#define NAME "NewYork"
#include <place.gen>

12
place/newyorker.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "NewYorker"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://feeds.newyorker.com/services/rss/feeds/online.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/nme.c Normal file
View file

@ -0,0 +1,12 @@
#define NAME "NME"
#define SILENCE
#include <net.h>
#ifdef BRAIN
//# define NEWSFEED_RSS "http://bootleg-rss.g-blog.net/nme_com_news.php"
# define NEWSFEED_RSS "http://feeds.feedburner.com/FeedPalooza/NME"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/nyobserver.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "NYObserver"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.observer.com/index.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/oesterreich.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "Oesterreich"
#ifdef BRAIN
# define NEWSFEED_RSS "http://rss.orf.at/oesterreich.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

13
place/opensource.c Normal file
View file

@ -0,0 +1,13 @@
#include <net.h>
#define SILENCE
#define NAME "OpenSource"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.openbc.com/generated/rss/obc_de_net43-rssfeed0.91.xml"
# define RESET_INTERVAL 5*60 // 5 hours
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

1
place/paris.c Normal file
View file

@ -0,0 +1 @@
#include <place.gen>

11
place/politik.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define NAME "Politik"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Politik.xml"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

42
place/psyc.c Normal file
View file

@ -0,0 +1,42 @@
#include <net.h>
#define NAME "PSYC"
#define SILENT
#define PLACE_HISTORY_EXPORT
//#define HISTORY
#define HISTORY_METHOD "_notice_update"
#define HISTORY_GLIMPSE 4
#ifdef BRAIN
//# define ON_ANY if (mayLog(mc)) mymsg(source, mc, data, vars);
//# define ALLOW_EXTERNAL_FROM "psyc://fly.symlyn"
//# define ALLOW_EXTERNAL
#else
//# define CONNECT_DEFAULT
# define REDIRECT "psyc://psyced.org/@welcome"
#endif
#include <place.gen>
#ifdef BRAIN
// it was a bad idea anyway.. you don't wanna autorelease thru cvs..
#if 0
mymsg(source, mc, data, vars) {
if (vars["_module"] == "psyconaut"
&& strstr(vars["_files"], "psyconaut.exe") != -1) {
vars["_origin"] = source || vars["_INTERNAL_source"];
P0(("%O forwarding psyconaut %O\n", ME, vars))
sendmsg("psyc://psyced.org/@psyconaut-release", mc,
data, vars);
}
}
#endif
qAllowExternal(source, mc, vars) {
P3(("qAllowExternal: %O,%O,%O\n", source,mc,vars))
unless (stringp(source)) return 0;
if (abbrev( "psyc://213.73.91.20:" , source)) return 1;
if (abbrev( "psyc://fly.symlynx.com:" , lower_case(source))) return 1;
return 0;
}
#endif

12
place/raiitalia.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "RAIitalia"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.rainews24.it/ran24/rainews24_2007/RSS/italia.asp"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/rainews24.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "RAInews24"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.rainews24.it/ran24/rainews24_2007/RSS/ultime.asp"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

12
place/raivideo.c Normal file
View file

@ -0,0 +1,12 @@
#include <net.h>
#define NAME "RAIvideo"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.rainews24.it/ran24/rainews24_2007/RSS/video.asp"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

25
place/rendezvous.c Normal file
View file

@ -0,0 +1,25 @@
#include <net.h>
#define NAME "RendezVous"
#ifdef BRAIN
// psyc://psyced.org/@rendezvous currently disabled
// ("BRAIN" is only defined on psyced.org)
# define REDIRECT "psyc://psyced.org/@welcome"
#else
// this is the default configuration of the default chatroom of psyced.
// allowing /history in the default place admins are going to use is
// dangerous to privacy, because they haven't learned about /history yet.
// shutting out all remotes by default is an option to go with it, but
// it can be nice to come in and say hello to a new admin. so i'm leaving
// both commented out.
//
//# define PLACE_HISTORY // if you want to keep a /history
//# define LOCAL // if you don't want to allow remote users here
// but this one can't harm ;)
# define PLACE_MASQUERADING
#endif
#include <place.gen> // now generate the place according to the rules

2
place/roma.c Normal file
View file

@ -0,0 +1,2 @@
#define PLACE_HISTORY_EXPORT
#include <place.gen>

22
place/slashdot.c Normal file
View file

@ -0,0 +1,22 @@
#include <net.h>
#define SILENCE
#define NAME "slashdot"
#ifdef BRAIN
# define NEWSFEED_RSS "http://rss.slashdot.org/Slashdot/slashdot"
# define RESET_INTERVAL 4 // that's quite often.. but that's slashdot style
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>
#ifdef BRAIN
publish(link, headline, channel) {
if (strstr(link, "&from=rss", -12) != -1)
link = link[0 .. <12];
return ::publish(link, headline, channel);
}
#endif

17
place/spiegel-en.c Normal file
View file

@ -0,0 +1,17 @@
#include <net.h>
#define SILENCE
#define NAME "Spiegel-EN"
#define TITLE "Spiegel International"
#define DESCRIPTION "Europe's Largest News Magazine in English Edition"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.spiegel.de/schlagzeilen/rss/0,5291,676,00.xml"
# define RESET_INTERVAL 10 // they suggest 5 minutes
#else
# define CONNECT_DEFAULT
#endif
/*
* http://www.spiegel.de/dertag/0,1518,271804,00.html
*/
#include <place.gen>

15
place/spiegel.c Normal file
View file

@ -0,0 +1,15 @@
#include <net.h>
#define SILENCE
#define NAME "Spiegel"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml"
# define RESET_INTERVAL 5 // they suggest 5 minutes
#else
# define CONNECT_DEFAULT
#endif
/*
* http://www.spiegel.de/dertag/0,1518,271804,00.html
*/
#include <place.gen>

10
place/sport.c Normal file
View file

@ -0,0 +1,10 @@
#include <net.h>
#define NAME "Sport"
#define SILENCE
#ifdef BRAIN
# define NEWSFEED_RSS "http://shortnews.stern.de/rss/Sport.xml"
#else +# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/sportmotor.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "SportMotor"
#ifdef BRAIN
// # define NEWSFEED_RSS "http://www.stern.de/standard/rss.php?channel=sport-motor"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

11
place/stern.c Normal file
View file

@ -0,0 +1,11 @@
#include <net.h>
#define SILENCE
#define NAME "STERN"
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.stern.de/standard/rss.php?channel=all"
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

57
place/sync.c Normal file
View file

@ -0,0 +1,57 @@
#include <net.h>
// you shouldn't let your users be able to enter this and
// receive synchronization reports. you have to restrict entry here.
#ifndef ADMINISTRATORS
# ifdef CONFIG_PATH
# include CONFIG_PATH "admins.h"
# endif
#endif
#ifdef ADMINISTRATORS
# define PLACE_OWNED ADMINISTRATORS
# define RESTRICTED
#else
# echo Warning: Sync room is not restricted.
#endif
#define PRIVATE
#define NICKLESS
#define TRUSTED
#define ALLOW_EXTERNAL_LOCALS // this allows /m from ircers.. todo
// but _message is irrelevant anyway here
// history triggers a recursion. why i can't tell.
//#define PLACE_HISTORY
//#define HISTORY_METHOD "_notice_synchronize"
#include <place.gen>
#ifdef _flag_enable_request_list_user_registered
msg(source, mc, data, mapping vars) {
P2(("%O got %O from %O\n", ME, mc, source))
switch(mc) {
case "_request_list_user_registered":
if (isMember(source) || vars["_INTERNAL_trust"] > 5) {
// TODO: i think we need an api for "all registered users"
// which could also do caching
mixed files = map(get_dir(DATA_PATH "person/", 0x01),
(: return $1[..<3]; :));
mapping rv = ([ ]);
if (vars["_tag"]) rv["_tag_reply"] = vars["_tag"];
rv["_list_user"] = files;
sendmsg(source, "_notice_list_user_registered", 0, rv);
} else {
P0(("%O not trusted to do request list user, trust is %O\n",
source, vars["_INTERNAL_trust"]))
}
break;
default:
return ::msg(source, mc, data, vars);
}
}
#endif

27
place/syslog.c Normal file
View file

@ -0,0 +1,27 @@
// this place is configured in a suitable way for receiving
// syslog events from the syslog2psyc tool in perlpsyc
//
#include <net.h>
#ifdef ADMINISTRATORS
# define PLACE_OWNED ADMINISTRATORS
#else
# echo place/syslog has no owners!
#endif
#define NAME "syslog"
#define PRIVATE
#define SECURE
#define RESTRICTED
#define PLACE_HISTORY_EXPORT
#define HISTORY_GLIMPSE 7
#define HISTORY_METHOD "_notice_system"
#ifdef BRAIN
# define ALLOW_EXTERNAL_FROM "psyc://psyced.org"
#else
# define ALLOW_EXTERNAL_FROM "psyc://localhost"
#endif
#include <place.gen>

14
place/tagesschau.c Normal file
View file

@ -0,0 +1,14 @@
#define NAME "tagesschau"
#define SILENCE
#include <net.h>
#ifdef BRAIN
# define NEWSFEED_RSS "http://www.tagesschau.de/newsticker.rdf"
// the tagesschau newsticker occasionally has broken links
// so we add a filter that skips those
# define NEWS_PUBLISH(link, headline, channel) (strstr(link, ",,") != -1)
#else
# define CONNECT_DEFAULT
#endif
#include <place.gen>

Some files were not shown because too many files have changed in this diff Show more