Added sysop page commands
This commit is contained in:
@@ -10,7 +10,7 @@ SRCS = signature.c filesub.c language.c mbtoberep.c \
|
||||
bye.c funcs.c mail.c \
|
||||
newuser.c pinfo.c timecheck.c change.c \
|
||||
exitinfo.c mball.c mbsebbs.c menu.c pop3.c lastcallers.c \
|
||||
timeout.c chat.c file.c mbchat.c mbstat.c misc.c \
|
||||
timeout.c chat.c file.c mbstat.c misc.c \
|
||||
offline.c user.c mbnewusr.c input.c whoson.c \
|
||||
door.c dispfile.c userlist.c timestats.c logentry.c
|
||||
HDRS = signature.h filesub.h language.h mbsebbs.h misc.h offline.h \
|
||||
@@ -38,8 +38,6 @@ MBALL_OBJS = mball.o
|
||||
MBALL_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
|
||||
MBLANG_OBJS = mblang.o
|
||||
MBLANG_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
|
||||
MBCHAT_OBJS = mbchat.o
|
||||
MBCHAT_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
|
||||
MBSTAT_OBJS = mbstat.o
|
||||
MBSTAT_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
|
||||
MBTOBE_OBJS = mbtoberep.o
|
||||
@@ -47,7 +45,7 @@ MBTOBE_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/
|
||||
MBUSER_OBJS = mbuser.o
|
||||
MBUSER_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
|
||||
OTHER = Makefile
|
||||
TARGET = mbsebbs mbnewusr mball mblang mbchat mbstat mbtoberep mbuser
|
||||
TARGET = mbsebbs mbnewusr mball mblang mbstat mbtoberep mbuser
|
||||
|
||||
#############################################################################################################
|
||||
|
||||
@@ -75,10 +73,6 @@ mblang: ${MBLANG_OBJS} ${MBLANG_LIBS}
|
||||
${CC} -o mblang ${MBLANG_OBJS} ${LIBS} ${MBLANG_LIBS}
|
||||
strip mblang
|
||||
|
||||
mbchat: ${MBCHAT_OBJS} ${MBCHAT_LIBS}
|
||||
${CC} -o mbchat ${MBCHAT_OBJS} ${LIBS} ${MBCHAT_LIBS}
|
||||
strip mbchat
|
||||
|
||||
mbstat: ${MBSTAT_OBJS} ${MBSTAT_LIBS}
|
||||
${CC} -o mbstat ${MBSTAT_OBJS} ${LIBS} ${MBSTAT_LIBS}
|
||||
strip mbstat
|
||||
@@ -99,11 +93,10 @@ install: all
|
||||
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 6711 mbnewusr ${BINDIR}
|
||||
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mball ${BINDIR}
|
||||
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mblang ${BINDIR}
|
||||
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbchat ${BINDIR}
|
||||
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbstat ${BINDIR}
|
||||
${INSTALL} -c -s -o ${OWNER} -g ${GROUP} -m 0711 mbtoberep ${BINDIR}
|
||||
${INSTALL} -c -s -o `id -un` -g `id -gn` -m 6711 mbuser ${BINDIR}
|
||||
@rm -f mbuseradd mbpasswd mblogin
|
||||
@rm -f mbuseradd mbpasswd mblogin mbchat
|
||||
|
||||
filelist: Makefile
|
||||
BASE=`pwd`; \
|
||||
@@ -164,7 +157,6 @@ lastcallers.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/
|
||||
timeout.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h timeout.h funcs.h bye.h filesub.h language.h
|
||||
chat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h chat.h funcs.h input.h language.h misc.h whoson.h
|
||||
file.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h filesub.h file.h funcs.h input.h language.h misc.h timeout.h exitinfo.h whoson.h change.h
|
||||
mbchat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h
|
||||
mbstat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/mberrors.h mbstat.h
|
||||
misc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h funcs.h input.h language.h misc.h timeout.h exitinfo.h
|
||||
offline.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/mbse.h ../lib/users.h ../lib/records.h ../lib/bluewave.h ../lib/common.h ../lib/clcomm.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h input.h language.h file.h filesub.h exitinfo.h timeout.h msgutil.h pop3.h offline.h whoson.h
|
||||
|
@@ -49,9 +49,7 @@
|
||||
#define DEVICE "/tmp/chatdev"
|
||||
|
||||
|
||||
|
||||
|
||||
void Chat(void)
|
||||
void Chat(int channel)
|
||||
{
|
||||
FILE *pGetDev, *pLog, *pBusy, *pChat;
|
||||
int ch;
|
||||
@@ -60,7 +58,7 @@ void Chat(void)
|
||||
char *sLog = NULL;
|
||||
char temp[81] = "";
|
||||
|
||||
if(CFG.iAutoLog)
|
||||
if (CFG.iAutoLog)
|
||||
sLog = calloc(56, sizeof(char));
|
||||
|
||||
WhosDoingWhat(SYSOPCHAT);
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#ifndef _CHAT_H
|
||||
#define _CHAT_H
|
||||
|
||||
void Chat(void); /* Chat Function */
|
||||
/* $Id$ */
|
||||
|
||||
void Chat(int); /* Chat Function */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
259
mbsebbs/mbchat.c
259
mbsebbs/mbchat.c
@@ -1,259 +0,0 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
* Purpose ...............: Sysop chat utility.
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
*
|
||||
* Michiel Broek FIDO: 2:2801/2802
|
||||
* Beekmansbos 10
|
||||
* 1971 BV IJmuiden
|
||||
* the Netherlands
|
||||
*
|
||||
* This file is part of MBSE BBS.
|
||||
*
|
||||
* This BBS is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* MBSE BBS is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with MBSE BBS; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../config.h"
|
||||
#include "../lib/libs.h"
|
||||
#include "../lib/memwatch.h"
|
||||
#include "../lib/structs.h"
|
||||
#include "../lib/common.h"
|
||||
#include "../lib/clcomm.h"
|
||||
#include "../lib/mberrors.h"
|
||||
|
||||
|
||||
char *ttime2(void); /* Returns current time HH:MM */
|
||||
|
||||
struct sysconfig CFG;
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
FILE *fp1, *pChatDev, *pPid, *pLog;
|
||||
FILE *pDataFile;
|
||||
int ch;
|
||||
int iLetter = 0;
|
||||
short ipid;
|
||||
char *tty;
|
||||
char *sStr1= (char *)"";
|
||||
char pid[81];
|
||||
char pid1[20];
|
||||
char sTTY[10];
|
||||
char *sLog= (char *)"";
|
||||
char *Config, *FileName, *LogName;
|
||||
char *BBSpath;
|
||||
|
||||
#ifdef MEMWATCH
|
||||
mwInit();
|
||||
#endif
|
||||
|
||||
FileName = calloc(PATH_MAX, sizeof(char));
|
||||
Config = calloc(PATH_MAX, sizeof(char));
|
||||
LogName = calloc(PATH_MAX, sizeof(char));
|
||||
|
||||
if ((BBSpath = getenv("MBSE_ROOT")) == NULL) {
|
||||
printf("Could not get MBSE_ROOT environment variable\n");
|
||||
printf("Please set the environment variable ie:\n\n");
|
||||
printf("\"MBSE_ROOT=/usr/local/mbse;export MBSE_ROOT\"\n\n");
|
||||
#ifdef MEMWATCH
|
||||
mwTerm();
|
||||
#endif
|
||||
exit(MBERR_INIT_ERROR);
|
||||
}
|
||||
|
||||
sprintf(FileName, "%s/etc/config.data", BBSpath);
|
||||
|
||||
if ((pDataFile = fopen(FileName, "rb")) == NULL) {
|
||||
perror("\n\nFATAL ERROR: Can't open config.data for reading!!!");
|
||||
printf("Please run mbsetup to create configuration file.\n");
|
||||
printf("Or check that your MBSE_ROOT variable is set to the BBS Path!\n");
|
||||
#ifdef MEMWATCH
|
||||
mwTerm();
|
||||
#endif
|
||||
exit(MBERR_CONFIG_ERROR);
|
||||
}
|
||||
fread(&CFG, sizeof(CFG), 1, pDataFile);
|
||||
fclose(pDataFile);
|
||||
free(Config);
|
||||
free(FileName);
|
||||
|
||||
if(CFG.iAutoLog)
|
||||
sLog = calloc(56, sizeof(char));
|
||||
|
||||
if(argc != 2) {
|
||||
printf("\nSCHAT: MBSE BBS %s Sysop chat facilty\n", VERSION);
|
||||
printf(" %s\n", COPYRIGHT);
|
||||
|
||||
printf("\nCommand-line parameters:\n\n");
|
||||
|
||||
printf(" %s <device>", *(argv));
|
||||
|
||||
printf("\n");
|
||||
#ifdef MEMWATCH
|
||||
mwTerm();
|
||||
#endif
|
||||
exit(MBERR_COMMANDLINE);
|
||||
}
|
||||
|
||||
printf("\f");
|
||||
|
||||
if (strncmp( (tty = *(argv+1)), "/dev/", 5 ) == 0 ) {
|
||||
tty+=5;
|
||||
sprintf(pid,"%s/bbs/exitinfo", CFG.bbs_usersdir);
|
||||
strcpy(sTTY,"");
|
||||
} else {
|
||||
sprintf(pid,"%s/bbs/exitinfo", CFG.bbs_usersdir);
|
||||
strcpy(sTTY,"/dev/");
|
||||
}
|
||||
|
||||
strcat(sTTY, *(argv + 1));
|
||||
|
||||
if(( fp1 = fopen(sTTY,"w")) == NULL)
|
||||
perror("Error");
|
||||
|
||||
if(( pPid = fopen(pid,"r")) == NULL) {
|
||||
printf("\nThere is no user on %s\n", pid);
|
||||
#ifdef MEMWATCH
|
||||
mwTerm();
|
||||
#endif
|
||||
exit(MBERR_COMMANDLINE);
|
||||
} else {
|
||||
fgets(pid1,19,pPid);
|
||||
fclose(pPid);
|
||||
}
|
||||
|
||||
ipid = atoi(pid1);
|
||||
|
||||
if(( pChatDev = fopen("/tmp/chatdev","w")) == NULL)
|
||||
perror("Can't open file");
|
||||
else {
|
||||
sStr1=ttyname(1);
|
||||
fprintf(pChatDev,"%s", sStr1);
|
||||
fclose(pChatDev);
|
||||
}
|
||||
|
||||
if(!CFG.iExternalChat || (strlen(CFG.sExternalChat) < 1) || \
|
||||
(access(CFG.sExternalChat, X_OK) != 0)) {
|
||||
printf("Users chatting device: %s\n", sTTY);
|
||||
printf("Wait until the user is ready");
|
||||
printf("Press ESC to exit chat\n\n");
|
||||
|
||||
umask(00000);
|
||||
chmod("/tmp/chatdev", 00777);
|
||||
chmod(sStr1, 00777);
|
||||
|
||||
sleep(2);
|
||||
|
||||
Setraw();
|
||||
|
||||
sleep(2);
|
||||
|
||||
while (1) {
|
||||
ch = getc(stdin);
|
||||
ch &= '\377';
|
||||
if (ch == '\033')
|
||||
break;
|
||||
putchar(ch);
|
||||
putc(ch, fp1);
|
||||
|
||||
if(CFG.iAutoLog) {
|
||||
if(ch != '\b')
|
||||
iLetter++; /* Count the letters user presses for logging */
|
||||
sprintf(sLog, "%s%c", sLog, ch);
|
||||
}
|
||||
|
||||
if (ch == '\n') {
|
||||
ch = '\r';
|
||||
putchar(ch);
|
||||
putc(ch, fp1);
|
||||
}
|
||||
|
||||
if (ch == '\r') {
|
||||
ch = '\n';
|
||||
putchar(ch);
|
||||
putc(ch, fp1);
|
||||
}
|
||||
|
||||
if (ch == '\b') {
|
||||
ch = ' ';
|
||||
putchar(ch);
|
||||
putc(ch, fp1);
|
||||
ch = '\b';
|
||||
putchar(ch);
|
||||
putc(ch, fp1);
|
||||
|
||||
if(CFG.iAutoLog)
|
||||
sLog[--iLetter] = '\0';
|
||||
}
|
||||
|
||||
/* Check if log chat is on and if so log chat to disk */
|
||||
if(CFG.iAutoLog) {
|
||||
if(iLetter >= 55 || ch == '\n') {
|
||||
iLetter = 0;
|
||||
sprintf(LogName, "%s/log/chat.log", BBSpath);
|
||||
if(( pLog = fopen(LogName, "a+")) != NULL) {
|
||||
fflush(pLog);
|
||||
fprintf(pLog, "%s [%s]: %s\n", CFG.sysop_name, ttime2(), sLog);
|
||||
fclose(pLog);
|
||||
strcpy(sLog, "");
|
||||
} else
|
||||
perror("\nCan't open chat.log");
|
||||
}
|
||||
}
|
||||
} /* while chatting */
|
||||
// fprintf(fp1, "The sysop ended the chat, press a key.\n");
|
||||
} else {
|
||||
system(CFG.sExternalChat);
|
||||
printf("\n\n");
|
||||
}
|
||||
|
||||
fclose(fp1);
|
||||
sleep(2);
|
||||
Unsetraw();
|
||||
sleep(2);
|
||||
unlink("/tmp/chatdev");
|
||||
unlink("/tmp/.BusyChatting");
|
||||
fclose(fp1);
|
||||
printf("Done chatting.\n");
|
||||
#ifdef MEMWATCH
|
||||
mwTerm();
|
||||
#endif
|
||||
exit(MBERR_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This function returns the date for today, to test against other functions
|
||||
* HH:MM (HOUR-MINUTE)
|
||||
*/
|
||||
char *ttime2()
|
||||
{
|
||||
struct tm *l_date; /* Structure for Date */
|
||||
time_t Time_Now;
|
||||
static char Ttime2[9];
|
||||
|
||||
Time_Now = time(NULL);
|
||||
l_date = localtime(&Time_Now);
|
||||
|
||||
sprintf(Ttime2, "%02d:%02d", l_date->tm_hour,l_date->tm_min);
|
||||
|
||||
return(Ttime2);
|
||||
}
|
||||
|
||||
|
@@ -196,8 +196,8 @@ void menu()
|
||||
* before calling chat(). Make sure if a second user
|
||||
* logs in, that .BusyChatting does exist.
|
||||
*/
|
||||
if(CFG.iChatPromptChk && (access("/tmp/chatdev", R_OK) == 0) && (access("/tmp/.BusyChatting", F_OK) != 0))
|
||||
Chat();
|
||||
if (CFG.iChatPromptChk && (access("/tmp/chatdev", R_OK) == 0) && (access("/tmp/.BusyChatting", F_OK) != 0))
|
||||
Chat(0);
|
||||
|
||||
/*
|
||||
* Check users timeleft
|
||||
|
153
mbsebbs/page.c
153
mbsebbs/page.c
@@ -47,19 +47,22 @@
|
||||
#include "language.h"
|
||||
|
||||
|
||||
extern pid_t mypid;
|
||||
|
||||
|
||||
/*
|
||||
* Function to Page Sysop
|
||||
*/
|
||||
void Page_Sysop(char *String)
|
||||
{
|
||||
FILE *pWritingDevice;
|
||||
int i, iOpenDevice = FALSE; /* Flag to check if you can write to CFG.sChatDevice */
|
||||
char *Reason, temp[81];
|
||||
int i;
|
||||
char *Reason, temp[81];
|
||||
static char buf[128];
|
||||
|
||||
Reason = calloc(81, sizeof(char));
|
||||
|
||||
clear();
|
||||
colour(12, 0);
|
||||
colour(LIGHTRED, BLACK);
|
||||
/* MBSE BBS Chat */
|
||||
Center((char *) Language(151));
|
||||
|
||||
@@ -99,24 +102,10 @@ void Page_Sysop(char *String)
|
||||
|
||||
Syslog('+', "Chat Reason: %s", temp);
|
||||
strcpy(Reason, temp);
|
||||
} else {
|
||||
sprintf(Reason, "User want's to chat");
|
||||
}
|
||||
|
||||
// if (access("/tmp/.BusyChatting", F_OK) == 0) {
|
||||
// if((pBusy = fopen("/tmp/.BusyChatting", "r")) == NULL)
|
||||
// WriteError("Unable to open BusyChatting file", pTTY);
|
||||
// else {
|
||||
// fscanf(pBusy, "%10s", temp);
|
||||
// fclose(pBusy);
|
||||
// }
|
||||
// colour(13, 0);
|
||||
// printf("%s%s\n", (char *) Language(152), temp);
|
||||
// pout(10, 0, (char *) Language(153));
|
||||
// Enter(2);
|
||||
// Syslog('+', "SysOp was busy chatting to user on %s", temp);
|
||||
// Pause();
|
||||
// free(Reason);
|
||||
// return;
|
||||
// }
|
||||
|
||||
CFG.iMaxPageTimes--;
|
||||
|
||||
@@ -124,70 +113,106 @@ void Page_Sysop(char *String)
|
||||
if (!DisplayFile((char *)"maxpage")) {
|
||||
/* If i is FALSE display hard coded message */
|
||||
Enter(1);
|
||||
/* You have paged the Sysop the maximum times allowed. */
|
||||
pout(WHITE, BLACK, (char *) Language(154));
|
||||
Enter(2);
|
||||
}
|
||||
|
||||
Syslog('!', "Attempted to page Sysop, above maximum page limit.");
|
||||
Pause();
|
||||
} else {
|
||||
locate(14, ((80 - strlen(String) ) / 2 - 2));
|
||||
pout(WHITE, BLACK, (char *)"[");
|
||||
pout(LIGHTGRAY, BLACK, String);
|
||||
pout(WHITE, BLACK, (char *)"]");
|
||||
free(Reason);
|
||||
return;
|
||||
}
|
||||
|
||||
locate(14, ((80 - strlen(String) ) / 2 - 2));
|
||||
pout(WHITE, BLACK, (char *)"[");
|
||||
pout(LIGHTGRAY, BLACK, String);
|
||||
pout(WHITE, BLACK, (char *)"]");
|
||||
|
||||
locate(16, ((80 - CFG.iPageLength) / 2 - 2));
|
||||
pout(WHITE, BLACK, (char *)"[");
|
||||
colour(BLUE, BLACK);
|
||||
for (i = 0; i < CFG.iPageLength; i++)
|
||||
printf("%c", 176);
|
||||
pout(WHITE, BLACK, (char *)"]");
|
||||
locate(16, ((80 - CFG.iPageLength) / 2 - 2));
|
||||
pout(WHITE, BLACK, (char *)"[");
|
||||
colour(BLUE, BLACK);
|
||||
for (i = 0; i < CFG.iPageLength; i++)
|
||||
printf("%c", 176);
|
||||
pout(WHITE, BLACK, (char *)"]");
|
||||
|
||||
locate(16, ((80 - CFG.iPageLength) / 2 - 2) + 1);
|
||||
locate(16, ((80 - CFG.iPageLength) / 2 - 2) + 1);
|
||||
|
||||
if ((pWritingDevice = fopen(CFG.sChatDevice, "w")) != NULL) {
|
||||
fprintf(pWritingDevice, "\n\n\n%s is trying to page you on %s.\n", \
|
||||
usrconfig.sUserName, pTTY);
|
||||
sprintf(buf, "CPAG:2,%d,%s;", mypid, Reason);
|
||||
if (socket_send(buf)) {
|
||||
Syslog('+', "Failed to send message to mbtask");
|
||||
free(Reason);
|
||||
return;
|
||||
}
|
||||
strcpy(buf, socket_receive());
|
||||
|
||||
fprintf(pWritingDevice, "Type: '%s/bin/schat %s' to talk to him, you have", \
|
||||
getenv("MBSE_ROOT"), pTTY);
|
||||
fprintf(pWritingDevice, "\n%d seconds to respond!\n\n", CFG.iPageLength);
|
||||
fprintf(pWritingDevice, "%s\n", temp);
|
||||
iOpenDevice = TRUE;
|
||||
}
|
||||
/*
|
||||
* Check if sysop is busy
|
||||
*/
|
||||
if (strcmp(buf, "100:1,1;") == 0) {
|
||||
/* The SysOp is currently speaking to somebody else */
|
||||
pout(LIGHTMAGENTA, BLACK, (char *) Language(152));
|
||||
/* Try paging him again in a few minutes ... */
|
||||
pout(LIGHTGREEN, BLACK, (char *) Language(153));
|
||||
Enter(2);
|
||||
Syslog('+', "SysOp was busy chatting with another user");
|
||||
Pause();
|
||||
free(Reason);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if sysop is not available
|
||||
*/
|
||||
if (strcmp(buf, "100:1,2;") == 0) {
|
||||
Syslog('+', "Sysop is not available for chat");
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for other errors
|
||||
*/
|
||||
if (strcmp(buf, "100:1,3;") == 0) {
|
||||
colour(LIGHTRED, BLACK);
|
||||
printf("Internal system error, the sysop is informed");
|
||||
Enter(2);
|
||||
Syslog('!', "Got error on page sysop command");
|
||||
Pause();
|
||||
free(Reason);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(buf, "100:0;") == 0) {
|
||||
/*
|
||||
* Page accpeted, wait until sysop responds
|
||||
*/
|
||||
colour(LIGHTBLUE, BLACK);
|
||||
for (i = 0; i < CFG.iPageLength; i++) {
|
||||
printf("\x07");
|
||||
/* If there weren't any problems opening the writing device */
|
||||
if (iOpenDevice) {
|
||||
fprintf(pWritingDevice, "\x07");
|
||||
fflush(pWritingDevice);
|
||||
}
|
||||
printf("%c", 219);
|
||||
fflush(stdout);
|
||||
sleep(1);
|
||||
if (access("/tmp/chatdev", R_OK) == 0) {
|
||||
fclose(pWritingDevice);
|
||||
Chat();
|
||||
free(Reason);
|
||||
return;
|
||||
}
|
||||
|
||||
// if drop into chat
|
||||
// Chat();
|
||||
// free(Reason);
|
||||
// return;
|
||||
}
|
||||
|
||||
if (iOpenDevice) {
|
||||
fclose(pWritingDevice);
|
||||
iOpenDevice = 0;
|
||||
}
|
||||
PageReason();
|
||||
printf("\n\n\n");
|
||||
Pause();
|
||||
if (strlen(Reason))
|
||||
SysopComment(Reason);
|
||||
else
|
||||
SysopComment((char *)"Failed chat");
|
||||
/*
|
||||
* Cancel page request
|
||||
*/
|
||||
sprintf(buf, "CCAN:1,%d", mypid);
|
||||
socket_send(buf);
|
||||
strcpy(buf, socket_receive());
|
||||
}
|
||||
|
||||
PageReason();
|
||||
printf("\n\n\n");
|
||||
Pause();
|
||||
if (strlen(Reason))
|
||||
SysopComment(Reason);
|
||||
else
|
||||
SysopComment((char *)"Failed chat");
|
||||
|
||||
free(Reason);
|
||||
Pause();
|
||||
}
|
||||
|
Reference in New Issue
Block a user