Author: DNB
Date: Mon Apr 18 01:10:14 2005
New Revision: 79
Modified:
branches/3.0/ChangeLog
branches/3.0/RELNOTES
branches/3.0/TriviaChan.c
branches/3.0/TriviaCmds.c
branches/3.0/TriviaQues.c
branches/3.0/TriviaServ.c
branches/3.0/TriviaServ.h
branches/3.0/TriviaServ_help.c
branches/3.0/TriviaUser.c
branches/3.0/configure
branches/3.0/configure.in
branches/3.0/modconfigwin32.h
Log:
extra chanalerts and log messages
update copyright
update version number
allow channel config for question colour/bold/case
allow channel configuration for hint character
Modified: branches/3.0/ChangeLog
==============================================================================
--- branches/3.0/ChangeLog (original)
+++ branches/3.0/ChangeLog Mon Apr 18 01:10:14 2005
@@ -2,6 +2,9 @@
Fish (F), Mark (M), DeadNotBuried (D)
==============================================================================
3.0.a3-dev
+ - add extra chanalerts and log messages (D)
+ - add colour/bold/case and hint character configuration per channel (D)
+ - update copyright (D)
- allow NS_ULEVEL_ADMIN access to Channel Op commands always (D)
- remove BOT_FLAG_RESTRICT_OPERS so channel ops can use channel commands
to set channel options (D)
Modified: branches/3.0/RELNOTES
==============================================================================
--- branches/3.0/RELNOTES (original)
+++ branches/3.0/RELNOTES Mon Apr 18 01:10:14 2005
@@ -1,30 +1,30 @@
-* TriviaServ * M & Fish * Version 3.0.a2
-==============================================================================
-Important information you should know: (READ THIS!)
-==============================================================================
-
-This is an alpha release. Not all features will work and there may be major
-bugs in the software. This release is purely for us to get feedback on the new
-version of NeoStats and should not be run on production networks. This release
-is ideal for users with test networks or those that want an opportunity to
-help us develop the new version with feedback and suggestions.
-
-No support is provided for this release so if you have problems and are unable
-to resolve them using the provided documentation, you should use the supported
-stable 2.5 series instead until NeoStats 3.0 is further along.
-
-Bugs, requests and suggestions should be reported using the bug tracking
-system. You must provide all information required as listed in the README
-section on support or your entry will be removed.
-
-Settings and data files from 2.5.x will not work with 3.0. Settings for a1
-may not be compatible with this version. You should delete all files with
-"config" in the filename from the directory ~/NeoStats 3.0/data before
-using this version.
-
-Known issues that we are aware of and should not be reported:
-
-* On BSD you may get a warning during compilation similar to:
+* TriviaServ * M & Fish * Version 3.0.a3-dev
+==============================================================================
+Important information you should know: (READ THIS!)
+==============================================================================
+
+This is an alpha release. Not all features will work and there may be major
+bugs in the software. This release is purely for us to get feedback on the new
+version of NeoStats and should not be run on production networks. This release
+is ideal for users with test networks or those that want an opportunity to
+help us develop the new version with feedback and suggestions.
+
+No support is provided for this release so if you have problems and are unable
+to resolve them using the provided documentation, you should use the supported
+stable 2.5 series instead until NeoStats 3.0 is further along.
+
+Bugs, requests and suggestions should be reported using the bug tracking
+system. You must provide all information required as listed in the README
+section on support or your entry will be removed.
+
+Settings and data files from 2.5.x will not work with 3.0. Settings for a1
+may not be compatible with this version. You should delete all files with
+"config" in the filename from the directory ~/NeoStats 3.0/data before
+using this version.
+
+Known issues that we are aware of and should not be reported:
+
+* On BSD you may get a warning during compilation similar to:
* /usr/include/sys/dir.h:41: warning: #warning "The information in this file
should be obtained from <dirent.h>"
* /usr/include/sys/dir.h:42: warning: #warning "and is provided solely (and
Modified: branches/3.0/TriviaChan.c
==============================================================================
--- branches/3.0/TriviaChan.c (original)
+++ branches/3.0/TriviaChan.c Mon Apr 18 01:10:14 2005
@@ -1,5 +1,5 @@
/* NeoStats - IRC Statistical Services
-** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington
+** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington, DeadNotBuried
** http://www.neostats.net/
**
** Portions Copyright (c) 2000-2001 ^Enigma^
@@ -92,6 +92,12 @@
tc->opchan = 1;
tc->resettype = 0;
tc->lastreset = me.now;
+ tc->foreground = 4;
+ tc->background = 1;
+ tc->boldcase = 0;
+ tc->hintcolour = 0;
+ tc->messagecolour = 0;
+ tc->hintchar = '-';
SetChannelModValue (c, tc);
tc->qfl = list_create(-1);
hnode_create_insert (tch, tc, tc->name);
Modified: branches/3.0/TriviaCmds.c
==============================================================================
--- branches/3.0/TriviaCmds.c (original)
+++ branches/3.0/TriviaCmds.c Mon Apr 18 01:10:14 2005
@@ -1,5 +1,5 @@
/* NeoStats - IRC Statistical Services
-** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington
+** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington, DeadNotBuried
** http://www.neostats.net/
**
** Portions Copyright (c) 2000-2001 ^Enigma^
@@ -96,7 +96,7 @@
tc->active = 1;
tc->curquest = NULL;
irc_prefmsg (tvs_bot, cmdparams->source, "Starting Trivia in %s shortly", tc->name);
- irc_chanprivmsg (tvs_bot, tc->name, "%s has activated Trivia. Get Ready for the first question!", cmdparams->source->name);
+ irc_chanprivmsg (tvs_bot, tc->name, "\003%d%s%s \003%dhas activated Trivia. Get Ready for the first question!", tc->hintcolour, (tc->boldcase %2) ? "\002" : "", cmdparams->source->name, tc->messagecolour);
} else {
irc_prefmsg (tvs_bot, cmdparams->source, "Trivia is already running in %s", tc->name);
}
@@ -125,7 +125,7 @@
tc->curquest = NULL;
}
irc_prefmsg (tvs_bot, cmdparams->source, "Trivia Stoped in %s", tc->name);
- irc_chanprivmsg (tvs_bot, tc->name, "%s has stopped Trivia.", cmdparams->source->name);
+ irc_chanprivmsg (tvs_bot, tc->name, "\003%d%s%s \003%dhas stopped Trivia.", tc->hintcolour, (tc->boldcase %2) ? "\002" : "", cmdparams->source->name, tc->messagecolour);
} else {
irc_prefmsg (tvs_bot, cmdparams->source, "Trivia is not currently running in %s", tc->name);
}
@@ -295,6 +295,113 @@
}
/*
+ * Allows Chanops to set colour/bold/underline for questions/hints/etc
+*/
+int tvs_cmd_colour (CmdParams* cmdparams) {
+ TriviaChan *tc;
+ int fg, bg, lc, i;
+
+ /* find if its our channel. */
+ tc = (TriviaChan *)GetChannelModValue (cmdparams->channel);
+ if (!tc) {
+ return NS_FAILURE;
+ }
+ if ((!IsChanOp(cmdparams->channel->name, cmdparams->source->name)) && (cmdparams->source->user->ulevel < NS_ULEVEL_ADMIN)) {
+ /* nope, get lost */
+ return NS_FAILURE;
+ }
+ lc = 0;
+ fg = atoi(cmdparams->av[0]);
+ bg = atoi(cmdparams->av[1]);
+ if ( fg < 0 || fg > 15 ) {
+ irc_prefmsg (tvs_bot, cmdparams->source, "Foreground Colour out of range, Colour codes are from 0 through 15 only.");
+ return NS_FAILURE;
+ }
+ if ( bg < 0 || bg > 15 ) {
+ irc_prefmsg (tvs_bot, cmdparams->source, "Background Colour out of range, Colour codes are from 0 through 15 only.");
+ return NS_FAILURE;
+ }
+ if ( fg == bg ) {
+ irc_prefmsg (tvs_bot, cmdparams->source, "Foreground and Background colours MUST be different.");
+ return NS_FAILURE;
+ }
+ tc->foreground = fg;
+ tc->background = bg;
+ if (cmdparams->ac > 2) {
+ for (i = 2 ; i < cmdparams->ac ; i++) {
+ if (!ircstrcasecmp(cmdparams->av[i], "B")) {
+ if (!lc) {
+ tc->boldcase = 0;
+ }
+ tc->boldcase += 1;
+ lc = 1;
+ }
+ if (!ircstrcasecmp(cmdparams->av[i], "L")) {
+ if (!lc) {
+ tc->boldcase = 0;
+ }
+ tc->boldcase += 2;
+ lc = 1;
+ }
+ if (!ircstrcasecmp(cmdparams->av[i], "U")) {
+ if (!lc) {
+ tc->boldcase = 0;
+ }
+ tc->boldcase += 4;
+ lc = 1;
+ }
+ if (!lc) {
+ if (i == 2) {
+ tc->hintcolour = atoi(cmdparams->av[i]);
+ } else if (i == 3) {
+ tc->messagecolour = atoi(cmdparams->av[i]);
+ }
+ }
+ }
+ }
+ SaveTChan(tc);
+ irc_chanprivmsg (tvs_bot, tc->name, "Question colour updated");
+ return NS_SUCCESS;
+}
+
+/*
+ * Allows Chanops to set hint character used for answers
+*/
+int tvs_cmd_hintchar (CmdParams* cmdparams) {
+ TriviaChan *tc;
+ Questions *qe;
+ int i;
+
+ /* find if its our channel. */
+ tc = (TriviaChan *)GetChannelModValue (cmdparams->channel);
+ if (!tc) {
+ return NS_FAILURE;
+ }
+ if ((!IsChanOp(cmdparams->channel->name, cmdparams->source->name)) && (cmdparams->source->user->ulevel < NS_ULEVEL_ADMIN)) {
+ /* nope, get lost */
+ return NS_FAILURE;
+ }
+ if (strlen(cmdparams->av[0]) > 1) {
+ irc_prefmsg (tvs_bot, cmdparams->source, "Hint Character may only be a single character");
+ return NS_FAILURE;
+ }
+ /* if currently asking question change hint characters */
+ if (tc->curquest) {
+ qe = tc->curquest;
+ for (i=0;i < (int)strlen(qe->lasthint);i++) {
+ if (qe->lasthint[i] == tc->hintchar && qe->answer[i] != tc->hintchar) {
+ qe->lasthint[i] = cmdparams->av[0][0];
+ }
+ }
+ }
+ /* set and save new hint char */
+ tc->hintchar = cmdparams->av[0][0];
+ SaveTChan(tc);
+ irc_chanprivmsg (tvs_bot, tc->name, "Hint Character changed to %s", cmdparams->av[0]);
+ return NS_SUCCESS;
+}
+
+/*
* Lists all Question Sets / Categories available on the network
*/
int tvs_catlist(CmdParams* cmdparams) {
Modified: branches/3.0/TriviaQues.c
==============================================================================
--- branches/3.0/TriviaQues.c (original)
+++ branches/3.0/TriviaQues.c Mon Apr 18 01:10:14 2005
@@ -1,5 +1,5 @@
/* NeoStats - IRC Statistical Services
-** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington
+** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington, DeadNotBuried
** http://www.neostats.net/
**
** Portions Copyright (c) 2000-2001 ^Enigma^
@@ -220,7 +220,7 @@
/* ok, this is bad.. but sigh, not much we can do atm. */
lnode = list_first(qfl);
i = 0;
- while (i != qfn) {
+ while (i < qfn) {
lnode = list_next(qfl, lnode);
i++;
}
@@ -231,7 +231,11 @@
nlog(LOG_WARNING, "Question File Selection (Random) for %s failed. Using first entry", tc->name);
lnode = list_first(qfl);
qf = lnode_get(lnode);
- return qf;
+ if (qf != NULL) {
+ return qf;
+ }
+ nlog(LOG_WARNING, "Question File Selection (Random) for %s failed. Unable to select First Question File", tc->name);
+ return NULL;
}
} else {
/* select a random question file */
@@ -239,7 +243,7 @@
/* ok, this is bad.. but sigh, not much we can do atm. */
lnode = list_first(tc->qfl);
i = 0;
- while (i != qfn) {
+ while (i < qfn) {
lnode = list_next(tc->qfl, lnode);
i++;
}
@@ -250,7 +254,11 @@
nlog(LOG_WARNING, "Question File Selection (Specific) for %s failed. Using first entry", tc->name);
lnode = list_first(tc->qfl);
qf = lnode_get(lnode);
- return qf;
+ if (qf != NULL) {
+ return qf;
+ }
+ nlog(LOG_WARNING, "Question File Selection (Specific) for %s failed. Unable to select First Question File", tc->name);
+ return NULL;
}
}
/* to shut up the compilers */
@@ -263,13 +271,18 @@
* obscured question to the channel
*/
void tvs_newquest(TriviaChan *tc) {
- int qn;
+ int qn, gqt;
lnode_t *qnode;
Questions *qe;
QuestionFiles *qf;
char tmpbuf[512];
qf = tvs_randomquestfile(tc);
+ if (qf == NULL) {
+ irc_chanalert (tvs_bot, "Question File Error for %s , no question file returned", tc->name);
+ return;
+ }
+ gqt = 0;
restartquestionselection:
qn=(unsigned)((rand()%((int)(list_count(qf->QE))))+1);
/* ok, this is bad.. but sigh, not much we can do atm. */
@@ -285,7 +298,12 @@
/* ok, we hopefully have the Q */
if (qe == NULL) {
nlog(LOG_WARNING, "Eh? Never got a Question");
- goto restartquestionselection;
+ if (gqt < 5) {
+ gqt++;
+ irc_chanalert (tvs_bot, "Question Get Error for %s , Error Retrieving Question Pointer for %s (attempt %d)", tc->name, qf->name, gqt);
+ goto restartquestionselection;
+ }
+ return;
}
/* ok, now seek to the question in the file */
if (os_fseek (qf->fn, qe->offset, SEEK_SET)) {
@@ -308,7 +326,7 @@
*/
qe->points = tc->scorepoints;
tc->curquest = qe;
- irc_chanprivmsg (tvs_bot, tc->name, "Fingers on the keyboard, Here comes the Next Question!");
+ irc_chanprivmsg (tvs_bot, tc->name, "\003%d%sFingers on the keyboard, Here comes the Next Question!", tc->messagecolour, (tc->boldcase %2) ? "\002" : "");
obscure_question(tc);
tc->lastquest = me.now;
}
@@ -320,7 +338,7 @@
void tvs_ansquest(TriviaChan *tc) {
Questions *qe;
qe = tc->curquest;
- irc_chanprivmsg (tvs_bot, tc->name, "Times Up! The Answer was: \2%s\2", qe->answer);
+ irc_chanprivmsg (tvs_bot, tc->name, "\003%d%sTimes Up! The Answer was: \003%d%s%s", tc->messagecolour, (tc->boldcase %2) ? "\002" : "", tc->hintcolour, (tc->boldcase %2) ? "" : "\002", qe->answer);
/* so we don't chew up memory too much */
ns_free (qe->regexp);
ns_free (qe->question);
@@ -425,7 +443,8 @@
rc = pcre_exec(qe->regexp, NULL, line, strlen(line), 0, 0, NULL, 0);
if (rc >= 0) {
/* we got a match! */
- irc_chanprivmsg (tvs_bot, tc->name, "Correct! %s got the answer: %s", u->name, qe->answer);
+/* TODO : fix up colours etc when multiple words in answer */
+ irc_chanprivmsg (tvs_bot, tc->name, "\003%d%sCorrect!\003%d %s\003%d got the answer:\003%d %s", tc->messagecolour, (tc->boldcase %2) ? "\002" : "", tc->hintcolour, u->name, tc->messagecolour, tc->hintcolour, qe->answer);
tvs_addpoints(u, tc);
tc->curquest = NULL;
ns_free (qe->regexp);
@@ -457,7 +476,7 @@
/* only replace alphanumeric characters */
num = (int)qe->lasthint[i];
if ((num > 96 && num < 123) || (num > 64 && num < 91) || (num > 47 && num < 58)) {
- qe->lasthint[i] = '-';
+ qe->lasthint[i] = tc->hintchar;
}
}
}
@@ -487,9 +506,19 @@
swlt= 0;
for (i2=ws ; i2 <= we ; i2++) {
num = (int)qe->answer[i2];
- if (qe->lasthint[i2] == '-' && ((num > 96 && num < 123) || (num > 64 && num < 91) || (num > 47 && num < 58))) {
+ if (qe->lasthint[i2] == tc->hintchar && ((num > 96 && num < 123) || (num > 64 && num < 91) || (num > 47 && num < 58))) {
if (swl == swlt) {
- qe->lasthint[i2] = qe->answer[i2];
+ if (tc->boldcase > 1 && ((qe->answer[i2] >= 'a' && qe->answer[i2] <= 'z') || (qe->answer[i2] >= 'A' && qe->answer[i2] <= 'Z'))) {
+ if (tc->boldcase > 3 && qe->answer[i2] > 'Z') {
+ qe->lasthint[i2] = (qe->answer[i2] - ('a' - 'A'));
+ } else if (tc->boldcase > 1 && tc->boldcase < 4 && qe->answer[i2] < 'A') {
+ qe->lasthint[i2] = (qe->answer[i2] + ('a' - 'A'));
+ } else {
+ qe->lasthint[i2] = qe->answer[i2];
+ }
+ } else {
+ qe->lasthint[i2] = qe->answer[i2];
+ }
break;
}
swlt++;
@@ -504,7 +533,7 @@
}
}
qe->hints++;
- irc_chanprivmsg (tvs_bot, tc->name, "Hint %d: %s", qe->hints, qe->lasthint);
+ irc_chanprivmsg (tvs_bot, tc->name, "\003%d%sHint %d: %s", tc->hintcolour, (tc->boldcase %2) ? "\002" : "", qe->hints, qe->lasthint);
}
/*
@@ -512,7 +541,7 @@
*/
void obscure_question(TriviaChan *tc)
{
- char *out;
+ char *out, *tmpcolour, *tmpunseen, *tmpstr;
Questions *qe;
int random, i;
@@ -521,8 +550,35 @@
return;
}
qe = tc->curquest;
+ /* set question colour and hidden letters colour */
+ tmpstr = ns_calloc (BUFSIZE);
+ tmpcolour = ns_calloc (BUFSIZE);
+ strlcpy(tmpcolour, "\003", BUFSIZE);
+ if (tc->foreground < 10) {
+ strlcat(tmpcolour, "0", BUFSIZE);
+ }
+ ircsnprintf(tmpstr, BUFSIZE, "%d,", tc->foreground);
+ strlcat(tmpcolour, tmpstr, BUFSIZE);
+ if (tc->background < 10) {
+ strlcat(tmpcolour, "0", BUFSIZE);
+ }
+ ircsnprintf(tmpstr, BUFSIZE, "%d", tc->background);
+ strlcat(tmpcolour, tmpstr, BUFSIZE);
+ tmpunseen = ns_calloc (BUFSIZE);
+ strlcpy(tmpunseen, "\003", BUFSIZE);
+ if (tc->background < 10) {
+ strlcat(tmpunseen, "0", BUFSIZE);
+ }
+ ircsnprintf(tmpstr, BUFSIZE, "%d,", tc->background);
+ strlcat(tmpunseen, tmpstr, BUFSIZE);
+ if (tc->background < 10) {
+ strlcat(tmpunseen, "0", BUFSIZE);
+ }
+ ircsnprintf(tmpstr, BUFSIZE, "%d", tc->background);
+ strlcat(tmpunseen, tmpstr, BUFSIZE);
+ /* obscure question using definded channel colours, and send to channel */
out = ns_calloc (BUFSIZE+1);
- strlcpy(out, "\00304,01", BUFSIZE);
+ strlcpy(out, tmpcolour, BUFSIZE);
for (i=0;i < (int)strlen(qe->question);i++) {
if (qe->question[i] == ' ') {
/* get random letter */
@@ -531,16 +587,29 @@
random += 5;
}
/* insert same background/foreground color here */
- strlcat(out, "\00301,01", BUFSIZE);
+ strlcat(out, tmpunseen, BUFSIZE);
/* insert random char here */
out[strlen(out)] = random;
/* reset color back to standard for next word. */
- strlcat(out, "\00304,01", BUFSIZE);
+ strlcat(out, tmpcolour, BUFSIZE);
} else {
- /* just insert the char, its a word */
- out[strlen(out)] = qe->question[i];
+ /* insert the char, changing case if required, its a word */
+ if (tc->boldcase > 1 && ((qe->question[i] >= 'a' && qe->question[i] <= 'z') || (qe->question[i] >= 'A' && qe->question[i] <= 'Z'))) {
+ if (tc->boldcase > 3 && qe->question[i] > 'Z') {
+ out[strlen(out)] = (qe->question[i] - ('a' - 'A'));
+ } else if (tc->boldcase > 1 && tc->boldcase < 4 && qe->question[i] < 'a') {
+ out[strlen(out)] = (qe->question[i] + ('a' - 'A'));
+ } else {
+ out[strlen(out)] = qe->question[i];
+ }
+ } else {
+ out[strlen(out)] = qe->question[i];
+ }
}
}
- irc_chanprivmsg (tvs_bot, tc->name, "%s", out);
+ irc_chanprivmsg (tvs_bot, tc->name, "%s%s", (tc->boldcase % 2) ? "\002" : "", out);
+ ns_free (tmpstr);
+ ns_free (tmpcolour);
+ ns_free (tmpunseen);
ns_free (out);
}
Modified: branches/3.0/TriviaServ.c
==============================================================================
--- branches/3.0/TriviaServ.c (original)
+++ branches/3.0/TriviaServ.c Mon Apr 18 01:10:14 2005
@@ -1,5 +1,5 @@
/* NeoStats - IRC Statistical Services
-** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington
+** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington, DeadNotBuried
** http://www.neostats.net/
**
** Portions Copyright (c) 2000-2001 ^Enigma^
@@ -91,6 +91,8 @@
{"PUBLIC", tvs_cmd_pc, 1, 0, tvs_help_pc, tvs_help_pc_oneline, CMD_FLAG_CHANONLY},
{"OPCHAN", tvs_cmd_opchan, 1, 0, tvs_help_opchan, tvs_help_opchan_oneline, CMD_FLAG_CHANONLY},
{"RESETSCORES", tvs_cmd_resetscores, 1, 0, tvs_help_resetscores, tvs_help_resetscores_oneline, CMD_FLAG_CHANONLY},
+ {"COLOUR", tvs_cmd_colour, 2, 0, tvs_help_colour, tvs_help_colour_oneline, CMD_FLAG_CHANONLY},
+ {"HINTCHAR", tvs_cmd_hintchar, 1, 0, tvs_help_hintchar, tvs_help_hintchar_oneline, CMD_FLAG_CHANONLY},
{NULL, NULL, NULL, NULL, NULL, NULL}
};
@@ -427,7 +429,7 @@
}
/* hint processor */
if ((tc->questtime - timediff) < 15) {
- irc_chanprivmsg (tvs_bot, tc->name, "Less than %ld Seconds Remaining, Hurry up!", (long)(tc->questtime - timediff + 10));
+ irc_chanprivmsg (tvs_bot, tc->name, "\003%d%sLess than %ld Seconds Remaining, Hurry up!", tc->messagecolour, (tc->boldcase %2) ? "\002" : "", (long)(tc->questtime - timediff + 10));
continue;
}
do_hint(tc);
Modified: branches/3.0/TriviaServ.h
==============================================================================
--- branches/3.0/TriviaServ.h (original)
+++ branches/3.0/TriviaServ.h Mon Apr 18 01:10:14 2005
@@ -1,5 +1,5 @@
/* NeoStats - IRC Statistical Services
-** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington
+** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington, DeadNotBuried
** http://www.neostats.net/
**
** This program is free software; you can redistribute it and/or modify
@@ -71,13 +71,19 @@
int publiccontrol;
int active;
int scorepoints;
- time_t lastquest;
long questtime;
int opchan;
int resettype;
int lastreset;
- Questions *curquest;
+ int foreground;
+ int background;
+ int boldcase;
+ int hintcolour;
+ int messagecolour;
+ int hintchar;
+ time_t lastquest;
list_t *qfl;
+ Questions *curquest;
} TriviaChan;
typedef struct TriviaChannelQuestionFiles {
@@ -130,6 +136,10 @@
extern const char tvs_help_opchan_oneline[];
extern const char *tvs_help_resetscores[];
extern const char tvs_help_resetscores_oneline[];
+extern const char *tvs_help_colour[];
+extern const char tvs_help_colour_oneline[];
+extern const char *tvs_help_hintchar[];
+extern const char tvs_help_hintchar_oneline[];
/* TriviaUser.c */
void tvs_addpoints(Client *u, TriviaChan *tc);
@@ -150,6 +160,8 @@
int tvs_cmd_pc (CmdParams* cmdparams);
int tvs_cmd_opchan (CmdParams* cmdparams);
int tvs_cmd_resetscores (CmdParams* cmdparams);
+int tvs_cmd_colour (CmdParams* cmdparams);
+int tvs_cmd_hintchar (CmdParams* cmdparams);
int tvs_catlist(CmdParams* cmdparams);
int tvs_chans(CmdParams* cmdparams);
Modified: branches/3.0/TriviaServ_help.c
==============================================================================
--- branches/3.0/TriviaServ_help.c (original)
+++ branches/3.0/TriviaServ_help.c Mon Apr 18 01:10:14 2005
@@ -1,5 +1,5 @@
/* NeoStats - IRC Statistical Services
-** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington
+** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington, DeadNotBuried
** http://www.neostats.net/
**
** This program is free software; you can redistribute it and/or modify
@@ -148,3 +148,32 @@
NULL
};
const char tvs_help_resetscores_oneline[] = "Set time duration to reset Channel scores";
+
+const char *tvs_help_colour[] = {
+ "Syntax: (in Channel only)",
+ " \2!COLOUR <foreground> <background> [<hintcolour>] [<messagecolour>] [B] [U|L]\2",
+ "",
+ "This command Sets the colour of the asked questions, and text",
+ "",
+ "foreground, background, hintcolour and messagecolour",
+ " are standard colour numbers, with no control codes.",
+ "E.G. (White on Black)",
+ "!COLOUR 0 1",
+ "",
+ "B (Bold) Bolds all game text",
+ "U (Uppercase) converts questions and hints to Uppercase.",
+ "L (Lowercase) converts questions and hints to lowercase.",
+ "",
+ "Note: Uppercase Overrides Lowercase processing.",
+ NULL
+};
+const char tvs_help_colour_oneline[] = "Set question colour/bold/case";
+
+const char *tvs_help_hintchar[] = {
+ "Syntax: (in Channel only)",
+ " \2!HINTCHAR <hintcharacter>\2",
+ "",
+ "Sets the hint character replacing letters in the answer",
+ NULL
+};
+const char tvs_help_hintchar_oneline[] = "Set question hint character";
Modified: branches/3.0/TriviaUser.c
==============================================================================
--- branches/3.0/TriviaUser.c (original)
+++ branches/3.0/TriviaUser.c Mon Apr 18 01:10:14 2005
@@ -1,5 +1,5 @@
/* NeoStats - IRC Statistical Services
-** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington
+** Copyright (c) 1999-2005 Adam Rutter, Justin Hammond, Mark Hetherington, DeadNotBuried
** http://www.neostats.net/
**
** Portions Copyright (c) 2000-2001 ^Enigma^
Modified: branches/3.0/configure
==============================================================================
--- branches/3.0/configure (original)
+++ branches/3.0/configure Mon Apr 18 01:10:14 2005
@@ -1259,7 +1259,7 @@
PACKAGE=TriviaServ
MODULE_MAJOR=3
MODULE_MINOR=0
-MODULE_REV=a2
+MODULE_REV=a3-dev
VERSION=$MODULE_MAJOR.$MODULE_MINOR.$MODULE_REV
cat >>confdefs.h <<_ACEOF
#define MODULE_VERSION "$VERSION"
@@ -2310,8 +2310,8 @@
echo "$as_me:$LINENO: result: Compatible version" >&5
echo "${ECHO_T}Compatible version" >&6;
else
- { { echo "$as_me:$LINENO: error: This module requires NeoStats 3.0.a2 or higher" >&5
-echo "$as_me: error: This module requires NeoStats 3.0.a2 or higher" >&2;}
+ { { echo "$as_me:$LINENO: error: This module requires NeoStats 3.0.a3-dev or higher" >&5
+echo "$as_me: error: This module requires NeoStats 3.0.a3-dev or higher" >&2;}
{ (exit 1); exit 1; }; }
fi
Modified: branches/3.0/configure.in
==============================================================================
--- branches/3.0/configure.in (original)
+++ branches/3.0/configure.in Mon Apr 18 01:10:14 2005
@@ -1,90 +1,90 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(TriviaServ.c)
-AC_CONFIG_HEADER(modconfig.h)
-
-PACKAGE=TriviaServ
-MODULE_MAJOR=3
-MODULE_MINOR=0
-MODULE_REV=a2
-VERSION=$MODULE_MAJOR.$MODULE_MINOR.$MODULE_REV
-AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
-AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
-AC_DEFINE_UNQUOTED(MODULE_MINOR, "$MODULE_MINOR")
-AC_DEFINE_UNQUOTED(MODULE_REV, "$MODULE_REV")
-DIRINST=~/NeoStats3.0/
-AC_PREFIX_DEFAULT(~/NeoStats3.0/)
-CFLAGS="$CFLAGS -O2"
-
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(TriviaServ.c)
+AC_CONFIG_HEADER(modconfig.h)
+
+PACKAGE=TriviaServ
+MODULE_MAJOR=3
+MODULE_MINOR=0
+MODULE_REV=a3-dev
+VERSION=$MODULE_MAJOR.$MODULE_MINOR.$MODULE_REV
+AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
+AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
+AC_DEFINE_UNQUOTED(MODULE_MINOR, "$MODULE_MINOR")
+AC_DEFINE_UNQUOTED(MODULE_REV, "$MODULE_REV")
+DIRINST=~/NeoStats3.0/
+AC_PREFIX_DEFAULT(~/NeoStats3.0/)
+CFLAGS="$CFLAGS -O2"
+
case "$host_os" in
*openbsd*)
- MAKEDEPENDENCIES="";;
+ MAKEDEPENDENCIES="";;
*freebsd*)
- MAKEDEPENDENCIES="";;
-*)
- MAKEDEPENDENCIES="-include \$(OBJS:.o=.d)";;
+ MAKEDEPENDENCIES="";;
+*)
+ MAKEDEPENDENCIES="-include \$(OBJS:.o=.d)";;
esac
-AC_MSG_CHECKING(Location of NeoStats...)
-AC_ARG_WITH(neostats,
-[ --with-neostats=DIR Location of NeoStats installation],
-[DIRINST=$withval])
-AC_MSG_RESULT($DIRINST)
-
-AC_CHECK_FILE($DIRINST/include/neostats.h,
-[INCLUDEDIR="$DIRINST/include/"],
-[AC_MSG_ERROR(Can't find existing NeoStats Installation please supply with --with-neostats option)])
-
-CPPFLAGS="$CPPFLAGS -I$INCLUDEDIR"
-dnl Check we are running the latest supported version of NeoStats
-AC_MSG_CHECKING(Version of NeoStats...)
-AC_TRY_RUN(
-[
-#include <config.h>
-#include <stdlib.h>
-int main(void) {
- if (MAJOR >= 3) {
- if (MINOR >= 0) {
- exit(0);
- }
- }
- exit(1);
-}
-], ns_version_ok='yes',
- ns_version_ok='no',
- ns_version_ok='no')
-if test "$ns_version_ok" = "yes"; then
- AC_MSG_RESULT(Compatible version);
-else
- AC_MSG_ERROR(This module requires NeoStats 3.0.a2 or higher)
-fi
-
-dnl check if we are running with debug....
-AC_MSG_CHECKING(Whether to enable debug...)
-AC_ARG_ENABLE(debug,
-[ --enable-debug - enable debug],
-[ case "$enableval" in
- yes)
- CFLAGS="$CFLAGS -Wall -ggdb"
- AC_DEFINE(DEBUG,1)
- AC_MSG_RESULT(yes)
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac],
-AC_MSG_RESULT(no)
-)
-
-dnl Checks for programs.
-AC_PROG_CC
-AC_PROG_INSTALL
-
-AC_SUBST(DIRINST)
-AC_SUBST(MAKEDEPENDENCIES)
-AC_SUBST(CFLAGS)
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-AC_OUTPUT(Makefile)
+AC_MSG_CHECKING(Location of NeoStats...)
+AC_ARG_WITH(neostats,
+[ --with-neostats=DIR Location of NeoStats installation],
+[DIRINST=$withval])
+AC_MSG_RESULT($DIRINST)
+
+AC_CHECK_FILE($DIRINST/include/neostats.h,
+[INCLUDEDIR="$DIRINST/include/"],
+[AC_MSG_ERROR(Can't find existing NeoStats Installation please supply with --with-neostats option)])
+
+CPPFLAGS="$CPPFLAGS -I$INCLUDEDIR"
+dnl Check we are running the latest supported version of NeoStats
+AC_MSG_CHECKING(Version of NeoStats...)
+AC_TRY_RUN(
+[
+#include <config.h>
+#include <stdlib.h>
+int main(void) {
+ if (MAJOR >= 3) {
+ if (MINOR >= 0) {
+ exit(0);
+ }
+ }
+ exit(1);
+}
+], ns_version_ok='yes',
+ ns_version_ok='no',
+ ns_version_ok='no')
+if test "$ns_version_ok" = "yes"; then
+ AC_MSG_RESULT(Compatible version);
+else
+ AC_MSG_ERROR(This module requires NeoStats 3.0.a3-dev or higher)
+fi
+
+dnl check if we are running with debug....
+AC_MSG_CHECKING(Whether to enable debug...)
+AC_ARG_ENABLE(debug,
+[ --enable-debug - enable debug],
+[ case "$enableval" in
+ yes)
+ CFLAGS="$CFLAGS -Wall -ggdb"
+ AC_DEFINE(DEBUG,1)
+ AC_MSG_RESULT(yes)
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ esac],
+AC_MSG_RESULT(no)
+)
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+
+AC_SUBST(DIRINST)
+AC_SUBST(MAKEDEPENDENCIES)
+AC_SUBST(CFLAGS)
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+AC_OUTPUT(Makefile)
echo "Configuration complete."
read -p "Press Enter key to read the release notes"
clear
Modified: branches/3.0/modconfigwin32.h
==============================================================================
--- branches/3.0/modconfigwin32.h (original)
+++ branches/3.0/modconfigwin32.h Mon Apr 18 01:10:14 2005
@@ -3,7 +3,7 @@
/* #undef DEBUG */
/* Version number of package */
-#define MODULE_VERSION "3.0.a2"
+#define MODULE_VERSION "3.0.a3-dev"
/* Major Version */
#define MODULE_MAJOR "3"
@@ -12,4 +12,4 @@
#define MODULE_MINOR "0"
/* Revision */
-#define MODULE_REV "a2"
+#define MODULE_REV "a3-dev"
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.