diff -u --recursive --new-file vchat-ip.orig/Makefile vchat-ip/Makefile --- vchat-ip.orig/Makefile Sat Aug 6 11:54:07 1994 +++ vchat-ip/Makefile Wed Jan 21 00:36:23 1998 @@ -11,7 +11,7 @@ SYS != uname -s DIRS = vserver vping vchat -.include "conf.mk" +include conf.mk all: @echo "==============================================================================="; \ diff -u --recursive --new-file vchat-ip.orig/conf.mk vchat-ip/conf.mk --- vchat-ip.orig/conf.mk Sat Aug 6 12:10:42 1994 +++ vchat-ip/conf.mk Wed Jan 21 00:36:23 1998 @@ -50,7 +50,7 @@ INSTALL = /usr/bin/install STRIP = /usr/bin/strip SIZE = /usr/bin/size -MAKE = /usr/local/bin/net2make +MAKE = /usr/bin/make MKDEP = /usr/bin/gcc -M LIBDIR = /usr/local/lib @@ -63,55 +63,17 @@ LIBS = CC = gcc -OWNER = bin -GROUP = bin -MODE = 111 - -MANOWN = bin -MANGRP = bin -MANMODE = 444 - -TAIL = @echo -n; $(STRIP) $(TARGET) - -.elif ${SYS} == "SunOS" - -SHELL = /bin/sh -INSTALL = /usr/bin/install -STRIP = /usr/bin/strip -SIZE = /usr/bin/size -MAKE = /usr/bin/make -MKDPEP = /usr/bin/mkdep - -LIBDIR = /usr/local/lib -BINDIR = /usr/local/bin -MANDIR = /usr/local/man - -COPTS = -O -DEFS = -DSunOS -DEBUG = -LIBS = -liberty -CC = gcc - -OWNER = bin -GROUP = bin -MODE = 111 - -MANOWN = bin -MANGRP = bin -MANMODE = 444 +OWNER = sysop +GROUP = users +MODE = 610 + +MANOWN = sysop +MANGRP = users +MANMODE = 640 TAIL = @echo -n; $(STRIP) $(TARGET) -.endif - CFLAGS = $(COPTS) $(DEBUG) $(DEFS) -.if ${SYS} == "Linux" - DEPEND = $(MKDEP) ${CFLAGS} ${SRCS} >.depend -.else - -DEPEND = $(MKDEP) ${CFLAGS} ${SRCS} - -.endif diff -u --recursive --new-file vchat-ip.orig/config.h vchat-ip/config.h --- vchat-ip.orig/config.h Mon Aug 22 00:57:53 1994 +++ vchat-ip/config.h Wed Jan 21 00:36:23 1998 @@ -59,7 +59,7 @@ /* Linux systems, so don't bother if */ /* you get odd results using Linux. */ -#define SLIP_FIX /* !!!!! USES ALPHA CODE !!!! */ +/* #define SLIP_FIX */ /* !!!!! USES ALPHA CODE !!!! */ -#define RCVTMOUT_SEC 6 /* Socket receive timeout (sec) */ -#define RCVTMOUT_USEC 0 /* Socket receive timeout (usec)*/ +/* #define RCVTMOUT_SEC 6 */ /* Socket receive timeout (sec) */ +/* #define RCVTMOUT_USEC 0 */ /* Socket receive timeout (usec)*/ diff -u --recursive --new-file vchat-ip.orig/global.h vchat-ip/global.h --- vchat-ip.orig/global.h Sat Aug 6 12:11:04 1994 +++ vchat-ip/global.h Wed Jan 21 00:53:17 1998 @@ -50,6 +50,28 @@ #define PAGE 0x4A #define RING 0x4B #define WHO 0x4C +#define CAMKICK 0x4D +#define CAMGRIN 0x4E +#define CAMSMILE 0x4F +#define CAMLAUGH 0x50 +#define CAMFAKE 0x51 +#define CAMWSTAT 0x52 +#define CAMROTFL 0x53 +#define CAMTHANK 0x54 +#define CAMAWAY 0x55 +#define CAMBACK 0x56 +#define CAMBUMM 0x57 +#define CAMBURP 0x58 +#define CAMSIGH 0x59 +#define CAMCRY 0x5A +#define CAMBLACKHOLE 0x5B +#define CAMWHAT 0x5C +#define CAMHUG 0x5D +#define CAMWAVE 0x5E +#define CAMHANDSHAKE 0x5F +#define CAMTHINK 0x60 +#define CAMDANCE 0x61 +#define CAMBEEP 0x62 /**********************************/ /* Command bytes server -> client */ diff -u --recursive --new-file vchat-ip.orig/vchat/Makefile vchat-ip/vchat/Makefile --- vchat-ip.orig/vchat/Makefile Sat Aug 6 11:58:38 1994 +++ vchat-ip/vchat/Makefile Wed Jan 21 00:36:23 1998 @@ -11,7 +11,8 @@ SYS != uname -s TARGET = vchat -S = ${.CURDIR} +#S = ${.CURDIR} +S = . SRCS = ${S}/vchat.c \ ${S}/screen.c \ @@ -21,7 +22,7 @@ OBJS = $(TARGET).o screen.o inet.o input.o tty.o -.include "../conf.mk" +include ../conf.mk $(TARGET): $(OBJS) $(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS) @@ -33,7 +34,7 @@ $(DEPEND) clean: - rm -f $(OBJS) $(TARGET).core lint tags + rm -f $(OBJS) $(TARGET).core lint tags $(TARGET) clobber: rm -f $(OBJS) $(TARGET) $(TARGET).core lint tags .depend diff -u --recursive --new-file vchat-ip.orig/vchat/proto.h vchat-ip/vchat/proto.h --- vchat-ip.orig/vchat/proto.h Sat Aug 6 23:56:32 1994 +++ vchat-ip/vchat/proto.h Wed Jan 21 02:40:57 1998 @@ -27,6 +27,28 @@ void ulist(char *dat); void ring(char *dat); void who(char *dat); +void kick(char *user); +void grin(char *user); +void smile(char *user); +void wstat(char *user); +void laugh(char *user); +void fake(char *text); +void rotfl(char *user); +void thank(char *user); +void away(char *user); +void back(char *user); +void bumm(char *user); +void burp(char *user); +void sigh(char *user); +void cry(char *user); +void blackhole(char *user); +void what(char *user); +void hug(char *user); +void wave(char *user); +void handshake(char *user); +void think(char *user); +void dance(char *user); +void beep(char *user); /** screen.c **/ diff -u --recursive --new-file vchat-ip.orig/vchat/screen.c vchat-ip/vchat/screen.c --- vchat-ip.orig/vchat/screen.c Sun Aug 7 00:58:01 1994 +++ vchat-ip/vchat/screen.c Wed Jan 21 00:36:23 1998 @@ -41,7 +41,7 @@ cls(); mv(1, (t_rows-1)); - printf("%s=== VChat === Type \".h\" to get help ===%*s%7s %3dx%-3d %s", + printf("%s=== VChat === Type \"/help\" to get help ===%*s%7s %3dx%-3d %s", vt(REVERSE | BOLD | FG_WHITE | BG_BLUE), t_cols-56, " ", emulation, t_cols, t_rows, vt(OFF)); diff -u --recursive --new-file vchat-ip.orig/vchat/vchat.c vchat-ip/vchat/vchat.c --- vchat-ip.orig/vchat/vchat.c Sun Aug 21 23:40:40 1994 +++ vchat-ip/vchat/vchat.c Wed Jan 21 01:03:37 1998 @@ -38,6 +38,7 @@ char *prog_name; /* The program name we run under */ char *emulation; /* Terminal-Emulation */ +char bye=0; /* If set to >0, vchat will exit. Added by cameron. */ struct sockaddr_in sock_in; /* Socket Addressing structure */ struct client_data cl_dat; /* Client Data structure */ @@ -72,18 +73,12 @@ { len = edline(buf, t_cols - strlen(nick) - 5); - if(strchr(".:/", buf[0]) && buf[1] != 'x') - { + if(strchr(".:/", buf[0])) handle_cmd(buf); - } - else if(strchr(".:/", buf[0]) && buf[1] == 'x') - { - break; - } else - { snd_serv(PUBMSG, (char *)&buf, len); - } + if(bye) + break; } snd_serv(SIGNOFF, 0, 0); @@ -122,6 +117,9 @@ emulation = getenv("TERM"); + if(strcmp(emulation, "linux")==0) + strcpy(emulation, "ansi"); + if((char *)strncmp(emulation, "vt1", 3) == NULL) { strcpy(csi, "\033["); @@ -374,29 +372,54 @@ void handle_cmd(char *cmd) { - char *arg = &(cmd[3]); - - switch(cmd[1]) + char *arg; + char token; + enum commands { _ring , _chan , _help , _invite , _msg , _nick , _mail , _reset , + _who , _tc , _version , _rwho , _bye , _kick , _grin , _wstat , + _laugh , _smile , _fake , _rotfl , _thank , _away , _back , _bumm , + _burp , _sigh , _cry , _blackhole,_what , _hug , _wave , _handshake, + _think , _dance , _beep , + __END }; + char *cmds[]={ "_ring" , "_chan" , "_help" , "_invite" , "_msg" , "_nick" , "_mail" , "_reset" , + "_who" , "_tc" , "_version" , "_rwho" , "_bye" , "_kick" , "_grin" , "_wstat", + "_laugh" , "_smile" , "_fake" , "_rotfl" , "_thank" , "_away" , "_back" , "_bumm", + "_burp" , "_sigh" , "_cry" , "_blackhole","_what" , "_hug" , "_wave" , "_handshake", + "_think" , "_dance" , "_beep" , + "__END" }; + + arg=cmd; + if(strchr(arg, ' ')!=0) + { + while(arg[0]!=' ') + *arg++; + *arg++; + } + cmd[0]='_'; + for(token=_ring; token!=__END; token++) + if(strncmp(cmd, cmds[token], strlen(cmds[token]))==0) + break; + switch(token) { - case 'b': ring(arg); + case _ring: ring(arg); break; - case 'c': chchan(arg); + case _chan: chchan(arg); break; - case 'h': help(); + case _help: help(); break; - case 'i': invite(arg); + case _invite: invite(arg); break; - case 'm': prv_msg(arg); + case _msg: prv_msg(arg); break; - case 'n': chnick(arg); + case _nick: chnick(arg); break; - case 'p': snd_serv(PAGE, arg, sizeof(struct user)); + case _mail: snd_serv(PAGE, arg, sizeof(struct user)); break; - case 'r': screen_init(); + case _reset: screen_init(); break; - case 's': ulist(arg); + + case _who: ulist(arg); break; - case 't': if(color) + case _tc: if(color) { if(strcmp(arg, "on") == 0) { @@ -418,12 +441,58 @@ cprintf(0, "* Color support not enabled."); } break; - case 'v': version_info(); + case _version: version_info(); + break; + case _rwho: who(arg); + break; + case _bye: bye=1; + break; + case _kick: kick(arg); + break; + case _grin: grin(arg); + break; + case _laugh: laugh(arg); + break; + case _smile: smile(arg); + break; + case _fake: fake(arg); + break; + case _wstat: wstat(arg); + break; + case _rotfl: rotfl(arg); + break; + case _thank: thank(arg); break; - case 'w': who(arg); + case _away: away(arg); + break; + case _back: back(arg); + break; + case _bumm: bumm(arg); + break; + case _burp: burp(arg); + break; + case _sigh: sigh(arg); + break; + case _cry: cry(arg); + break; + case _blackhole: blackhole(arg); + break; + case _what: what(arg); + break; + case _hug: hug(arg); + break; + case _wave: wave(arg); + break; + case _handshake: handshake(arg); + break; + case _think: think(arg); + break; + case _dance: dance(arg); + break; + case _beep: beep(arg); break; default: chat_beep(); - cprintf(0, "* No such command - type \".h\" to get help."); + cprintf(0, "* No such command - type \"/help\" to get help."); break; } } @@ -489,23 +558,37 @@ cprintf(3, "\n* %cVChat%c -- Interactive IP level Chat system -- %c%s%c", RED, XXX, YEL, VERSION, XXX); + cprintf(3, "* slightly modified by cameron 10-30-97."); cprintf(4, "*"); cprintf(4, "* Commands are:"); - cprintf(4, "* %cb%c - send chat request to ", BLU, XXX); - cprintf(4, "* %cc%c - change channel to ", BLU, XXX); - cprintf(4, "* %ch%c - you just found out what this does", BLU, XXX); - cprintf(4, "* %ci%c - invite to join the channel you're on", BLU, XXX); - cprintf(4, "* %cm%c - send private message to ", BLU, XXX); - cprintf(4, "* %cn%c - change nickname to ", BLU, XXX); - cprintf(4, "* %cp%c - send chat request to via mail", BLU, XXX); - cprintf(4, "* %cr%c - clear and redraw screen (in case of xmission errors)", BLU, XXX); - cprintf(4, "* %cs%c [* | ] - show who is chatting on ", BLU, XXX); - cprintf(4, "* * means your channel, default is all channels"); - cprintf(4, "* %ct%c - toggle text color emulation on/off", BLU, XXX); - cprintf(4, "* %cv%c - show chat version information", BLU, XXX); - cprintf(4, "* %cw%c [host] - show who is logged in on [host]", BLU, XXX); - cprintf(4, "* default ist your host", BLU, XXX); - cprintf(4, "* %cx%c - exit from the chat system", BLU, XXX); + cprintf(4, "* %cring%c - send chat request to ", BLU, XXX); + cprintf(4, "* %cchan%c - change channel to ", BLU, XXX); + cprintf(4, "* %chelp%c - you just found out what this does", BLU, XXX); + cprintf(4, "* %cinvite%c - invite to join the channel you're on", BLU, XXX); + cprintf(4, "* %cmsg%c - send private message to ", BLU, XXX); + cprintf(4, "* %cwstat%c - show whisperstate ('msg's) of .", BLU, XXX); + cprintf(4, "* %cnick%c - change nickname to ", BLU, XXX); + cprintf(4, "* %cmail%c - send chat request to via mail", BLU, XXX); + cprintf(4, "* %creset%c - clear and redraw screen (in case of xmission errors)", BLU, XXX); + cprintf(4, "* %cwho%c [* | ] - show who is chatting on ", BLU, XXX); + cprintf(4, "* * means your channel, default is all channels"); + cprintf(4, "* %ctc%c - toggle text color emulation on/off", BLU, XXX); + cprintf(4, "* %cversion%c - show chat version information", BLU, XXX); + cprintf(4, "* %crwho%c [host] - show who is logged in on [host]", BLU, XXX); + cprintf(4, "* default ist your host", BLU, XXX); + cprintf(4, "* %cbye%c - exit from the chat system", BLU, XXX); + cprintf(4, "* Actions are:"); + cprintf(4, "* %ckick%c %csmile%c ", BLU, XXX, BLU, XXX); + cprintf(4, "* %cgrin%c %claugh%c ", BLU, XXX, BLU, XXX); + cprintf(4, "* %cfake%c %crotfl%c", BLU, XXX, BLU, XXX); + cprintf(4, "* %cthank%c %caway%c", BLU, XXX, BLU, XXX); + cprintf(4, "* %cback%c %cbumm%c", BLU, XXX, BLU, XXX); + cprintf(4, "* %cburp%c %csigh%c", BLU, XXX, BLU, XXX); + cprintf(4, "* %ccry%c %cblackhole%c ", BLU, XXX, BLU, XXX); + cprintf(4, "* %cwhat%c %chug%c ", BLU, XXX, BLU, XXX); + cprintf(4, "* %cwave%c %chandshake%c ", BLU, XXX, BLU, XXX); + cprintf(4, "* %cthink%c %cdance%c ", BLU, XXX, BLU, XXX); + cprintf(4, "* %cbeep%c", BLU, XXX); cprintf(4, "*"); cprintf(5, "* You may start commands with either '%c.%c', '%c/%c' or '%c:%c'\n", RED, XXX, RED, XXX, RED, XXX); @@ -538,8 +621,6 @@ snd_serv(PRVMSG, (char *)&prv, sizeof(struct prv_message)); } - - } void ulist(char *dat) @@ -551,7 +632,7 @@ lt.cmd = MY_CHAN; snd_serv(ULIST, (char *)<, sizeof(struct list)); } - else if(strlen(dat) == 0) /* default: all channels */ + else if(strcmp(dat, "_who") == 0) /* default: all channels */ { lt.cmd = ALL_CHAN; snd_serv(ULIST, (char *)<, sizeof(struct list)); @@ -586,5 +667,215 @@ { snd_serv(WHO, dat, strlen(dat)); } +} + +void kick(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMKICK, (char*)&nk, sizeof(struct nickname)); +} + +void grin(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMGRIN, (char*)&nk, sizeof(struct nickname)); +} + +void smile(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMSMILE, (char*)&nk, sizeof(struct nickname)); +} + +void laugh(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMLAUGH, (char*)&nk, sizeof(struct nickname)); +} + +void rotfl(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMROTFL, (char*)&nk, sizeof(struct nickname)); +} + +void thank(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMTHANK, (char*)&nk, sizeof(struct nickname)); +} + +void away(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMAWAY, (char*)&nk, sizeof(struct nickname)); +} + +void back(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMBACK, (char*)&nk, sizeof(struct nickname)); +} + +void bumm(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMBUMM, (char*)&nk, sizeof(struct nickname)); +} + +void burp(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMBURP, (char*)&nk, sizeof(struct nickname)); +} + +void sigh(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMSIGH, (char*)&nk, sizeof(struct nickname)); +} + +void cry(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMCRY, (char*)&nk, sizeof(struct nickname)); +} + +void blackhole(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMBLACKHOLE, (char*)&nk, sizeof(struct nickname)); +} + +void what(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMWHAT, (char*)&nk, sizeof(struct nickname)); +} + +void hug(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMHUG, (char*)&nk, sizeof(struct nickname)); +} + +void wave(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMWAVE, (char*)&nk, sizeof(struct nickname)); +} + +void handshake(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMHANDSHAKE, (char*)&nk, sizeof(struct nickname)); +} + +void think(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMTHINK, (char*)&nk, sizeof(struct nickname)); +} + +void dance(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMDANCE, (char*)&nk, sizeof(struct nickname)); +} + +void beep(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMBEEP, (char*)&nk, sizeof(struct nickname)); +} + +void fake(char *dat) +{ + char nk[32]; + char msg[255]; + struct prv_message prv; + + strcpy(msg, dat); + strcpy(dat, "_fake "); + strcat(dat, msg); + if(sscanf(dat, "%s " + "%[a-z A-Z0-9!\"$%&/()=?`'\\@+*~#-_.:,;<>|]", nk, msg) < 1) + cprintf(0, "* Missing argument(s)"); + else + { + strcpy(prv.receiver, nk); + strcpy(prv.msg, msg); + + snd_serv(CAMFAKE, (char *)&prv, sizeof(struct prv_message)); + } +} + +void wstat(char *user) +{ + struct nickname nk; + + strcpy(nk.nick, user); + + snd_serv(CAMWSTAT, (char*)&nk, sizeof(struct nickname)); } diff -u --recursive --new-file vchat-ip.orig/vping/Makefile vchat-ip/vping/Makefile --- vchat-ip.orig/vping/Makefile Sat Aug 6 12:04:36 1994 +++ vchat-ip/vping/Makefile Wed Jan 21 00:36:23 1998 @@ -11,7 +11,8 @@ SYS != uname -s TARGET = vping -S = ${.CURDIR} +#S = ${.CURDIR} +S = . SRCS = ${S}/audio.c \ ${S}/subr.c \ @@ -21,11 +22,8 @@ subr.o \ vping.o -.include "../conf.mk" +include ../conf.mk -.if ${SYS} == "FreeBSD" -LIBS += -lutil -.endif $(TARGET): $(OBJS) @@ -38,7 +36,7 @@ $(DEPEND) clean: - rm -f $(OBJS) $(TARGET).core lint tags + rm -f $(OBJS) $(TARGET).core lint tags $(TARGET) clobber: rm -f $(OBJS) $(TARGET) $(TARGET).core lint tags .depend diff -u --recursive --new-file vchat-ip.orig/vserver/Makefile vchat-ip/vserver/Makefile --- vchat-ip.orig/vserver/Makefile Sat Aug 6 11:56:36 1994 +++ vchat-ip/vserver/Makefile Wed Jan 21 00:36:23 1998 @@ -11,7 +11,8 @@ SYS != uname -s TARGET = vserver -S = ${.CURDIR} +#S = ${.CURDIR} +S = . SRCS = ${S}/vserver.c \ ${S}/commands.c \ @@ -21,7 +22,7 @@ commands.o \ subr.o -.include "../conf.mk" +include ../conf.mk $(TARGET): $(OBJS) $(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS) @@ -33,7 +34,7 @@ $(DEPEND) clean: - rm -f $(OBJS) $(TARGET).core lint tags + rm -f $(OBJS) $(TARGET).core lint tags $(TARGET) clobber: rm -f $(OBJS) $(TARGET) $(TARGET).core lint tags .depend diff -u --recursive --new-file vchat-ip.orig/vserver/commands.c vchat-ip/vserver/commands.c --- vchat-ip.orig/vserver/commands.c Mon Aug 22 00:49:22 1994 +++ vchat-ip/vserver/commands.c Wed Jan 21 01:05:27 1998 @@ -23,6 +23,12 @@ #define CPRY "* (c) '93/'94 by mickey@deadline -- All rights reserved." +struct wstatstruct { + char nick[32]; + unsigned int recv, send, stat; +}; +struct wstatstruct wstats[MAXUSERS]; + /********************************************/ /* Hier kommen nun die Routinen fuer die */ /* behandlung der einzelnen Server commands */ @@ -38,7 +44,8 @@ snd_svmsg(ptr->fd, "* Connected to VChat server at %c%s%c [%c%s%c]", RED, our_host, XXX, YEL, inet_ntoa(our_ipaddr), XXX); - snd_svmsg(ptr->fd, "* VChat TCP/IP chat server %s\n", VERSION); + snd_svmsg(ptr->fd, "* VChat TCP/IP chat server %s", VERSION); + snd_svmsg(ptr->fd, "* slightly modified by cameron Nov-1997.\n"); for(i=0; iuser, ptr->nick, ptr->host, inet_ntoa(ptr->ip_addr)); + for(i=0; ((strlen(wstats[i].nick)!=0)&&(inick); + wstats[i].recv=wstats[i].send=wstats[i].stat=0; } void signoff(struct client_data *ptr) @@ -85,6 +95,8 @@ } } + for(i=0; ((strcmp(ptr->nick, wstats[i].nick)!=0)&&(ifd); } @@ -120,6 +132,8 @@ } } + for(i=0; ((strcmp(ptr->nick, wstats[i].nick)!=0)&&(ifd); } @@ -128,7 +142,7 @@ struct nickname *nk = (struct nickname *) dat; struct client_data *pt; extern int clients; - int i; + int n, i; if(nick_ok(ptr, nk->nick)) { @@ -143,6 +157,8 @@ } } log(LOG_INFO, "%s is now know as %s.", ptr->nick, nk->nick); + for(n=0; ((strcmp(ptr->nick, wstats[n].nick)!=0)&&(nnick); strcpy(ptr->nick, nk->nick); } else @@ -190,8 +206,7 @@ struct prv_message *prv = (struct prv_message *) dat; struct client_data *cl; extern int clients; - int i; - int n = 0; + int i, n=0; for(i=0; ifd, "* Nickname '%c%s%c' not found", + snd_svmsg(ptr->fd, "* Nickname '%c%s%c' not found", RED, prv->receiver, XXX); + else { + snd_svmsg(ptr->fd, "* Message sent to %c%s%c.", RED, prv->receiver, XXX); + for(n=0; ((strcmp(ptr->nick, wstats[n].nick)!=0)&&(nreceiver, wstats[n].nick)!=0)&&(nhost; @@ -682,3 +706,478 @@ } close(s); } + +void kick(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c kicks you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c has kicked %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You have kicked %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void smile(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c smiles to you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c smiles to %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You have smiled to %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void grin(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c grins to you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c is grinning to %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You have grinned to %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void laugh(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c is laughing to you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c laughs to %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You are laughing to %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void thank(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c is thanking you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c is thanking %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You are thanking %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void blackhole(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c puts you into the blackhole. You should never return!", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c puts %c%s%c into the blackhole.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You are putting %c%s%c into the blackhole.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void handshake(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c is shaking hands with you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c is shaking hands with %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You are shaking hands with %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void what(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c can\'t hear you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c cant\'t hear what %c%s%c is saying.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You can\'t hear what %c%s%c is saying.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void hug(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c hugs you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c hugs %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You are hugging %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void dance(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c is dancing with you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c is dancing with %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You are dancing with %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void beep(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; inick, nam->nick)==0) { + snd_svmsg(cl->fd, "* %c%s%c \007beeps to you.", BLU, ptr->nick, XXX); + n++; + } + } + if(n) + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + snd_svmsg(cl->fd, "* %c%s%c is beeping to %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + snd_svmsg(ptr->fd, "* You have beeped to %c%s%c.", BLU, nam->nick, XXX); + } + else + snd_svmsg(ptr->fd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); +} + +void rotfl(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c is rolling on the floor laughing.", BLU, ptr->nick, XXX); + } +} + +void away(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c is away, coming back soon.", BLU, ptr->nick, XXX); + } +} + +void back(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c is back at the keyboard.", BLU, ptr->nick, XXX); + } +} + +void bumm(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c explodes with a big BANG!", BLU, ptr->nick, XXX); + } +} + +void burp(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c burps rudely.", BLU, ptr->nick, XXX); + } +} + +void sigh(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c sighs hardly.", BLU, ptr->nick, XXX); + } +} + +void cry(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c bursts into tears. UUAAAHH!!", BLU, ptr->nick, XXX); + } +} + +void wave(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c waves goodbye to all!", BLU, ptr->nick, XXX); + } +} + +void think(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam = (struct nickname *) dat; + extern int clients; + int i, n=0; + + for(i=0; ifd, "* %c%s%c is thinking very hard...", BLU, ptr->nick, XXX); + } +} + +void fake(struct client_data *ptr, char *dat) +{ + struct prv_message *prv = (struct prv_message *) dat; + struct client_data *cl; + extern int clients; + int i; + + for(i=0; ifd, "* %c%s%c", + GRN, prv->msg, XXX); + } +} + +void wstat(struct client_data *ptr, char *dat) +{ + struct client_data *cl; + struct nickname *nam=(struct nickname *)dat; + extern int clients; + int i, n; + + for(n=0; ((strcmp(nam->nick, wstats[n].nick)!=0)&&(nfd, "* %c%s%c: no such user.", BLU, nam->nick, XXX); + else { + for(i=0; inick, nam->nick)==0) + if(strcmp(cl->nick, ptr->nick)==0) { + snd_svmsg(cl->fd, "* Your own wstat:"); + for(n=0; ((strcmp(nam->nick, wstats[n].nick)!=0)&&(nfd, "* Whispers('msg's) received: %c%i%c, send: %c%i%c. wstats requested: %c%i%c.", YEL, wstats[n].recv, XXX, YEL, wstats[n].send, XXX, YEL, wstats[n].stat, XXX); + wstats[n].stat++; + } + else { + snd_svmsg(cl->fd, "* %c%s%c has got a wstat of you.", BLU, ptr->nick, XXX); + n++; + } + } + for(i=0; inick, nam->nick)!=0) + if(strcmp(cl->nick, ptr->nick)!=0) + if(strcmp(ptr->nick, nam->nick)==0) + snd_svmsg(cl->fd, "* %c%s%c has got own wstat.", BLU, ptr->nick, XXX); + else + snd_svmsg(cl->fd, "* %c%s%c has got a wstat of %c%s%c.", BLU, ptr->nick, XXX, BLU, nam->nick, XXX); + else + if(strcmp(ptr->nick, cl->nick)==0) { + for(n=0; ((strcmp(nam->nick, wstats[n].nick)!=0)&&(nfd, "* wstat of %c%s%c:", BLU, wstats[n].nick, XXX); + snd_svmsg(ptr->fd, "* Whispers('msg's) received: %c%i%c, send: %c%i%c. wstats requested: %c%i%c.", YEL, wstats[n].recv, XXX, YEL, wstats[n].send, XXX, YEL, wstats[n].stat, XXX); + for(n=0; ((strcmp(ptr->nick, wstats[n].nick)!=0)&&(nnick, nick) == 0) - && !(strcmp(tmp->user, cl->user) == 0 && strcmp(tmp->host, cl->host) == 0 && bcmp(&tmp->ip_addr, &cl->ip_addr, sizeof(tmp->ip_addr)) == 0)) - { + if(strcmp(tmp->nick, nick) == 0) +/* && !(strcmp(tmp->user, cl->user) == 0 && strcmp(tmp->host, cl->host) == 0 && bcmp(&tmp->ip_addr, &cl->ip_addr, sizeof(tmp->ip_addr)) == 0)) +*/ { ret = 0; } } diff -u --recursive --new-file vchat-ip.orig/vserver/vserver.c vchat-ip/vserver/vserver.c --- vchat-ip.orig/vserver/vserver.c Sat Aug 6 11:56:52 1994 +++ vchat-ip/vserver/vserver.c Wed Jan 21 00:50:37 1998 @@ -15,6 +15,7 @@ #include #include #include +#include #include "proto.h" /******* Globals ******/ @@ -134,6 +135,11 @@ /* verzweigt, oder eine Fehlermeldung zurueckgegeben */ /* wenn wir das command nicht behandeln koennen. */ + if((cmd!=PUBMSG)&(cmd!=CAMFAKE)&(strchr(data, ' ')!=0)) { + while(((data[0])!=' ')&(data!=0)) + *data++; + data++; + } switch(cmd) { case SIGNON: signon(cl); @@ -159,6 +165,50 @@ case RING: ring(cl, data); break; case WHO: who(cl, data); + break; + case CAMKICK: kick(cl, data); + break; + case CAMSMILE: smile(cl, data); + break; + case CAMGRIN: grin(cl, data); + break; + case CAMLAUGH: laugh(cl, data); + break; + case CAMFAKE: fake(cl, data); + break; + case CAMWSTAT: wstat(cl, data); + break; + case CAMROTFL: rotfl(cl, data); + break; + case CAMTHANK: thank(cl, data); + break; + case CAMAWAY: away(cl, data); + break; + case CAMBACK: back(cl, data); + break; + case CAMBUMM: bumm(cl, data); + break; + case CAMBURP: burp(cl, data); + break; + case CAMSIGH: sigh(cl, data); + break; + case CAMCRY: cry(cl, data); + break; + case CAMBLACKHOLE: blackhole(cl, data); + break; + case CAMWHAT: what(cl, data); + break; + case CAMHUG: hug(cl, data); + break; + case CAMWAVE: wave(cl, data); + break; + case CAMHANDSHAKE: handshake(cl, data); + break; + case CAMTHINK: think(cl, data); + break; + case CAMDANCE: dance(cl, data); + break; + case CAMBEEP: beep(cl, data); break; default: snd_svmsg(cl->fd, "* Command byte %c$%x%c not recognized by server\n", RED, cmd, XXX);