apply diff file from deadnotburied
This commit is contained in:
parent
15a24799e4
commit
55ceefd2fb
4 changed files with 146 additions and 13 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,6 +1,18 @@
|
|||
WarServ ChangeLog
|
||||
=============================================================================
|
||||
1.2 - DeadNotBuried
|
||||
- added Installation Instructions to Readme file
|
||||
- fixed version number displayed in !rules
|
||||
- added explanation of games to !rules
|
||||
- configure.in updated version number
|
||||
- updated license details in source files
|
||||
- !stop now calls correct procedure
|
||||
- channel seetting now requires user level 180 or above
|
||||
|
||||
1.1
|
||||
- added code to enable !stop command
|
||||
|
||||
1.0 - Fish
|
||||
- Initial Release. Code Contributed by DeadNotBurried (idontwantthisshit@hotmail.com)
|
||||
- Make game channel configurable.
|
||||
- Standardize on hostname.
|
||||
- Standardize on hostname.
|
||||
|
|
103
README.WarServ
103
README.WarServ
|
@ -1,6 +1,99 @@
|
|||
WarServ 1.0
|
||||
=====================================================================
|
||||
Sorry. No Doco Yet. Hopefully someone will write some for us.
|
||||
|
||||
This module was contributed by DeadNotBurried
|
||||
(idontwantthisshit@hotmail.com)
|
||||
WarServ Manual
|
||||
_________________________________________________________________
|
||||
|
||||
1. Prerequisites and Installation.
|
||||
|
||||
1.1. Compiling and Installation
|
||||
|
||||
2. Basic Configuration
|
||||
|
||||
3. Operational Commands
|
||||
|
||||
Welcome to the WarServ Manual. This document will aid you in
|
||||
setting up and running WarServ on your IRC network.
|
||||
|
||||
WarServ is a Game Service that plays the War Card Game.
|
||||
|
||||
Unlike the real Card Game, up to 10 players can play at once, and
|
||||
any card may be played. Otherwise the game is the same.
|
||||
|
||||
Basic Game Description:
|
||||
The Object is to hold all cards in the deck.
|
||||
Each player plays a card in turn (without seeing what the card is
|
||||
untill it has been played), the highest card wins the hand, and keeps
|
||||
all the played cards.
|
||||
When two or more players play the same card, (eg kings) War is
|
||||
declared, and each player involved in the War must then play 3 cards
|
||||
untill there is a winner, or a player doesn't have enough cards.
|
||||
|
||||
1. Prerequisites and Installation.
|
||||
|
||||
WarServ is designed to run on Top of NeoStats.
|
||||
Please refer to the NeoStats website for more
|
||||
information on the requirements for NeoStats.
|
||||
|
||||
WarServ requires the following:
|
||||
* NeoStats 2.5.15 or Higher correctly installed and Running
|
||||
* The time to read this entire document.
|
||||
|
||||
|
||||
1.1. Compiling and Installation
|
||||
|
||||
As long as you have successfully setup NeoStats, and installed it
|
||||
correctly, Compiling WarServ is very simple and straight forward. First
|
||||
you must extract the files from the download package. This is as
|
||||
simple as:
|
||||
bash$ tar -xzf WarServ-<ver>.tar.gz
|
||||
|
||||
This should then create a directory called WarServ-<version> where
|
||||
<version> is the Version of WarServ. Then Proceed to Change into the WarServ
|
||||
directory, and run Configure as follows:
|
||||
bash$./configure [--with-neostats=<dir>]
|
||||
|
||||
--with-neostats=<dir> should be used if your neostats directory is not
|
||||
in a standard location (~/NeoStats/). Replace <dir> with the full path
|
||||
to your NeoStats installation directory (NOT SOURCE DIRECTORY)
|
||||
|
||||
If the configuration did not produce a error, you may then move onto
|
||||
Compiling WarServ. Compiling is simply just issuing the "make" command
|
||||
(or "gmake" if you are running BSD):
|
||||
|
||||
Again, check for Error messages. As long as there are not error
|
||||
messages, "make install" will install WarServ, this README file, and any
|
||||
auxiluary files needed into your NeoStats directory:
|
||||
|
||||
Once Installation is complete, you can either configure NeoStats to
|
||||
load WarServ when it starts, or load WarServ via IRC.
|
||||
|
||||
To Configure NeoStats to automatically load WarServ when it boots, add
|
||||
the following line to your "neostats.cfg" file in the NeoStats
|
||||
directory:
|
||||
|
||||
LOAD_MODULE WarServ
|
||||
|
||||
To load WarServ via IRC, you must make sure you have the appropriate
|
||||
permissions and issue the following command:
|
||||
|
||||
/msg neostats load WarServ
|
||||
|
||||
Thats it. WarServ is now loaded and ready for use (in fact, it will
|
||||
already be running now, but read on for futher information.
|
||||
|
||||
2. Basic Configuration
|
||||
|
||||
The Channel WarServ plays in is configured online via IRC. When you
|
||||
first start up WarServ, it defaults to playing in "#Games", to change the
|
||||
channel use the following command:
|
||||
|
||||
/msg warserv chan <#channel>
|
||||
|
||||
The new channel name will be saved for future reference, and WarServ
|
||||
will message the current channel telling those there where it is moving
|
||||
to, and will part the old channel and join the new one.
|
||||
|
||||
3. Operational Commands
|
||||
|
||||
WarServ has a number of commands to play the game in channel.
|
||||
To list the commands send the text "!whelp" to the channel WarServ
|
||||
is set to play in.
|
||||
|
|
|
@ -3,7 +3,7 @@ AC_INIT(warserv.c)
|
|||
AC_CONFIG_HEADER(modconfig.h)
|
||||
PACKAGE=WarServ
|
||||
MODULE_MAJOR=1
|
||||
MODULE_MINOR=1
|
||||
MODULE_MINOR=2
|
||||
VERSION=$MODULE_MAJOR.$MODULE_MINOR
|
||||
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
|
||||
|
|
40
warserv.c
40
warserv.c
|
@ -1,9 +1,24 @@
|
|||
/* WarServ War Card Game Bot - NeoStats Addon Module
|
||||
** Copyright (c) 2004 DeadNotBuried
|
||||
**
|
||||
** Released to NeoStats Software 1 April 2004
|
||||
** This program 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 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program 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 this program; if not, write to the Free Software
|
||||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
** USA
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include "dl.h" /* Required for module */
|
||||
#include "stats.h" /* Required for bot support */
|
||||
|
@ -91,11 +106,23 @@ int __ChanMessage(char *origin, char **argv, int argc)
|
|||
}
|
||||
if (argc == 2) {
|
||||
if (!strcasecmp(argv[1], "!rules")) {
|
||||
prefmsg(u->nick, s_module_bot_name, "Welcome To War (The Card Game) Ver 0.7 %s", u->nick);
|
||||
prefmsg(u->nick, s_module_bot_name, " ");
|
||||
prefmsg(u->nick, s_module_bot_name, "Welcome To War (The Card Game) Ver 1.2 %s", u->nick);
|
||||
prefmsg(u->nick, s_module_bot_name, "Written By DeadNotBuried");
|
||||
prefmsg(u->nick, s_module_bot_name, " ");
|
||||
prefmsg(u->nick, s_module_bot_name, "rules will be added later");
|
||||
prefmsg(u->nick, s_module_bot_name, "All cards are Dealt out evenly when the game starts.");
|
||||
prefmsg(u->nick, s_module_bot_name, "The Object of the game is to hold ALL the cards.");
|
||||
prefmsg(u->nick, s_module_bot_name, "Each Player plays a card from their hand, and the");
|
||||
prefmsg(u->nick, s_module_bot_name, "highest card wins all cards played that turn.");
|
||||
prefmsg(u->nick, s_module_bot_name, " ");
|
||||
prefmsg(u->nick, s_module_bot_name, "If the played cards are equal, there is a War.");
|
||||
prefmsg(u->nick, s_module_bot_name, "all played cards stay out, and each player involved");
|
||||
prefmsg(u->nick, s_module_bot_name, "in the war plays 3 more cards. the War continues the");
|
||||
prefmsg(u->nick, s_module_bot_name, "same way, untill someone wins all the played cards.");
|
||||
prefmsg(u->nick, s_module_bot_name, " ");
|
||||
prefmsg(u->nick, s_module_bot_name, "If you don't have enough cards to play, your cards are");
|
||||
prefmsg(u->nick, s_module_bot_name, "automatically put into the center, and you surrender.");
|
||||
prefmsg(u->nick, s_module_bot_name, " ");
|
||||
prefmsg(u->nick, s_module_bot_name, "NOTE: Game can't be joined to after play has started.");
|
||||
} else if (!strcasecmp(argv[1], "!whelp")) {
|
||||
prefmsg(u->nick, s_module_bot_name, "Currently available public WarServ commands");
|
||||
prefmsg(u->nick, s_module_bot_name, "===========================================");
|
||||
|
@ -116,7 +143,7 @@ int __ChanMessage(char *origin, char **argv, int argc)
|
|||
} else if (!strcasecmp(argv[1], "!stop")) {
|
||||
if (strcasecmp(currentwargamestatus, "stopped")) {
|
||||
privmsg(warroom, s_module_bot_name, "\0039Stopping Current Game");
|
||||
warstop();
|
||||
stopwar();
|
||||
}
|
||||
} else if (!strcasecmp(argv[1], "!start")) {
|
||||
if (!strcasecmp(currentwargamestatus, "stopped")) {
|
||||
|
@ -200,8 +227,9 @@ int __BotMessage(char *origin, char **argv, int argc)
|
|||
prefmsg(u->nick, s_module_bot_name, "\2CHAN <channel>\2 - Swap WarGame Channel to <channel>");
|
||||
}
|
||||
return 1;
|
||||
} else if (!strcasecmp(argv[1], "CHAN")) {
|
||||
} else if (!strcasecmp(argv[1], "CHAN") && (UserLevel(u) > 179)) {
|
||||
privmsg(warroom, s_module_bot_name, "%s has moved the Game room to %s, Please Go there now to continue the game", u->nick, argv[2]);
|
||||
chanalert(s_module_bot_name, "%s moved the game to %s", u->nick, argv[2]);
|
||||
spart_cmd(s_module_bot_name, warroom);
|
||||
strlcpy(warroom, argv[2], CHANLEN);
|
||||
sjoin_cmd(s_module_bot_name, warroom);
|
||||
|
|
Reference in a new issue