Compare commits
74 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5576c3bcf3 | ||
![]() |
3002026cb9 | ||
![]() |
4f390c33a6 | ||
![]() |
e65044e97c | ||
![]() |
da0275e084 | ||
![]() |
7c5ec4550b | ||
![]() |
c53b829dda | ||
![]() |
d7f2bd567c | ||
![]() |
c498144bf2 | ||
![]() |
173fa3cc19 | ||
![]() |
be8c11cc24 | ||
![]() |
29587d05ae | ||
![]() |
22a7f99152 | ||
![]() |
78ef89d773 | ||
![]() |
876a38ab80 | ||
![]() |
536242489f | ||
![]() |
7e305b79b9 | ||
![]() |
6ea56c5c8f | ||
![]() |
eb406d1a42 | ||
![]() |
f626615a54 | ||
![]() |
84d034db7d | ||
![]() |
91c4220910 | ||
![]() |
eb4847e1e6 | ||
![]() |
8b69313cff | ||
![]() |
b8bbe4d44c | ||
![]() |
72e1e1edc1 | ||
![]() |
96bf4a9d03 | ||
![]() |
fd22c718e6 | ||
![]() |
2b71fbaad6 | ||
![]() |
1b581ab30f | ||
![]() |
e2c9f16aed | ||
![]() |
0933499e42 | ||
![]() |
3bffc33674 | ||
![]() |
fd15a95906 | ||
![]() |
70604aa5cb | ||
![]() |
5ccfb453a9 | ||
![]() |
d9a911f21e | ||
![]() |
c998f7e81c | ||
![]() |
977883d64b | ||
![]() |
7dccaf7ac7 | ||
![]() |
a05c1d8fda | ||
![]() |
17bd54465b | ||
![]() |
771c9ebc5c | ||
![]() |
2d26802070 | ||
![]() |
c89aa86fd6 | ||
![]() |
2c62374e0e | ||
![]() |
55382d75e6 | ||
![]() |
5f43d47c74 | ||
![]() |
1d64bcc6d2 | ||
![]() |
8391a0ff30 | ||
![]() |
25ef0225cc | ||
![]() |
9e2a0757fd | ||
![]() |
346d59ffe2 | ||
![]() |
ae1fb3d87c | ||
![]() |
8368e3a752 | ||
![]() |
c1ecdfdffd | ||
![]() |
d5d6785570 | ||
![]() |
ae3f05de3b | ||
![]() |
cbaca68ac8 | ||
![]() |
637295a754 | ||
![]() |
5690e44270 | ||
![]() |
3273e85b63 | ||
![]() |
3499c337aa | ||
![]() |
b2fe7de6e7 | ||
![]() |
28b6e00f64 | ||
![]() |
337ad167ad | ||
![]() |
a3dd9b9e75 | ||
![]() |
6e7eaac865 | ||
![]() |
a45aacf621 | ||
![]() |
a77e67e312 | ||
![]() |
566ca3cda0 | ||
![]() |
dc0771368a | ||
![]() |
5350a02c3c | ||
![]() |
0721d19230 |
24 changed files with 20014 additions and 2407 deletions
15
.gitattributes
vendored
15
.gitattributes
vendored
|
@ -3,11 +3,26 @@
|
|||
/COPYING -text
|
||||
/ChangeLog -text
|
||||
/LICENSE -text
|
||||
/Makefile.am -text
|
||||
/Makefile.in -text
|
||||
/NEWS -text
|
||||
/README.WarServ -text
|
||||
/RELNOTES -text
|
||||
/RELNOTES.win32.txt eol=crlf
|
||||
/aclocal.m4 -text
|
||||
/configure -text
|
||||
/configure.in -text
|
||||
/events.c -text
|
||||
/install-sh -text
|
||||
/modconfig.h.in -text
|
||||
/play.c -text
|
||||
/pulse.xml -text
|
||||
/warserv.c -text
|
||||
/warserv.h -text
|
||||
/warserv.sln -text
|
||||
/warserv.vcproj -text
|
||||
/warserv_help.c -text
|
||||
win32/WarServ.qsp -text
|
||||
win32/buildwin32snap.bat -text
|
||||
win32/modconfigwin32.h -text
|
||||
win32/neostatsversion.rc -text
|
||||
|
|
43
ChangeLog
43
ChangeLog
|
@ -1,20 +1,37 @@
|
|||
WarServ ChangeLog
|
||||
Fish (F), Mark (M), DeadNotBuried (D)
|
||||
=============================================================================
|
||||
3.0.0 - Fish (F)
|
||||
- Bump Version (F)
|
||||
|
||||
3.0.0 - Fish (F)
|
||||
- Release WarServ 3.0.0
|
||||
|
||||
3.0.a3
|
||||
- Update Copyright (D)
|
||||
- Automatically remove players from game if they leave the channel/Network (D)
|
||||
|
||||
3.0.a2 - Mark (M)
|
||||
- Update settings table to a2 compatible format. (M)
|
||||
|
||||
3.0.a1 - Mark (M)
|
||||
- Port to 3.0 API and Win32. (M)
|
||||
|
||||
1.2 - DeadNotBuried
|
||||
- fixed players being asked to play a war hand when they are not in the war
|
||||
- fixed error in calculating correct winner of a war
|
||||
- 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 setting now requires Oper user level to change channel
|
||||
- fixed players being asked to play a war hand when they are not in the war
|
||||
- fixed error in calculating correct winner of a war
|
||||
- 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 setting now requires Oper user level to change channel
|
||||
|
||||
1.1
|
||||
- added code to enable !stop command
|
||||
- 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.
|
||||
- Initial Release. Code Contributed by DeadNotBurried (dnb@majestic-liaisons.com)
|
||||
- Make game channel configurable.
|
||||
- Standardize on hostname.
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
# $Id: LICENSE,v 1.1 2003/02/18 13:52:06 fishwaldo Exp $
|
||||
# $Id$
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
|
|
16
Makefile.am
Normal file
16
Makefile.am
Normal file
|
@ -0,0 +1,16 @@
|
|||
AUTOMAKE_OPTIONS = foreign
|
||||
ACLOCAL_AMFLAGS = -I autotools
|
||||
AM_MAKEFLAGS = -s
|
||||
|
||||
pkglib_LTLIBRARIES = warserv.la
|
||||
warserv_la_SOURCES = warserv.c warserv_help.c play.c events.c
|
||||
noinst_HEADERS = warserv.h
|
||||
|
||||
warserv_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
EXTRA_DIST = autotools/ccdv.c autotools/shtool RELNOTES
|
||||
|
||||
dist_doc_DATA = README.WarServ
|
||||
|
||||
|
||||
include $(top_srcdir)/autotools/rules.mk
|
746
Makefile.in
746
Makefile.in
|
@ -1,52 +1,722 @@
|
|||
#Neostats Module Makefile!
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(am__configure_deps) $(dist_doc_DATA) $(noinst_HEADERS) \
|
||||
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/modconfig.h.in $(top_srcdir)/autotools/rules.mk \
|
||||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog NEWS \
|
||||
autotools/compile autotools/config.guess autotools/config.sub \
|
||||
autotools/depcomp autotools/install-sh autotools/ltmain.sh \
|
||||
autotools/missing autotools/mkinstalldirs autotools/ylwrap \
|
||||
install-sh
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/autotools/acinclude.m4 \
|
||||
$(top_srcdir)/autotools/ax_distversion.m4 \
|
||||
$(top_srcdir)/autotools/ax_maintainer_mode_auto_silent.m4 \
|
||||
$(top_srcdir)/autotools/ccdv.m4 $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs
|
||||
CONFIG_HEADER = modconfig.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(docdir)"
|
||||
pkglibLTLIBRARIES_INSTALL = $(INSTALL)
|
||||
LTLIBRARIES = $(pkglib_LTLIBRARIES)
|
||||
warserv_la_LIBADD =
|
||||
am_warserv_la_OBJECTS = warserv.lo warserv_help.lo play.lo events.lo
|
||||
warserv_la_OBJECTS = $(am_warserv_la_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
|
||||
depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
SOURCES = $(warserv_la_SOURCES)
|
||||
DIST_SOURCES = $(warserv_la_SOURCES)
|
||||
dist_docDATA_INSTALL = $(INSTALL_DATA)
|
||||
DATA = $(dist_doc_DATA)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
pkglibdir = $(prefix)/modules
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@ -g
|
||||
LDFLAGS = @LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CCDV = @CCDV@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DIRINST = @DIRINST@
|
||||
DISTDIRVERSION = @DISTDIRVERSION@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
DIRECTORY = @DIRINST@/dl/
|
||||
INCLUDES = -I@DIRINST@/include/ -I.
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
USECCDV = @USECCDV@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = $(prefix)/data
|
||||
datarootdir = @datarootdir@
|
||||
docdir = $(prefix)/doc
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
wi_PWD = @wi_PWD@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
ACLOCAL_AMFLAGS = -I autotools
|
||||
AM_MAKEFLAGS = -s
|
||||
pkglib_LTLIBRARIES = warserv.la
|
||||
warserv_la_SOURCES = warserv.c warserv_help.c play.c events.c
|
||||
noinst_HEADERS = warserv.h
|
||||
warserv_la_LDFLAGS = -module -avoid-version
|
||||
EXTRA_DIST = autotools/ccdv.c autotools/shtool RELNOTES
|
||||
dist_doc_DATA = README.WarServ
|
||||
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
SRCS= warserv.c
|
||||
OBJS= ${SRCS:.c=.o}
|
||||
TARGET= warserv.so
|
||||
DOCS=README.WarServ
|
||||
SCRIPTS=
|
||||
DATA=
|
||||
DISTFILES=$(SRCS) $(DOCS) $(SCRIPTS) *.in configure install-sh ChangeLog *.h LICENSE
|
||||
DISTDIR= @PACKAGE@-@VERSION@
|
||||
distdir = @DISTDIRVERSION@
|
||||
all: modconfig.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
all: module
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/autotools/rules.mk $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(INCLUDES) $<
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
module: $(OBJS)
|
||||
$(LD) -shared -o $(TARGET) $(LDFLAGS) $(OBJS)
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
clean:
|
||||
/bin/rm -rf $(TARGET) *.o Makefile *.log modconfig.h
|
||||
modconfig.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
install: module
|
||||
$(INSTALL) -m 644 $(TARGET) $(DIRECTORY)
|
||||
$(INSTALL) -m 644 $(DOCS) $(DIRECTORY)../doc/
|
||||
stamp-h1: $(srcdir)/modconfig.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status modconfig.h
|
||||
$(srcdir)/modconfig.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
dist:
|
||||
@echo -n "Creating Directories"
|
||||
@-rm -rf $(DISTDIR)
|
||||
@mkdir $(DISTDIR)
|
||||
@echo "Done"
|
||||
@echo -n "Copying Core Distribution Files"
|
||||
@for file in $(DISTFILES); do \
|
||||
echo -n "."; \
|
||||
cp -pr $$file $(DISTDIR)/$$file; \
|
||||
distclean-hdr:
|
||||
-rm -f modconfig.h stamp-h1
|
||||
|
||||
uninstall-pkglibLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
|
||||
done
|
||||
@echo "Done"
|
||||
@tar -czf $(DISTDIR).tar.gz $(DISTDIR)/*
|
||||
@echo "Tar file $(DISTDIR).tar.gz created, Freshmeat Time"
|
||||
|
||||
clean-pkglibLTLIBRARIES:
|
||||
-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
|
||||
@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
warserv.la: $(warserv_la_OBJECTS) $(warserv_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(pkglibdir) $(warserv_la_LDFLAGS) $(warserv_la_OBJECTS) $(warserv_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/events.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/play.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/warserv.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/warserv_help.Plo@am__quote@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
uninstall-dist_docDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(dist_doc_DATA)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(docdir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) modconfig.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) modconfig.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) modconfig.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) modconfig.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkdir_p) $(distdir)/autotools
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) modconfig.h
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(docdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-hdr distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-dist_docDATA
|
||||
|
||||
install-exec-am: install-pkglibLTLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-dist_docDATA uninstall-info-am \
|
||||
uninstall-pkglibLTLIBRARIES
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
|
||||
clean-generic clean-libtool clean-pkglibLTLIBRARIES ctags dist \
|
||||
dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
|
||||
distcheck distclean distclean-compile distclean-generic \
|
||||
distclean-hdr distclean-libtool distclean-tags distcleancheck \
|
||||
distdir distuninstallcheck dvi dvi-am html html-am info \
|
||||
info-am install install-am install-data install-data-am \
|
||||
install-dist_docDATA install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-pkglibLTLIBRARIES \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
||||
uninstall-dist_docDATA uninstall-info-am \
|
||||
uninstall-pkglibLTLIBRARIES
|
||||
|
||||
|
||||
.c.o:
|
||||
@USECCDV@ @echo "Building $@"
|
||||
@am__fastdepCC_TRUE@ @if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
|
||||
|
||||
$(OBJS): Makefile
|
||||
.c.obj:
|
||||
@USECCDV@ @echo "Building $@"
|
||||
@am__fastdepCC_TRUE@ @if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
|
||||
|
||||
.c.lo:
|
||||
@USECCDV@ @echo "Building $@"
|
||||
@am__fastdepCC_TRUE@ @if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ @source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
|
||||
|
||||
install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
|
||||
@list='ls .libs/*.so'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
$(CCDV) $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \
|
||||
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
install-binSCRIPTS: $(bin_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f $$d$$p; then \
|
||||
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
|
||||
$(CCDV) $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
|
||||
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
@list='$(dist_bin_SCRIPTS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f $$d$$p; then \
|
||||
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
|
||||
$(CCDV) $(dist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
|
||||
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
install-dist_dataDATA: $(dist_data_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(datadir)" || $(mkdir_p) "$(DESTDIR)$(datadir)"
|
||||
@list='$(dist_data_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
$(CCDV) $(dist_dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(datadir)/$$f"; \
|
||||
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
|
||||
done
|
||||
|
||||
install-dist_docDATA: $(dist_doc_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(docdir)" || $(mkdir_p) "$(DESTDIR)$(docdir)"
|
||||
@list='$(dist_doc_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
$(CCDV) $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
|
||||
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
|
||||
done
|
||||
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
|
||||
@list='$(include_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
$(CCDV) $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
|
||||
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
|
||||
done
|
||||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
|| test -f $$p1 \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
$(CCDV) $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
$(CCDV) $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
if test "x#" != "x@USECCDV@"; then echo "Installing $$f"; fi; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
install-neoSCRIPTS: $(neo_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(neodir)" || $(mkdir_p) "$(DESTDIR)$(neodir)"
|
||||
@list='$(neo_SCRIPTS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f $$d$$p; then \
|
||||
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
|
||||
$(CCDV) $(neoSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(neodir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
distcleancheck:
|
||||
@:
|
||||
distuninstallcheck:
|
||||
@:
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -29,12 +29,12 @@ _________________________________________________________________
|
|||
|
||||
1. Prerequisites and Installation.
|
||||
|
||||
WarServ is designed to run on Top of NeoStats.
|
||||
WarServ is designed to run on Top of NeoStats 3.
|
||||
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
|
||||
* NeoStats 3.0 or Higher correctly installed and Running
|
||||
* The time to read this entire document.
|
||||
|
||||
|
||||
|
@ -52,22 +52,22 @@ bash$ tar -xzf WarServ-<ver>.tar.gz
|
|||
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
|
||||
in a standard location (~/NeoStats3.0/). 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:
|
||||
Again, check for Error messages. As long as there are not error messages,
|
||||
"make install" (or "gmake" if you are running BSD) 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
|
||||
the following line to your "neostats.conf" file in the NeoStats
|
||||
directory:
|
||||
|
||||
LOAD_MODULE WarServ
|
||||
|
@ -83,17 +83,19 @@ bash$./configure [--with-neostats=<dir>]
|
|||
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:
|
||||
first start up WarServ, it defaults to playing in "#Games_War", to
|
||||
change the channel use the following command:
|
||||
|
||||
/msg warserv chan <#channel>
|
||||
/msg warserv set 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.
|
||||
|
||||
NOTE: if a game is in progress the set chan command will not work.
|
||||
|
||||
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
|
||||
To list the commands send the text "!help" to the channel WarServ
|
||||
is set to play in.
|
||||
|
|
15
RELNOTES
Executable file
15
RELNOTES
Executable file
|
@ -0,0 +1,15 @@
|
|||
* WarServ * Version 3.0.1
|
||||
==============================================================================
|
||||
Important information you should know: (READ THIS!)
|
||||
==============================================================================
|
||||
|
||||
The Documentation for this module is at:
|
||||
http://wiki.neostats.net/confluence/display/WarServ
|
||||
Make sure you read it before requesting support
|
||||
|
||||
NeoStats Documentation is at:
|
||||
http://wiki.neostats.net/confluence/display/NeoStats
|
||||
|
||||
Known issues that we are aware of and should not be reported:
|
||||
|
||||
* None at present
|
15
RELNOTES.win32.txt
Normal file
15
RELNOTES.win32.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
* WarServ * Version 3.0.1
|
||||
==============================================================================
|
||||
Important information you should know: (READ THIS!)
|
||||
==============================================================================
|
||||
|
||||
The Documentation for this module is at:
|
||||
http://wiki.neostats.net/confluence/display/WarServ
|
||||
Make sure you read it before requesting support
|
||||
|
||||
NeoStats Documentation is at:
|
||||
http://wiki.neostats.net/confluence/display/NeoStats
|
||||
|
||||
Known issues that we are aware of and should not be reported:
|
||||
|
||||
* None at present
|
7513
aclocal.m4
vendored
Normal file
7513
aclocal.m4
vendored
Normal file
File diff suppressed because it is too large
Load diff
106
configure.in
106
configure.in
|
@ -1,20 +1,29 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(warserv.c)
|
||||
AC_CONFIG_HEADER(modconfig.h)
|
||||
PACKAGE=WarServ
|
||||
MODULE_MAJOR=1
|
||||
MODULE_MINOR=2
|
||||
VERSION=$MODULE_MAJOR.$MODULE_MINOR
|
||||
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MINOR, "$MODULE_MINOR")
|
||||
DIRINST=~/NeoStats/
|
||||
AC_PREFIX_DEFAULT(~/NeoStats/)
|
||||
CFLAGS="$CFLAGS -O2"
|
||||
AC_CONFIG_AUX_DIR(autotools)
|
||||
AM_CONFIG_HEADER(modconfig.h)
|
||||
AM_MAINTAINER_MODE
|
||||
MODPACKAGE=WarServ
|
||||
MODULE_MAJOR=3
|
||||
MODULE_MINOR=0
|
||||
MODULE_REV=1
|
||||
MODVERSION=$MODULE_MAJOR.$MODULE_MINOR.$MODULE_REV
|
||||
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$MODVERSION", "Complete Module Version")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MAJOR, $MODULE_MAJOR, "Major Module Version")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MINOR, $MODULE_MINOR, "Minor Module Version")
|
||||
AC_DEFINE_UNQUOTED(MODULE_REV, $MODULE_REV, "Module Revision")
|
||||
DIRINST=~/NeoStats3.0/
|
||||
AC_PREFIX_DEFAULT(~/NeoStats3.0/)
|
||||
AM_INIT_AUTOMAKE($MODPACKAGE, $MODVERSION)
|
||||
#AM_INIT_AUTOMAKE("","")
|
||||
CFLAGS="$CFLAGS -g -ggdb -Wall -O2 -fno-strict-aliasing"
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_DISABLE_STATIC
|
||||
CARES_CLEAR_LIBTOOL_TAGS
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_MSG_CHECKING(Location of NeoStats...)
|
||||
AC_ARG_WITH(neostats,
|
||||
|
@ -22,8 +31,7 @@ AC_ARG_WITH(neostats,
|
|||
[DIRINST=$withval])
|
||||
AC_MSG_RESULT($DIRINST)
|
||||
|
||||
|
||||
AC_CHECK_FILE($DIRINST/include/dl.h,
|
||||
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)])
|
||||
|
||||
|
@ -35,11 +43,9 @@ AC_TRY_RUN(
|
|||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
int main(void) {
|
||||
if (MAJOR >= 2) {
|
||||
if (MINOR >= 5) {
|
||||
if (REV >= 15) {
|
||||
exit(0);
|
||||
}
|
||||
if (MAJOR >= 3) {
|
||||
if (MINOR >= 0) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
|
@ -48,21 +54,21 @@ int main(void) {
|
|||
ns_version_ok='no',
|
||||
ns_version_ok='no')
|
||||
if test "$ns_version_ok" = "yes"; then
|
||||
AC_MSG_RESULT(Compatible Version);
|
||||
AC_MSG_RESULT(Compatible version);
|
||||
prefix=$DIRINST
|
||||
else
|
||||
AC_MSG_ERROR(This Module requires NeoStats 2.5.13 or Higher)
|
||||
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 Debuging...)
|
||||
dnl check if we are running with debug....
|
||||
AC_MSG_CHECKING(Whether to enable debug...)
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug - Enable Debuging],
|
||||
[ --enable-debug - enable debug],
|
||||
[ case "$enableval" in
|
||||
yes)
|
||||
CFLAGS="$CFLAGS -Wall -ggdb"
|
||||
AC_DEFINE(DEBUG,1)
|
||||
AC_MSG_RESULT(yes - Watch your Log Files)
|
||||
AC_DEFINE(MODDEBUG, "1", "Enable Debugging")
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
|
@ -71,24 +77,40 @@ AC_ARG_ENABLE(debug,
|
|||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
|
||||
wi_ARG_DISABLE_CCDV
|
||||
wi_PROG_CCDV
|
||||
|
||||
AC_MSG_CHECKING(To Enable AutoTools Debug Mode?)
|
||||
AC_ARG_ENABLE(autodebug, [ --enable-autodebug - Enable AutoTools Debug],
|
||||
[ case "$enableval" in
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
AX_MAINTAINER_MODE_AUTO_SILENT
|
||||
;;
|
||||
esac],
|
||||
AC_MSG_RESULT(no)
|
||||
AX_MAINTAINER_MODE_AUTO_SILENT
|
||||
)
|
||||
|
||||
CFLAGS="$CFLAGS -DBUILDINGMOD"
|
||||
|
||||
AX_DISTVERSION
|
||||
|
||||
AC_SUBST(DIRINST)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
AC_SUBST(PACKAGE)
|
||||
AC_SUBST(VERSION)
|
||||
AC_SUBST(LIBTOOL_DEPS)
|
||||
AC_SUBST(CCDV)
|
||||
AC_OUTPUT(Makefile)
|
||||
echo "(*----------------------------------------------------------*)"
|
||||
echo "(| Important Instructions |)"
|
||||
echo "(*----------------------------------------------------------*)"
|
||||
echo "(| Now that configure is complete, type 'make' to compile |)"
|
||||
echo "(| the module. When the compile has completed, type |)"
|
||||
echo "(| 'make install' to install the module. |)"
|
||||
echo "(| For BSD you might need to use 'gmake' and 'gmake install'|)"
|
||||
echo "(*----------------------------------------------------------*)"
|
||||
echo "(| For Support please visit: |)"
|
||||
echo "(| IRC: /server irc.irc-chat.org |)"
|
||||
echo "(| #neostats channel |)"
|
||||
echo "(| WWW: http://www.neostats.net/boards/ |)"
|
||||
echo "(*----------------------------------------------------------*)"
|
||||
echo "(|This Module was written by: |)"
|
||||
echo "(| DeadNotBurried (idontwantthisshit@hotmail.com) |)"
|
||||
echo "(*----------------------------------------------------------*)"
|
||||
echo "Configuration complete."
|
||||
read -p "Press Enter key to read the release notes"
|
||||
clear
|
||||
more RELNOTES
|
||||
echo "Run 'make' (or 'gmake' on some systems) to compile NeoStats."
|
||||
echo "If you require support, see the README file."
|
||||
|
|
207
events.c
Normal file
207
events.c
Normal file
|
@ -0,0 +1,207 @@
|
|||
/* WarServ - War Card Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2004-2008 Justin Hammond, Mark Hetherington, Jeff Lang
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** WarServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "warserv.h"
|
||||
|
||||
/*
|
||||
* Nick Change Check
|
||||
*/
|
||||
int PlayerNickChange (const CmdParams *cmdparams)
|
||||
{
|
||||
if (currentwarplayercount < 1) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (!ircstrcasecmp (wplayernick[wpln], cmdparams->param)) {
|
||||
strlcpy (wplayernick[wpln], cmdparams->source->name, MAXNICK);
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start War Game
|
||||
*/
|
||||
int StartWarGame (const CmdParams *cmdparams)
|
||||
{
|
||||
if (currentwargamestatus == WS_GAME_STOPPED) {
|
||||
startcountdowntimer(cmdparams->source->name);
|
||||
} else if (currentwarplayercount < 10) {
|
||||
irc_privmsg (ws_bot, cmdparams->source, "\0034A game has already started \0037%s\0034, Type '\2\003Join\2\0034' in \2\003%s\2\0034 To Join in.", cmdparams->source->name, warroom);
|
||||
} else {
|
||||
irc_privmsg (ws_bot, cmdparams->source, "\0034A game has already started \0037%s\0034 and all spots are taken. Please try the next game.", cmdparams->source->name);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Stop War Game
|
||||
*/
|
||||
int StopWarGame (const CmdParams *cmdparams)
|
||||
{
|
||||
if (currentwargamestatus != WS_GAME_STOPPED) {
|
||||
if (cmdparams->source->user->ulevel >= NS_ULEVEL_OPER) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0039Stopping Current Game (\0037%s\0039)", cmdparams->source->name);
|
||||
stopwar();
|
||||
wpln = currentwarplayercount;
|
||||
return NS_SUCCESS;
|
||||
} else {
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (!ircstrcasecmp (wplayernick[wpln], cmdparams->source->name)) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0039Stopping Current Game (\0037%s\0039)", cmdparams->source->name);
|
||||
stopwar();
|
||||
wpln = currentwarplayercount;
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Join War Game
|
||||
*/
|
||||
int JoinWarGame (const CmdParams *cmdparams)
|
||||
{
|
||||
if (currentwargamestatus == WS_GAME_STARTING) {
|
||||
joinwar(cmdparams->source->name);
|
||||
SetUserModValue(cmdparams->source,(void *)1);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove From War Game
|
||||
*/
|
||||
int RemoveWarGame (const CmdParams *cmdparams)
|
||||
{
|
||||
Client *u;
|
||||
|
||||
if (currentwargamestatus != WS_GAME_STOPPED) {
|
||||
if ( cmdparams->ac > 0 ) {
|
||||
/* allows removal of a player by anyone
|
||||
* if player no longer connected to ircd */
|
||||
u = FindUser(cmdparams->av[0]);
|
||||
if (!u || cmdparams->source->user->ulevel >= NS_ULEVEL_OPER) {
|
||||
removewar(u->name);
|
||||
if (GetUserModValue(u) > 0)
|
||||
ClearUserModValue(u);
|
||||
}
|
||||
} else {
|
||||
removewar(cmdparams->source->name);
|
||||
if (GetUserModValue(cmdparams->source) > 0)
|
||||
ClearUserModValue(cmdparams->source);
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display Current Players
|
||||
*/
|
||||
int ShowPlayersWarGame (const CmdParams *cmdparams)
|
||||
{
|
||||
if (currentwargamestatus == WS_GAME_PLAYING) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0039Current Players are\0038 :\0037 %s %s %s %s %s %s %s %s %s %s", wplayernick[0], wplayernick[1], wplayernick[2], wplayernick[3], wplayernick[4], wplayernick[5], wplayernick[6], wplayernick[7], wplayernick[8], wplayernick[9]);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display Current Player Turn
|
||||
*/
|
||||
int ShowTurnWarGame (const CmdParams *cmdparams)
|
||||
{
|
||||
if (currentwargamestatus == WS_GAME_PLAYING) {
|
||||
if (warinprogress == 1) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0039The Current Player is \0037%s\0039 holding\00311 %d\0039 cards, and are currently at \0034WAR\0039 which three would you like to play ?", wplayernick[currentplayer], wplayercardstotal[currentplayer]);
|
||||
} else {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0039The Current Player is \0037%s\0039 currently holding\00311 %d\0039 cards, which would you like to play ?", wplayernick[currentplayer], wplayercardstotal[currentplayer]);
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Play Cards
|
||||
*/
|
||||
int PlayCardsWarGame (const CmdParams *cmdparams)
|
||||
{
|
||||
if (!ircstrcasecmp (cmdparams->source->name,wplayernick[currentplayer]) && currentwargamestatus == WS_GAME_PLAYING) {
|
||||
if (warinprogress == 1) {
|
||||
if (cmdparams->ac == 3) {
|
||||
playwarcards(atoi(cmdparams->av[0]), atoi(cmdparams->av[1]), atoi(cmdparams->av[2]));
|
||||
}
|
||||
} else {
|
||||
if (cmdparams->ac == 1) {
|
||||
playcard(atoi(cmdparams->av[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* User Events
|
||||
*
|
||||
* check if user is a War Player
|
||||
* and if so, remove from game as appropriate
|
||||
*/
|
||||
int CheckPlayerPart (const CmdParams *cmdparams)
|
||||
{
|
||||
SET_SEGV_LOCATION();
|
||||
if (GetUserModValue(cmdparams->source) > 0)
|
||||
RemoveWarGame(cmdparams);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
int CheckPlayerQuit (const CmdParams *cmdparams)
|
||||
{
|
||||
SET_SEGV_LOCATION();
|
||||
if (GetUserModValue(cmdparams->source) > 0)
|
||||
RemoveWarGame(cmdparams);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
int CheckPlayerKick (const CmdParams *cmdparams)
|
||||
{
|
||||
SET_SEGV_LOCATION();
|
||||
if (GetUserModValue(cmdparams->target) > 0 && currentwargamestatus != WS_GAME_STOPPED)
|
||||
{
|
||||
removewar(cmdparams->target->name);
|
||||
ClearUserModValue(cmdparams->target);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
int CheckPlayerKill (const CmdParams *cmdparams)
|
||||
{
|
||||
SET_SEGV_LOCATION();
|
||||
if (GetUserModValue(cmdparams->target) > 0 && currentwargamestatus != WS_GAME_STOPPED)
|
||||
{
|
||||
removewar(cmdparams->target->name);
|
||||
ClearUserModValue(cmdparams->target);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
|
@ -9,3 +9,6 @@
|
|||
|
||||
/* Minor Version */
|
||||
#undef MODULE_MINOR
|
||||
|
||||
/* Revision */
|
||||
#undef MODULE_REV
|
||||
|
|
552
play.c
Normal file
552
play.c
Normal file
|
@ -0,0 +1,552 @@
|
|||
/* WarServ - War Card Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2004-2008 Justin Hammond, Mark Hetherington, Jeff Lang
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** WarServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "warserv.h"
|
||||
|
||||
char warroom[MAXCHANLEN];
|
||||
int currentwargamestatus;
|
||||
int currentwarplayercount;
|
||||
char wplayernick[10][MAXNICK];
|
||||
int wplayercardstotal[10];
|
||||
int warinprogress;
|
||||
int currentplayer;
|
||||
int wpln;
|
||||
|
||||
static int wplayercardsinhand[10][52];
|
||||
static int wplayercardplayed[10];
|
||||
static int wplayeratwar[10];
|
||||
static int wplayerwarcardsplayed[10][3];
|
||||
static int wstackcards[52];
|
||||
static int wstackcardscurrent;
|
||||
static char csuit[10];
|
||||
static char csuitcolour[10];
|
||||
static char csuitcard[10];
|
||||
|
||||
static void checkhandwinner(void);
|
||||
static void checkwarwinner(void);
|
||||
static void clearstack(void);
|
||||
static void playershufflecards(void);
|
||||
static void wardealcards(void);
|
||||
static void askplaycard(void);
|
||||
int startwar(void *userptr);
|
||||
|
||||
/*
|
||||
* Stop Game
|
||||
* resets everything to default as if no game running
|
||||
*/
|
||||
|
||||
void stopwar(void)
|
||||
{
|
||||
int i;
|
||||
if (currentwargamestatus == WS_GAME_STARTING) {
|
||||
DelTimer ("startwar");
|
||||
}
|
||||
for (wpln = 0; wpln < 10; wpln++) {
|
||||
strlcpy (wplayernick[wpln], " ", MAXNICK);
|
||||
wplayercardstotal[wpln]= 0;
|
||||
wplayercardplayed[wpln]= 0;
|
||||
wplayeratwar[wpln]= 0;
|
||||
for (i = 0; i < 52; i++) {
|
||||
wplayercardsinhand[wpln][i]= 0;
|
||||
}
|
||||
for (i = 0; i < 3; i++) {
|
||||
wplayerwarcardsplayed[wpln][i]= 0;
|
||||
}
|
||||
}
|
||||
for (wpln = 0; wpln < 52; wpln++) {
|
||||
wstackcards[wpln]= 0;
|
||||
}
|
||||
warinprogress= 0;
|
||||
wstackcardscurrent= 0;
|
||||
currentwarplayercount = 0;
|
||||
currentwargamestatus = WS_GAME_STOPPED;
|
||||
currentplayer= 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start Game Countdown
|
||||
* Starts a timer to allow 30 seconds for people to join the game
|
||||
*/
|
||||
|
||||
void startcountdowntimer(char *nic) {
|
||||
currentwargamestatus = WS_GAME_STARTING;
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037A new game of \0034WAR\0037 has been started by %s. Game will start in 30 seconds, type '\2\003!Join\2\0037' to play.", nic);
|
||||
AddTimer (TIMER_TYPE_COUNTDOWN, startwar, "startwar", 30, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start Game
|
||||
* Initializes variables and starts game
|
||||
*/
|
||||
|
||||
int startwar(void *userptr)
|
||||
{
|
||||
/* DelTimer ("startwar"); */
|
||||
if (currentwargamestatus == WS_GAME_STARTING) {
|
||||
if (currentwarplayercount < 1) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0034No Players joined to current Game, Exiting");
|
||||
currentwargamestatus = WS_GAME_STOPPING;
|
||||
stopwar();
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
if (currentwarplayercount < 10) {
|
||||
joinwar(ws_bot->name);
|
||||
}
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0034WAR\00310 is now starting, current players are \0037%s %s %s %s %s %s %s %s %s %s", wplayernick[0], wplayernick[1], wplayernick[2], wplayernick[3], wplayernick[4], wplayernick[5], wplayernick[6], wplayernick[7], wplayernick[8], wplayernick[9]);
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0039Shuffling Deck and Dealing Cards");
|
||||
currentplayer= 0;
|
||||
currentwargamestatus = WS_GAME_PLAYING;
|
||||
wardealcards();
|
||||
wstackcardscurrent= 0;
|
||||
askplaycard();
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Join Game
|
||||
* adds new player to game during countdown
|
||||
*/
|
||||
|
||||
void joinwar(char *nic) {
|
||||
if (currentwarplayercount < 10) {
|
||||
for (wpln = 0; wpln < 10; wpln++) {
|
||||
if (!ircstrcasecmp (wplayernick[wpln], nic)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
strlcpy (wplayernick[currentwarplayercount], nic, MAXNICK);
|
||||
currentwarplayercount++;
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0038Welcome to \0034WAR \0037%s", nic);
|
||||
} else {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0034Sorry all places are filled \0037%s\0034, your welcome to try the next game though", nic);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove Player
|
||||
* removes player from game and adds any cards they have to the stack
|
||||
*/
|
||||
|
||||
void removewar(char *nic)
|
||||
{
|
||||
int i;
|
||||
int tfrpacp;
|
||||
int tfrpacpn;
|
||||
int wplnht;
|
||||
int cpfp;
|
||||
tfrpacp= 0;
|
||||
tfrpacpn= 0;
|
||||
if (currentwarplayercount < 1) {
|
||||
return;
|
||||
}
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (!ircstrcasecmp (wplayernick[wpln], nic)) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037%s \0038Removed from the current game of \0034War", nic);
|
||||
if (wpln == currentplayer) {
|
||||
tfrpacp= 1;
|
||||
} else if (wpln < currentplayer) {
|
||||
tfrpacp= 2;
|
||||
tfrpacpn= wpln;
|
||||
}
|
||||
for (wplnht = 0; wplnht < wplayercardstotal[wpln]; wplnht++) {
|
||||
wstackcards[wstackcardscurrent]= wplayercardsinhand[wpln][wplnht];
|
||||
wstackcardscurrent++;
|
||||
}
|
||||
for (i = wpln; i < currentwarplayercount; i++) {
|
||||
cpfp= (i + 1);
|
||||
if (cpfp == currentwarplayercount) {
|
||||
strlcpy (wplayernick[i], " ", MAXNICK);
|
||||
for (wplnht = 0; wplnht < wplayercardstotal[i]; wplnht++) {
|
||||
wplayercardsinhand[i][wplnht]= 0;
|
||||
}
|
||||
wplayercardstotal[i]= 0;
|
||||
} else {
|
||||
strlcpy (wplayernick[i], wplayernick[cpfp], MAXNICK);
|
||||
for (wplnht = 0; wplnht < 52; wplnht++) {
|
||||
wplayercardsinhand[i][wplnht]= wplayercardsinhand[cpfp][wplnht];
|
||||
}
|
||||
wplayercardstotal[i]= wplayercardstotal[cpfp];
|
||||
}
|
||||
}
|
||||
currentwarplayercount--;
|
||||
}
|
||||
}
|
||||
if (currentwarplayercount < 2) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0039Stopping Current Game , \0037%s\0039 wins.", wplayernick[0]);
|
||||
stopwar();
|
||||
} else if (tfrpacp == 1) {
|
||||
if (currentplayer > (currentwarplayercount - 1)) {
|
||||
currentplayer= 0;
|
||||
}
|
||||
if (currentwargamestatus == WS_GAME_STARTING) {
|
||||
askplaycard();
|
||||
}
|
||||
} else if (tfrpacp == 2) {
|
||||
if (currentplayer > tfrpacpn) {
|
||||
currentplayer--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Deal Cards
|
||||
*/
|
||||
static void wardealcards(void) {
|
||||
int cd;
|
||||
int cnd;
|
||||
int cndn;
|
||||
int ptdt = 0;
|
||||
for (wpln = 0; wpln < 52; wpln++) {
|
||||
wstackcards[wpln]= wpln;
|
||||
}
|
||||
for (cd = 52; cd > 0; cd--) {
|
||||
cnd= rand() % cd;
|
||||
cndn= wstackcards[cnd];
|
||||
for (wpln = cnd; wpln < (cd - 1); wpln++) {
|
||||
wstackcards[wpln]= wstackcards[(wpln + 1)];
|
||||
}
|
||||
wstackcards[(cd - 1)]= 0;
|
||||
wplayercardsinhand[ptdt][wplayercardstotal[ptdt]]= cndn;
|
||||
wplayercardstotal[ptdt]++;
|
||||
ptdt++;
|
||||
if (ptdt == currentwarplayercount) {
|
||||
ptdt= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Shuffle Players Cards
|
||||
*/
|
||||
|
||||
void playershufflecards(void)
|
||||
{
|
||||
int tcs;
|
||||
int tcsp;
|
||||
int tcsps;
|
||||
int i;
|
||||
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
for (i = 0; i < wplayercardstotal[wpln]; i++) {
|
||||
tcsps= 0;
|
||||
tcsp= rand() % wplayercardstotal[wpln];
|
||||
if (tcsp == i) {
|
||||
tcsps= 1;
|
||||
}
|
||||
if (tcsps == 0) {
|
||||
tcs= wplayercardsinhand[wpln][tcsp];
|
||||
wplayercardsinhand[wpln][tcsp] = wplayercardsinhand[wpln][i];
|
||||
wplayercardsinhand[wpln][i] = tcs;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* asks each player for card to play
|
||||
* or check war results if in war
|
||||
* or removes player if no cards left
|
||||
*/
|
||||
static void askplaycard(void)
|
||||
{
|
||||
int trn;
|
||||
int wspa[5];
|
||||
int nwp = (currentwarplayercount + 1);
|
||||
if (wplayercardstotal[currentplayer] == 0) {
|
||||
removewar(wplayernick[currentplayer]);
|
||||
}
|
||||
if (wplayercardstotal[currentplayer] == 52) {
|
||||
currentplayer++;
|
||||
removewar(wplayernick[currentplayer]);
|
||||
}
|
||||
if (currentwarplayercount < 2) {
|
||||
return;
|
||||
}
|
||||
if (warinprogress == 1) {
|
||||
if (currentplayer < currentwarplayercount) {
|
||||
for (wpln = currentplayer; wpln < currentwarplayercount; wpln++) {
|
||||
if (wplayeratwar[wpln] == 1) {
|
||||
nwp= wpln;
|
||||
wpln= currentwarplayercount;
|
||||
}
|
||||
}
|
||||
currentplayer = nwp;
|
||||
}
|
||||
if (nwp > currentwarplayercount) {
|
||||
checkwarwinner();
|
||||
} else {
|
||||
if (!ircstrcasecmp (wplayernick[currentplayer], ws_bot->name)) {
|
||||
trn= wplayercardstotal[currentplayer];
|
||||
wspa[2]= ((rand() % trn) + 1);
|
||||
trn--;
|
||||
wspa[3]= ((rand() % trn) + 1);
|
||||
if (wspa[3] == wspa[2]) {
|
||||
wspa[3]++;
|
||||
}
|
||||
trn--;
|
||||
wspa[4]= ((rand() % trn) + 1);
|
||||
if ((wspa[4] == wspa[2]) || (wspa[4] == wspa[3])) {
|
||||
wspa[4]++;
|
||||
}
|
||||
if ((wspa[4] == wspa[2]) || (wspa[4] == wspa[3])) {
|
||||
wspa[4]++;
|
||||
}
|
||||
playwarcards(wspa[2], wspa[3], wspa[4]);
|
||||
} else {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037%s\0039 you hold\00311 %d\0039 cards, and are currently at \0034WAR\0039 which three would you like to play ?", wplayernick[currentplayer], wplayercardstotal[currentplayer]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!ircstrcasecmp (wplayernick[currentplayer], ws_bot->name)) {
|
||||
playcard(((rand() % wplayercardstotal[currentplayer]) + 1));
|
||||
} else {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037%s\0039 you currently hold\00311 %d\0039 cards, which would you like to play ?", wplayernick[currentplayer], wplayercardstotal[currentplayer]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Player War Play Card
|
||||
*/
|
||||
void playwarcards(int cnp1, int cnp2, int cnp3)
|
||||
{
|
||||
int i;
|
||||
int cnp[3];
|
||||
cnp[0] = cnp1;
|
||||
cnp[1] = cnp2;
|
||||
cnp[2] = cnp3;
|
||||
for (wpln = 0; wpln < 3; wpln++) {
|
||||
if ((cnp[wpln] < 1) || (cnp[wpln] > wplayercardstotal[currentplayer])) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (wplayercardsinhand[currentplayer][(cnp[2] - 1)] < 13) {
|
||||
strlcpy (csuitcolour, "\0034", 10);
|
||||
strlcpy (csuit, "Hearts", 10);
|
||||
} else if (wplayercardsinhand[currentplayer][(cnp[2] - 1)] < 26) {
|
||||
strlcpy (csuitcolour, "\0037", 10);
|
||||
strlcpy (csuit, "Diamonds", 10);
|
||||
} else if (wplayercardsinhand[currentplayer][(cnp[2] - 1)] < 39) {
|
||||
strlcpy (csuitcolour, "\00314", 10);
|
||||
strlcpy (csuit, "Clubs", 10);
|
||||
} else {
|
||||
strlcpy (csuitcolour, "\00315", 10);
|
||||
strlcpy (csuit, "Spades", 10);
|
||||
}
|
||||
switch ((wplayercardsinhand[currentplayer][(cnp[2] - 1)] % 13)) {
|
||||
case 12:
|
||||
strlcpy (csuitcard, "Ace", 10);
|
||||
break;
|
||||
case 11:
|
||||
strlcpy (csuitcard, "King", 10);
|
||||
break;
|
||||
case 10:
|
||||
strlcpy (csuitcard, "Queen", 10);
|
||||
break;
|
||||
case 9:
|
||||
strlcpy (csuitcard, "Jack", 10);
|
||||
break;
|
||||
default:
|
||||
ircsnprintf(csuitcard, 10, "%d", ((wplayercardsinhand[currentplayer][(cnp[2] - 1)] % 13) + 2));
|
||||
break;
|
||||
}
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037%s\0039 played Cards\00311 %d , %d , %d \0039(%s %s of %s \0039)", wplayernick[currentplayer], cnp[0], cnp[1], cnp[2], csuitcolour, csuitcard, csuit);
|
||||
for (wpln = 0; wpln < 3; wpln++) {
|
||||
cnp[wpln]--;
|
||||
wstackcards[wstackcardscurrent]= wplayercardsinhand[currentplayer][cnp[wpln]];
|
||||
wstackcardscurrent++;
|
||||
wplayerwarcardsplayed[currentplayer][wpln]= wplayercardsinhand[currentplayer][cnp[wpln]];
|
||||
}
|
||||
if (cnp[2] > cnp[0])
|
||||
cnp[2]--;
|
||||
if (cnp[2] > cnp[1])
|
||||
cnp[2]--;
|
||||
if (cnp[1] > cnp[0])
|
||||
cnp[1]--;
|
||||
for (wpln = 0; wpln < 3; wpln++) {
|
||||
wplayercardstotal[currentplayer]--;
|
||||
for (i = cnp[wpln]; i < wplayercardstotal[currentplayer]; i++) {
|
||||
wplayercardsinhand[currentplayer][i]= wplayercardsinhand[currentplayer][(i +1)];
|
||||
}
|
||||
wplayercardsinhand[currentplayer][wplayercardstotal[currentplayer]]= 0;
|
||||
}
|
||||
currentplayer++;
|
||||
if (currentplayer < currentwarplayercount) {
|
||||
askplaycard();
|
||||
} else {
|
||||
checkwarwinner();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Player Plays Card
|
||||
*/
|
||||
void playcard(int cnp)
|
||||
{
|
||||
if ((cnp > 0) && (cnp < (wplayercardstotal[currentplayer] + 1))){
|
||||
if (wplayercardsinhand[currentplayer][(cnp - 1)] < 13) {
|
||||
strlcpy (csuitcolour, "\0034", 10);
|
||||
strlcpy (csuit, "Hearts", 10);
|
||||
} else if (wplayercardsinhand[currentplayer][(cnp - 1)] < 26) {
|
||||
strlcpy (csuitcolour, "\0037", 10);
|
||||
strlcpy (csuit, "Diamonds", 10);
|
||||
} else if (wplayercardsinhand[currentplayer][(cnp - 1)] < 39) {
|
||||
strlcpy (csuitcolour, "\00314", 10);
|
||||
strlcpy (csuit, "Clubs", 10);
|
||||
} else {
|
||||
strlcpy (csuitcolour, "\00315", 10);
|
||||
strlcpy (csuit, "Spades", 10);
|
||||
}
|
||||
switch ((wplayercardsinhand[currentplayer][(cnp - 1)] % 13)) {
|
||||
case 12:
|
||||
strlcpy (csuitcard, "Ace", 10);
|
||||
break;
|
||||
case 11:
|
||||
strlcpy (csuitcard, "King", 10);
|
||||
break;
|
||||
case 10:
|
||||
strlcpy (csuitcard, "Queen", 10);
|
||||
break;
|
||||
case 9:
|
||||
strlcpy (csuitcard, "Jack", 10);
|
||||
break;
|
||||
default:
|
||||
ircsnprintf(csuitcard, 10, "%d", ((wplayercardsinhand[currentplayer][(cnp - 1)] % 13) + 2));
|
||||
break;
|
||||
}
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037%s\0039 played Card\00311 %d \0039(%s %s of %s \0039)", wplayernick[currentplayer], cnp, csuitcolour, csuitcard, csuit);
|
||||
cnp--;
|
||||
wstackcards[wstackcardscurrent]= wplayercardsinhand[currentplayer][cnp];
|
||||
wstackcardscurrent++;
|
||||
wplayercardplayed[currentplayer]= wplayercardsinhand[currentplayer][cnp];
|
||||
wplayercardstotal[currentplayer]--;
|
||||
for (wpln = cnp; wpln < wplayercardstotal[currentplayer]; wpln++) {
|
||||
wplayercardsinhand[currentplayer][wpln]= wplayercardsinhand[currentplayer][(wpln +1)];
|
||||
}
|
||||
wplayercardsinhand[currentplayer][wplayercardstotal[currentplayer]]= 0;
|
||||
currentplayer++;
|
||||
if (currentplayer < currentwarplayercount) {
|
||||
askplaycard();
|
||||
} else {
|
||||
checkhandwinner();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks standard hand for a winner (not a war hand)
|
||||
*/
|
||||
static void checkhandwinner(void)
|
||||
{
|
||||
int i;
|
||||
int hcnp = 0;
|
||||
int hcnpt = 0;
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (warinprogress == wplayeratwar[wpln]) {
|
||||
if ((wplayercardplayed[wpln] % 13) > hcnp) {
|
||||
hcnp = (wplayercardplayed[wpln] % 13);
|
||||
hcnpt = 1;
|
||||
} else if ((wplayercardplayed[wpln] % 13) == hcnp) {
|
||||
hcnpt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hcnpt == 1) {
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (warinprogress == wplayeratwar[wpln]) {
|
||||
if ((wplayercardplayed[wpln] % 13) == hcnp) {
|
||||
if (warinprogress == 1) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037%s\0039 wins the \0034WAR\0039.", wplayernick[wpln]);
|
||||
} else {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037%s\0039 takes the hand.", wplayernick[wpln]);
|
||||
}
|
||||
for (i = 0; i < wstackcardscurrent; i++) {
|
||||
wplayercardsinhand[wpln][wplayercardstotal[wpln]]= wstackcards[i];
|
||||
wplayercardstotal[wpln]++;
|
||||
}
|
||||
clearstack();
|
||||
wpln= currentwarplayercount;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
wplayeratwar[wpln]= 0;
|
||||
}
|
||||
warinprogress= 0;
|
||||
} else {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0034WAR DECLARED");
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (warinprogress == wplayeratwar[wpln]) {
|
||||
wplayeratwar[wpln] = 0;
|
||||
if ((wplayercardplayed[wpln] % 13) == hcnp) {
|
||||
wplayeratwar[wpln]= 1;
|
||||
if (wplayercardstotal[wpln] < 3) {
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0037%s\0038 Surrenders\0039 (Insufficient Cards)", wplayernick[wpln]);
|
||||
hcnpt--;
|
||||
removewar(wplayernick[wpln]);
|
||||
if (currentwarplayercount < 2) {
|
||||
wpln= currentwarplayercount;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
warinprogress= 1;
|
||||
}
|
||||
currentplayer= 0;
|
||||
playershufflecards();
|
||||
askplaycard();
|
||||
}
|
||||
|
||||
/*
|
||||
* copy war hand to normal for checking
|
||||
*/
|
||||
static void checkwarwinner(void)
|
||||
{
|
||||
int i;
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (wplayeratwar[wpln] == 1) {
|
||||
wplayercardplayed[wpln]= wplayerwarcardsplayed[wpln][2];
|
||||
} else {
|
||||
wplayercardplayed[wpln]= 0;
|
||||
}
|
||||
for (i = 0; i < 3; i++) {
|
||||
wplayerwarcardsplayed[wpln][i]= 0;
|
||||
}
|
||||
}
|
||||
checkhandwinner();
|
||||
}
|
||||
|
||||
/*
|
||||
* clears the stack
|
||||
*/
|
||||
static void clearstack(void) {
|
||||
for (wpln = 0; wpln < 52; wpln++) {
|
||||
wstackcards[wpln]= 0;
|
||||
}
|
||||
wstackcardscurrent= 0;
|
||||
}
|
63
pulse.xml
Normal file
63
pulse.xml
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project default-recipe="default">
|
||||
<recipe name="Configure">
|
||||
<post-processor name="checkbuild.pp">
|
||||
<gcc.pp name="gcc.pp"/>
|
||||
<make.pp name="make.pp"/>
|
||||
</post-processor>
|
||||
<executable name="ShutUp Configure" exe="touch" args="${base.dir}/.hush"> </executable>
|
||||
<executable name="run configure" exe="${base.dir}/configure" args="--enable-debug --disable-ccdv --enable-autodebug"> </executable>
|
||||
<make name="build">
|
||||
<process processor="${checkbuild.pp}"/>
|
||||
</make>
|
||||
</recipe>
|
||||
<recipe name="SnapShowCheck">
|
||||
<post-processor name="checkbuild.pp">
|
||||
<gcc.pp name="gcc.pp"/>
|
||||
<make.pp name="make.pp"/>
|
||||
</post-processor>
|
||||
<executable name="ShutUp Configure" exe="touch" args="${base.dir}/.hush"> </executable>
|
||||
<executable name="run configure" exe="${base.dir}/configure" args="--enable-debug --disable-ccdv --enable-autodebug --with-distversion=${build.revision}"> </executable>
|
||||
<make name="Build">
|
||||
<process processor="${checkbuild.pp}"/>
|
||||
</make>
|
||||
<command name="Dist">
|
||||
<make name="dist" targets="dist"/>
|
||||
<artifact name="SnapShot" file="WarServ-*.tar.gz"/>
|
||||
</command>
|
||||
</recipe>
|
||||
<recipe name="Win32-Build">
|
||||
<post-processor name="checkbuild.pp">
|
||||
<regex.pp name="compile.pp">
|
||||
<pattern category="error" expression="\\.[chl]\\([0-9]+\\): error"/>
|
||||
<pattern category="warning" expression="\\.[chl]\\([0-9]+\\): warning"/>
|
||||
</regex.pp>
|
||||
</post-processor>
|
||||
<resource name="Win32" required="true" version="1"/>
|
||||
<command name="Build-Core">
|
||||
<executable name="MSBuild core" exe="${MSBuildPath}\MSBuild.exe" args="WarServ.sln /p:Configuration=Release">
|
||||
<environment name="VCBUILD_DEFAULT_OPTIONS" value="/u"/>
|
||||
<process processor="${checkbuild.pp}"/>
|
||||
</executable>
|
||||
</command>
|
||||
</recipe>
|
||||
<recipe name="Win32-Snapshow">
|
||||
<post-processor name="checkbuild.pp">
|
||||
<regex.pp name="compile.pp">
|
||||
<pattern category="error" expression="\\.[chl]\\([0-9]+\\): error"/>
|
||||
<pattern category="warning" expression="\\.[chl]\\([0-9]+\\): warning"/>
|
||||
</regex.pp>
|
||||
</post-processor>
|
||||
<resource name="Win32" required="true" version="1"/>
|
||||
<command name="Build-Core">
|
||||
<executable name="MSBuild core" exe="${MSBuildPath}\MSBuild.exe" args="WarServ.sln /p:Configuration=Release">
|
||||
<environment name="VCBUILD_DEFAULT_OPTIONS" value="/u"/>
|
||||
<process processor="${checkbuild.pp}"/>
|
||||
</executable>
|
||||
</command>
|
||||
<command name="MakeDist">
|
||||
<executable name="MakeSnap" exe="${base.dir}\\win32\\buildwin32snap.bat" args="${build.revision}"/>
|
||||
<artifact name="WarServ Setup File" file="${base.dir}\\win32\\WarServ-Setup-*.exe"/>
|
||||
</command>
|
||||
</recipe>
|
||||
</project>
|
901
warserv.c
901
warserv.c
|
@ -1,5 +1,5 @@
|
|||
/* WarServ War Card Game Bot - NeoStats Addon Module
|
||||
** Copyright (c) 2004 DeadNotBuried
|
||||
/* WarServ - War Card Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2004-2008 Justin Hammond, Mark Hetherington, Jeff Lang
|
||||
**
|
||||
** 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
|
||||
|
@ -16,805 +16,172 @@
|
|||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
** USA
|
||||
**
|
||||
** WarServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#ifdef WIN32
|
||||
#include "modconfigwin32.h"
|
||||
#else
|
||||
#include "modconfig.h"
|
||||
#endif
|
||||
#include "warserv.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "dl.h" /* Required for module */
|
||||
#include "stats.h" /* Required for bot support */
|
||||
#include "log.h" /* Log systems support */
|
||||
#include "conf.h"
|
||||
static int ws_cmd_set_chan(const CmdParams *cmdparams, SET_REASON reason) ;
|
||||
|
||||
Bot *ws_bot;
|
||||
|
||||
/** Copyright info */
|
||||
static const char *ws_copyright[] = {
|
||||
"Copyright (c) 2004-2008 Justin Hammond, Mark Hetherington, DeadNotBuried",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char *ws_about[] = {
|
||||
"\2War Card Game Service\2",
|
||||
"",
|
||||
"All cards are Dealt out evenly when the game starts.",
|
||||
"The Object of the game is to hold ALL the cards.",
|
||||
"Each Player plays a card from their hand, and the",
|
||||
"highest card wins all cards played that turn.",
|
||||
" ",
|
||||
"If the played cards are equal, there is a War.",
|
||||
"all played cards stay out, and each player involved",
|
||||
"in the war plays 3 more cards. the War continues the",
|
||||
"same way, untill someone wins all the played cards.",
|
||||
"",
|
||||
"If you don't have enough cards to play, your cards are",
|
||||
"automatically put into the center, and you surrender.",
|
||||
"",
|
||||
"NOTE: Game can't be joined to after play has started.",
|
||||
NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* Commands and Settings
|
||||
*/
|
||||
static bot_cmd ws_commands[]=
|
||||
{
|
||||
{"START", StartWarGame, 0, 0, ws_help_start, 0, NULL, NULL},
|
||||
{"STOP", StopWarGame, 0, 0, ws_help_stop, 0, NULL, NULL},
|
||||
{"JOIN", JoinWarGame, 0, 0, ws_help_join, 0, NULL, NULL},
|
||||
{"REMOVE", RemoveWarGame, 0, 0, ws_help_remove, 0, NULL, NULL},
|
||||
{"PLAYERS", ShowPlayersWarGame, 0, 0, ws_help_players, 0, NULL, NULL},
|
||||
{"TURN", ShowTurnWarGame, 0, 0, ws_help_turn, 0, NULL, NULL},
|
||||
{"PLAY", PlayCardsWarGame, 0, 0, ws_help_play, 0, NULL, NULL},
|
||||
NS_CMD_END()
|
||||
};
|
||||
|
||||
static bot_setting ws_settings[]=
|
||||
{
|
||||
{"CHAN", warroom, SET_TYPE_CHANNEL, 0, MAXCHANLEN, NS_ULEVEL_ADMIN, NULL, ws_help_set_chan, ws_cmd_set_chan, (void *)"#Games_War" },
|
||||
NS_SETTING_END()
|
||||
};
|
||||
|
||||
char s_module_bot_name[MAXNICK];
|
||||
char warroom[CHANLEN];
|
||||
char currentwargamestatus[10];
|
||||
int currentwarplayercount;
|
||||
char wplayernick[10][MAXNICK];
|
||||
int wplayercardstotal[10];
|
||||
int wplayercardsinhand[10][52];
|
||||
int wplayercardplayed[10];
|
||||
int warinprogress;
|
||||
int wplayeratwar[10];
|
||||
int wplayerwarcardsplayed[10][3];
|
||||
int wplayerwarcarddisplayed[10];
|
||||
int wstackcards[52];
|
||||
int wstackcardscurrent;
|
||||
int currentplayer;
|
||||
int wpln;
|
||||
int wplnh;
|
||||
char csuit[10];
|
||||
char csuitcolour[10];
|
||||
char csuitcard[10];
|
||||
|
||||
/*
|
||||
* Module Info definition
|
||||
*/
|
||||
ModuleInfo __module_info = {
|
||||
ModuleInfo module_info = {
|
||||
"WarServ",
|
||||
"War Card Game Module For NeoStats",
|
||||
"1.2",
|
||||
ws_copyright,
|
||||
ws_about,
|
||||
NEOSTATS_VERSION,
|
||||
MODULE_VERSION,
|
||||
__DATE__,
|
||||
__TIME__
|
||||
__TIME__,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
/*
|
||||
* respond to the /VERSION command
|
||||
*/
|
||||
int new_m_version(char *origin, char **av, int ac)
|
||||
{
|
||||
snumeric_cmd(351, origin, "Module WarServ Loaded, Version: %s %s %s",
|
||||
__module_info.module_version, __module_info.module_build_date,
|
||||
__module_info.module_build_time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Module function list
|
||||
*/
|
||||
Functions __module_functions[] = {
|
||||
{MSG_VERSION, new_m_version, 1},
|
||||
#ifdef HAVE_TOKEN_SUP
|
||||
{TOK_VERSION, new_m_version, 1},
|
||||
#endif
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
/*
|
||||
* Channel message processing
|
||||
*/
|
||||
int __ChanMessage(char *origin, char **argv, int argc)
|
||||
{
|
||||
char *tsptr;
|
||||
User *u;
|
||||
char *buf;
|
||||
char *bufchal;
|
||||
if (argc < 1) {
|
||||
return -1;
|
||||
}
|
||||
if (strcasecmp(argv[0], warroom)) {
|
||||
return -1;
|
||||
}
|
||||
u = finduser(origin);
|
||||
if (!u) {
|
||||
return -1;
|
||||
}
|
||||
if (argc == 2) {
|
||||
if (!strcasecmp(argv[1], "!rules")) {
|
||||
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, "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, "===========================================");
|
||||
prefmsg(u->nick, s_module_bot_name, "!whelp -- Displays this help");
|
||||
prefmsg(u->nick, s_module_bot_name, "!rules -- displays war rules");
|
||||
prefmsg(u->nick, s_module_bot_name, "!about -- displays about information");
|
||||
prefmsg(u->nick, s_module_bot_name, "!start -- Starts a new game");
|
||||
prefmsg(u->nick, s_module_bot_name, "!stop -- Stops the current game");
|
||||
prefmsg(u->nick, s_module_bot_name, "!players -- Show current players");
|
||||
prefmsg(u->nick, s_module_bot_name, "!turn -- Show who's turn it is");
|
||||
prefmsg(u->nick, s_module_bot_name, "join -- Joins the current game");
|
||||
prefmsg(u->nick, s_module_bot_name, "play # # # -- Plays the card(s) number");
|
||||
prefmsg(u->nick, s_module_bot_name, "!remove -- Removes you from the current game");
|
||||
return 1;
|
||||
} else if (!strcasecmp(argv[1], "!about")) {
|
||||
prefmsg(u->nick, s_module_bot_name, "Welcome To War (The Card Game) v1.0 by DeadNotBuried");
|
||||
return 1;
|
||||
} else if (!strcasecmp(argv[1], "!stop")) {
|
||||
if (strcasecmp(currentwargamestatus, "stopped")) {
|
||||
privmsg(warroom, s_module_bot_name, "\0039Stopping Current Game");
|
||||
stopwar();
|
||||
}
|
||||
} else if (!strcasecmp(argv[1], "!start")) {
|
||||
if (!strcasecmp(currentwargamestatus, "stopped")) {
|
||||
startcountdowntimer(u->nick);
|
||||
return 1;
|
||||
} else if (currentwarplayercount < 10) {
|
||||
privmsg(argv[0], s_module_bot_name, "\0034A game has already started \0037%s\0034, Type '\2\003Join\2\0034' To Join in.", u->nick);
|
||||
return 1;
|
||||
} else {
|
||||
privmsg(argv[0], s_module_bot_name, "\0034A game has already started \0037%s\0034 and all spots are taken. Please try the next game.", u->nick);
|
||||
return 1;
|
||||
}
|
||||
} else if (!strcasecmp(argv[1], "join") || !strcasecmp(argv[1], "j")) {
|
||||
if (!strcasecmp(currentwargamestatus, "starting")) {
|
||||
joinwar(u->nick);
|
||||
return 1;
|
||||
}
|
||||
} else if (!strcasecmp(argv[1], "!Remove")) {
|
||||
if (!strcasecmp(currentwargamestatus, "starting") || !strcasecmp(currentwargamestatus, "started")) {
|
||||
removewar(u->nick);
|
||||
return 1;
|
||||
}
|
||||
} else if (!strcasecmp(argv[1], "!players")) {
|
||||
if (!strcasecmp(currentwargamestatus, "started")) {
|
||||
privmsg(warroom, s_module_bot_name, "\0039Current Players are\0038 :\0037 %s %s %s %s %s %s %s %s %s %s", wplayernick[0], wplayernick[1], wplayernick[2], wplayernick[3], wplayernick[4], wplayernick[5], wplayernick[6], wplayernick[7], wplayernick[8], wplayernick[9]);
|
||||
return 1;
|
||||
}
|
||||
} else if (!strcasecmp(argv[1], "!turn")) {
|
||||
if (!strcasecmp(currentwargamestatus, "started")) {
|
||||
if (warinprogress == 1) {
|
||||
privmsg(warroom, s_module_bot_name, "\0039The Current Player is \0037%s\0039 holding\00311 %d\0039 cards, and are currently at \0034WAR\0039 which three would you like to play ?", wplayernick[currentplayer], wplayercardstotal[currentplayer]);
|
||||
} else {
|
||||
privmsg(warroom, s_module_bot_name, "\0039The Current Player is \0037%s\0039 currently holding\00311 %d\0039 cards, which would you like to play ?", wplayernick[currentplayer], wplayercardstotal[currentplayer]);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
} else if (argc > 2) {
|
||||
if ((!strcasecmp(argv[1], "play") || !strcasecmp(argv[1], "p")) && !strcasecmp(u->nick,wplayernick[currentplayer]) && !strcasecmp(currentwargamestatus, "started")) {
|
||||
if (warinprogress == 1) {
|
||||
if (argc == 5) {
|
||||
playwarcards(argv[2], argv[3], argv[4]);
|
||||
}
|
||||
} else {
|
||||
if (argc == 3) {
|
||||
playcard(argv[2]);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
} else if (!strcasecmp(argv[1], "!Remove")) {
|
||||
if (!strcasecmp(currentwargamestatus, "starting") || !strcasecmp(currentwargamestatus, "started")) {
|
||||
removewarother(u->nick, argv[2]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* private message processing
|
||||
*/
|
||||
int __BotMessage(char *origin, char **argv, int argc)
|
||||
{
|
||||
User *u;
|
||||
char *bufchal;
|
||||
u = finduser(origin);
|
||||
if (!u) {
|
||||
return -1;
|
||||
}
|
||||
if (strcasecmp(argv[0], s_module_bot_name)) {
|
||||
return -1;
|
||||
}
|
||||
if (argc >= 2) {
|
||||
if (!strcasecmp(argv[1], "help")) {
|
||||
prefmsg(u->nick, s_module_bot_name, "Currently available commands are all public commands");
|
||||
prefmsg(u->nick, s_module_bot_name, "To see currently available public commands");
|
||||
prefmsg(u->nick, s_module_bot_name, "type !whelp in the main channel ( %s )", warroom);
|
||||
if (UserLevel(u) >= NS_ULEVEL_OPER) {
|
||||
prefmsg(u->nick, s_module_bot_name, "\2CHAN <channel>\2 - Swap WarGame Channel to <channel>");
|
||||
}
|
||||
return 1;
|
||||
} else if (!strcasecmp(argv[1], "CHAN") && (UserLevel(u) >= NS_ULEVEL_OPER)) {
|
||||
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);
|
||||
schmode_cmd(s_module_bot_name, warroom, "+o", s_module_bot_name);
|
||||
SET_SEGV_INMODULE("WarServ");
|
||||
SetConf((void *)warroom, CFGSTR, "WarRoom");
|
||||
return NS_SUCCESS;
|
||||
} else {
|
||||
prefmsg(u->nick, s_module_bot_name, "Invalid Command. /msg %s help for more info", s_module_bot_name);
|
||||
}
|
||||
}
|
||||
|
||||
prefmsg(u->nick, s_module_bot_name, "'/msg %s help' to list commands", s_module_bot_name);
|
||||
bufchal = joinbuf(argv, argc, 1);
|
||||
chanalert(s_module_bot_name, "\0038Recieved Private Message from\0037 %s\0038 :\003 %s", u->nick, bufchal);
|
||||
free(bufchal);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Online event processing
|
||||
*/
|
||||
int Online(char **av, int ac)
|
||||
{
|
||||
char *tmp;
|
||||
/* Introduce a bot onto the network */
|
||||
if (init_bot(s_module_bot_name, "WarServ", me.host, "War Game Service", "+oSq",
|
||||
__module_info.module_name) == -1) {
|
||||
/* nick was in use */
|
||||
return 0;
|
||||
}
|
||||
srand((unsigned int)time(NULL));
|
||||
/* channel to play game in */
|
||||
if (GetConf((void *)&tmp, CFGSTR, "WarRoom") <= 0) {
|
||||
strlcpy(warroom, "#Games", CHANLEN);
|
||||
} else {
|
||||
strlcpy(warroom, tmp, CHANLEN);
|
||||
}
|
||||
chanalert(s_module_bot_name, "Game will start in %s", warroom);
|
||||
sjoin_cmd(s_module_bot_name, warroom);
|
||||
schmode_cmd(s_module_bot_name, warroom, "+o", s_module_bot_name);
|
||||
return 1;
|
||||
};
|
||||
|
||||
/*
|
||||
* Nick Change Check
|
||||
*/
|
||||
int PlayerNickChange(char **av, int ac) {
|
||||
if (currentwarplayercount < 1) {
|
||||
return 1;
|
||||
}
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (!strcasecmp(wplayernick[wpln], av[0])) {
|
||||
strncpy(wplayernick[wpln], av[1], MAXNICK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Module event list
|
||||
*/
|
||||
EventFnList __module_events[] = {
|
||||
{EVENT_ONLINE, Online},
|
||||
{EVENT_NICKCHANGE, PlayerNickChange},
|
||||
{NULL, NULL}
|
||||
ModuleEvent module_events[] = {
|
||||
{EVENT_NICK, PlayerNickChange, 0},
|
||||
{EVENT_QUIT, CheckPlayerQuit},
|
||||
{EVENT_KILL, CheckPlayerKill},
|
||||
{EVENT_LOCALKILL, CheckPlayerKill},
|
||||
{EVENT_PART, CheckPlayerPart},
|
||||
{EVENT_KICK, CheckPlayerKick},
|
||||
NS_EVENT_END()
|
||||
};
|
||||
|
||||
/** BotInfo */
|
||||
static BotInfo ws_botinfo =
|
||||
{
|
||||
"WarServ",
|
||||
"WarServ1",
|
||||
"WarServ",
|
||||
BOT_COMMON_HOST,
|
||||
"War Game Service",
|
||||
BOT_FLAG_SERVICEBOT|BOT_FLAG_PERSIST,
|
||||
ws_commands,
|
||||
ws_settings,
|
||||
};
|
||||
|
||||
/*
|
||||
* Online event processing
|
||||
*/
|
||||
int ModSynch (void)
|
||||
{
|
||||
/* Introduce a bot onto the network */
|
||||
ws_bot = AddBot (&ws_botinfo);
|
||||
if (!ws_bot) {
|
||||
return NS_FAILURE;
|
||||
}
|
||||
srand((unsigned int)me.now);
|
||||
/* channel to play game in */
|
||||
if (DBAFetchConfigStr ("WarRoom", warroom, MAXCHANLEN) != NS_SUCCESS) {
|
||||
strlcpy (warroom, "#Games_War", MAXCHANLEN);
|
||||
}
|
||||
irc_chanalert (ws_bot, "Game will start in %s", warroom);
|
||||
irc_join (ws_bot, warroom, "+o");
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Init module
|
||||
*/
|
||||
int __ModInit(int modnum, int apiver)
|
||||
int ModInit( void )
|
||||
{
|
||||
strncpy(s_module_bot_name, "WarServ", MAXNICK);
|
||||
stopwar();
|
||||
return 1;
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Exit module
|
||||
*/
|
||||
void __ModFini()
|
||||
int ModFini( void )
|
||||
{
|
||||
del_mod_timer("wartimer");
|
||||
};
|
||||
|
||||
/*
|
||||
* Deal Cards
|
||||
*/
|
||||
|
||||
int wardealcards() {
|
||||
int cd;
|
||||
int cnd;
|
||||
int cndn;
|
||||
int ptdt = 0;
|
||||
for (wpln = 0; wpln < 52; wpln++) {
|
||||
wstackcards[wpln]= wpln;
|
||||
}
|
||||
for (cd = 52; cd > 0; cd--) {
|
||||
cnd= rand() % cd;
|
||||
cndn= wstackcards[cnd];
|
||||
for (wpln = cnd; wpln < (cd - 1); wpln++) {
|
||||
wstackcards[wpln]= wstackcards[(wpln + 1)];
|
||||
}
|
||||
wstackcards[(cd - 1)]= 0;
|
||||
wplayercardsinhand[ptdt][wplayercardstotal[ptdt]]= cndn;
|
||||
wplayercardstotal[ptdt]++;
|
||||
ptdt++;
|
||||
if (ptdt == currentwarplayercount) {
|
||||
ptdt= 0;
|
||||
}
|
||||
if (currentwargamestatus == WS_GAME_STARTING) {
|
||||
DelTimer ("startwar");
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Shuffle Players Cards
|
||||
* Set Overrides
|
||||
*/
|
||||
|
||||
int playershufflecards() {
|
||||
int tcs;
|
||||
int tcsp;
|
||||
int tcsps;
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
for (wplnh = 0; wplnh < wplayercardstotal[wpln]; wplnh++) {
|
||||
tcsps= 0;
|
||||
tcsp= rand() % wplayercardstotal[wpln];
|
||||
if (tcsp == wplnh) {
|
||||
tcsps= 1;
|
||||
}
|
||||
if (tcsps == 0) {
|
||||
tcs= wplayercardsinhand[wpln][tcsp];
|
||||
wplayercardsinhand[wpln][tcsp] = wplayercardsinhand[wpln][wplnh];
|
||||
wplayercardsinhand[wpln][wplnh] = tcs;
|
||||
}
|
||||
static int ws_cmd_set_chan(const CmdParams *cmdparams, SET_REASON reason)
|
||||
{
|
||||
if (reason == SET_VALIDATE) {
|
||||
if (currentwargamestatus != WS_GAME_STOPPED) {
|
||||
irc_prefmsg (ws_bot, cmdparams->source, "Unable to change Game Channel while Game in Progress.");
|
||||
return NS_FAILURE;
|
||||
}
|
||||
irc_chanalert (ws_bot, "Game Channel Changing to %s , Parting %s (%s)", cmdparams->av[1], warroom, cmdparams->source->name);
|
||||
irc_chanprivmsg (ws_bot, warroom, "\0039%s has changed Channels, Game will now be available in %s", cmdparams->source->name, cmdparams->av[1]);
|
||||
irc_part (ws_bot, warroom, NULL);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Stop Game
|
||||
* resets everything to default as if no game running
|
||||
*/
|
||||
|
||||
int stopwar() {
|
||||
del_mod_timer("wartimer");
|
||||
for (wpln = 0; wpln < 10; wpln++) {
|
||||
strncpy(wplayernick[wpln], " ", MAXNICK);
|
||||
wplayercardstotal[wpln]= 0;
|
||||
wplayercardplayed[wpln]= 0;
|
||||
wplayeratwar[wpln]= 0;
|
||||
wplayerwarcarddisplayed[wpln]= 0;
|
||||
for (wplnh = 0; wplnh < 52; wplnh++) {
|
||||
wplayercardsinhand[wpln][wplnh]= 0;
|
||||
}
|
||||
for (wplnh = 0; wplnh < 3; wplnh++) {
|
||||
wplayerwarcardsplayed[wpln][wplnh]= 0;
|
||||
}
|
||||
}
|
||||
for (wpln = 0; wpln < 52; wpln++) {
|
||||
wstackcards[wpln]= 0;
|
||||
}
|
||||
warinprogress= 0;
|
||||
wstackcardscurrent= 0;
|
||||
currentwarplayercount = 0;
|
||||
strncpy(currentwargamestatus, "Stopped", 10);
|
||||
currentplayer= 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start Game Countdown
|
||||
* Starts a timer to allow 30 seconds for people to join the game
|
||||
*/
|
||||
|
||||
int startcountdowntimer(char *nic) {
|
||||
strncpy(currentwargamestatus, "starting", 10);
|
||||
privmsg(warroom, s_module_bot_name, "\0037A new game of \0034WAR\0037 has been started by %s. Game will start in 30 seconds, type '\2\003Join\2\0037' to play.", nic);
|
||||
add_mod_timer("startwar", "wartimer", __module_info.module_name, 30);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start Game
|
||||
* Initializes variables and starts game
|
||||
*/
|
||||
|
||||
void startwar() {
|
||||
del_mod_timer("wartimer");
|
||||
if (!strcasecmp(currentwargamestatus, "starting")) {
|
||||
if (currentwarplayercount < 1) {
|
||||
privmsg(warroom, s_module_bot_name, "\0034No Players joined to current Game, Exiting");
|
||||
stopwar();
|
||||
return;
|
||||
}
|
||||
if (currentwarplayercount < 10) {
|
||||
joinwar(s_module_bot_name);
|
||||
}
|
||||
privmsg(warroom, s_module_bot_name, "\0034WAR\00310 is now starting, current players are \0037%s %s %s %s %s %s %s %s %s %s", wplayernick[0], wplayernick[1], wplayernick[2], wplayernick[3], wplayernick[4], wplayernick[5], wplayernick[6], wplayernick[7], wplayernick[8], wplayernick[9]);
|
||||
privmsg(warroom, s_module_bot_name, "\0039Shuffling Deck and Dealing Cards");
|
||||
currentplayer= 0;
|
||||
strncpy(currentwargamestatus, "started", 10);
|
||||
wardealcards();
|
||||
wstackcardscurrent= 0;
|
||||
askplaycard();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Join Game
|
||||
* adds new player to game during countdown
|
||||
*/
|
||||
|
||||
int joinwar(char *nic) {
|
||||
if (currentwarplayercount < 10) {
|
||||
for (wpln = 0; wpln < 10; wpln++) {
|
||||
if (!strcasecmp(wplayernick[wpln], nic)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
strncpy(wplayernick[currentwarplayercount], nic, MAXNICK);
|
||||
currentwarplayercount++;
|
||||
privmsg(warroom, s_module_bot_name, "\0038Welcome to \0034WAR \0037%s", nic);
|
||||
} else {
|
||||
privmsg(warroom, s_module_bot_name, "\0034Sorry all places are filled \0037%s\0034, your welcome to try the next game though", nic);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove Nick ( Not Online )
|
||||
* allows removal of a player by anyone if player no longer connected to ircd
|
||||
*/
|
||||
|
||||
int removewarother(char *nic, char *ntr) {
|
||||
User *u;
|
||||
u = finduser(ntr);
|
||||
if (!u) {
|
||||
removewar(ntr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove Player
|
||||
* removes player from game and adds any cards they have to the stack
|
||||
*/
|
||||
|
||||
int removewar(char *nic) {
|
||||
int tfrpacp;
|
||||
int tfrpacpn;
|
||||
int wplnht;
|
||||
int cpfp;
|
||||
tfrpacp= 0;
|
||||
tfrpacpn= 0;
|
||||
if (currentwarplayercount < 1) {
|
||||
return 1;
|
||||
}
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (!strcasecmp(wplayernick[wpln], nic)) {
|
||||
privmsg(warroom, s_module_bot_name, "\0037%s \0038Removed from the current game of \0034War", nic);
|
||||
if (wpln == currentplayer) {
|
||||
tfrpacp= 1;
|
||||
} else if (wpln < currentplayer) {
|
||||
tfrpacp= 2;
|
||||
tfrpacpn= wpln;
|
||||
}
|
||||
for (wplnht = 0; wplnht < wplayercardstotal[wpln]; wplnht++) {
|
||||
wstackcards[wstackcardscurrent]= wplayercardsinhand[wpln][wplnht];
|
||||
wstackcardscurrent++;
|
||||
}
|
||||
for (wplnh = wpln; wplnh < currentwarplayercount; wplnh++) {
|
||||
cpfp= (wplnh + 1);
|
||||
if (cpfp == currentwarplayercount) {
|
||||
strncpy(wplayernick[wplnh], " ", MAXNICK);
|
||||
for (wplnht = 0; wplnht < wplayercardstotal[wplnh]; wplnht++) {
|
||||
wplayercardsinhand[wplnh][wplnht]= 0;
|
||||
}
|
||||
wplayercardstotal[wplnh]= 0;
|
||||
} else {
|
||||
strncpy(wplayernick[wplnh], wplayernick[cpfp], MAXNICK);
|
||||
for (wplnht = 0; wplnht < 52; wplnht++) {
|
||||
wplayercardsinhand[wplnh][wplnht]= wplayercardsinhand[cpfp][wplnht];
|
||||
}
|
||||
wplayercardstotal[wplnh]= wplayercardstotal[cpfp];
|
||||
}
|
||||
}
|
||||
currentwarplayercount--;
|
||||
}
|
||||
}
|
||||
if (currentwarplayercount < 2) {
|
||||
privmsg(warroom, s_module_bot_name, "\0039Stopping Current Game , \0037%s\0039 wins.", wplayernick[0]);
|
||||
stopwar();
|
||||
} else if (tfrpacp == 1) {
|
||||
if (currentplayer > (currentwarplayercount - 1)) {
|
||||
currentplayer= 0;
|
||||
}
|
||||
if (strcasecmp(currentwargamestatus, "starting")) {
|
||||
askplaycard();
|
||||
}
|
||||
} else if (tfrpacp == 2) {
|
||||
if (currentplayer > tfrpacpn) {
|
||||
currentplayer--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* asks each player for card to play
|
||||
* or check war results if in war
|
||||
* or removes player if no cards left
|
||||
*/
|
||||
|
||||
int askplaycard() {
|
||||
int trn;
|
||||
int wspa[5];
|
||||
char wspas[5][3];
|
||||
int nwp = (currentwarplayercount + 1);
|
||||
if (wplayercardstotal[currentplayer] == 0) {
|
||||
removewar(wplayernick[currentplayer]);
|
||||
return 1;
|
||||
}
|
||||
if (wplayercardstotal[currentplayer] == 52) {
|
||||
currentplayer++;
|
||||
removewar(wplayernick[currentplayer]);
|
||||
return 1;
|
||||
}
|
||||
if (warinprogress == 1) {
|
||||
if (currentplayer < currentwarplayercount) {
|
||||
for (wpln = currentplayer; wpln < currentwarplayercount; wpln++) {
|
||||
if (wplayeratwar[wpln] == 1) {
|
||||
nwp= wpln;
|
||||
wpln= currentwarplayercount;
|
||||
}
|
||||
}
|
||||
currentplayer = nwp;
|
||||
}
|
||||
if (nwp > currentwarplayercount) {
|
||||
checkwarwinner();
|
||||
} else {
|
||||
if (!strcasecmp(wplayernick[currentplayer], s_module_bot_name)) {
|
||||
trn= wplayercardstotal[currentplayer];
|
||||
wspa[2]= ((rand() % trn) + 1);
|
||||
trn--;
|
||||
wspa[3]= ((rand() % trn) + 1);
|
||||
if (wspa[3] == wspa[2]) {
|
||||
wspa[3]++;
|
||||
}
|
||||
trn--;
|
||||
wspa[4]= ((rand() % trn) + 1);
|
||||
if ((wspa[4] == wspa[2]) || (wspa[4] == wspa[3])) {
|
||||
wspa[4]++;
|
||||
}
|
||||
if ((wspa[4] == wspa[2]) || (wspa[4] == wspa[3])) {
|
||||
wspa[4]++;
|
||||
}
|
||||
for (wpln = 2; wpln < 5; wpln++) {
|
||||
snprintf(wspas[wpln], 3, "%d", wspa[wpln]);
|
||||
}
|
||||
playwarcards(wspas[2], wspas[3], wspas[4]);
|
||||
} else {
|
||||
privmsg(warroom, s_module_bot_name, "\0037%s\0039 you hold\00311 %d\0039 cards, and are currently at \0034WAR\0039 which three would you like to play ?", wplayernick[currentplayer], wplayercardstotal[currentplayer]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!strcasecmp(wplayernick[currentplayer], s_module_bot_name)) {
|
||||
snprintf(wspas[0], 3, "%d", ((rand() % wplayercardstotal[currentplayer]) + 1));
|
||||
playcard(wspas[0]);
|
||||
} else {
|
||||
privmsg(warroom, s_module_bot_name, "\0037%s\0039 you currently hold\00311 %d\0039 cards, which would you like to play ?", wplayernick[currentplayer], wplayercardstotal[currentplayer]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Player War Play Card
|
||||
*/
|
||||
|
||||
int playwarcards(char *cnps1, char *cnps2, char *cnps3) {
|
||||
int ncob;
|
||||
int cnp[3];
|
||||
char *tempint;
|
||||
cnp[0] = atoi(cnps1);
|
||||
cnp[1] = atoi(cnps2);
|
||||
cnp[2] = atoi(cnps3);
|
||||
for (wpln = 0; wpln < 3; wpln++) {
|
||||
if ((cnp[wpln] < 1) || (cnp[wpln] > wplayercardstotal[currentplayer])) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (wplayercardsinhand[currentplayer][(cnp[2] - 1)] < 13) {
|
||||
strncpy(csuitcolour, "\0034", 10);
|
||||
strncpy(csuit, "Hearts", 10);
|
||||
} else if (wplayercardsinhand[currentplayer][(cnp[2] - 1)] < 26) {
|
||||
strncpy(csuitcolour, "\0037", 10);
|
||||
strncpy(csuit, "Diamonds", 10);
|
||||
} else if (wplayercardsinhand[currentplayer][(cnp[2] - 1)] < 39) {
|
||||
strncpy(csuitcolour, "\00314", 10);
|
||||
strncpy(csuit, "Clubs", 10);
|
||||
} else {
|
||||
strncpy(csuitcolour, "\00315", 10);
|
||||
strncpy(csuit, "Spades", 10);
|
||||
}
|
||||
switch ((wplayercardsinhand[currentplayer][(cnp[2] - 1)] % 13)) {
|
||||
case 12:
|
||||
strncpy(csuitcard, "Ace", 10);
|
||||
break;
|
||||
case 11:
|
||||
strncpy(csuitcard, "King", 10);
|
||||
break;
|
||||
case 10:
|
||||
strncpy(csuitcard, "Queen", 10);
|
||||
break;
|
||||
case 9:
|
||||
strncpy(csuitcard, "Jack", 10);
|
||||
break;
|
||||
default:
|
||||
snprintf(csuitcard, 10, "%d", ((wplayercardsinhand[currentplayer][(cnp[2] - 1)] % 13) + 2));
|
||||
break;
|
||||
}
|
||||
privmsg(warroom, s_module_bot_name, "\0037%s\0039 played Cards\00311 %d , %d , %d \0039(%s %s of %s \0039)", wplayernick[currentplayer], cnp[0], cnp[1], cnp[2], csuitcolour, csuitcard, csuit);
|
||||
for (wpln = 0; wpln < 3; wpln++) {
|
||||
cnp[wpln]--;
|
||||
wstackcards[wstackcardscurrent]= wplayercardsinhand[currentplayer][cnp[wpln]];
|
||||
wstackcardscurrent++;
|
||||
wplayerwarcardsplayed[currentplayer][wpln]= wplayercardsinhand[currentplayer][cnp[wpln]];
|
||||
}
|
||||
if (cnp[2] > cnp[0])
|
||||
cnp[2]--;
|
||||
if (cnp[2] > cnp[1])
|
||||
cnp[2]--;
|
||||
if (cnp[1] > cnp[0])
|
||||
cnp[1]--;
|
||||
for (wpln = 0; wpln < 3; wpln++) {
|
||||
wplayercardstotal[currentplayer]--;
|
||||
for (wplnh = cnp[wpln]; wplnh < wplayercardstotal[currentplayer]; wplnh++) {
|
||||
wplayercardsinhand[currentplayer][wplnh]= wplayercardsinhand[currentplayer][(wplnh +1)];
|
||||
}
|
||||
wplayercardsinhand[currentplayer][wplayercardstotal[currentplayer]]= 0;
|
||||
}
|
||||
currentplayer++;
|
||||
if (currentplayer < currentwarplayercount) {
|
||||
askplaycard();
|
||||
} else {
|
||||
checkwarwinner();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Player Plays Card
|
||||
*/
|
||||
|
||||
int playcard(char *cnps) {
|
||||
int cnp;
|
||||
cnp = atoi(cnps);
|
||||
if ((cnp > 0) && (cnp < (wplayercardstotal[currentplayer] + 1))){
|
||||
if (wplayercardsinhand[currentplayer][(cnp - 1)] < 13) {
|
||||
strncpy(csuitcolour, "\0034", 10);
|
||||
strncpy(csuit, "Hearts", 10);
|
||||
} else if (wplayercardsinhand[currentplayer][(cnp - 1)] < 26) {
|
||||
strncpy(csuitcolour, "\0037", 10);
|
||||
strncpy(csuit, "Diamonds", 10);
|
||||
} else if (wplayercardsinhand[currentplayer][(cnp - 1)] < 39) {
|
||||
strncpy(csuitcolour, "\00314", 10);
|
||||
strncpy(csuit, "Clubs", 10);
|
||||
} else {
|
||||
strncpy(csuitcolour, "\00315", 10);
|
||||
strncpy(csuit, "Spades", 10);
|
||||
}
|
||||
switch ((wplayercardsinhand[currentplayer][(cnp - 1)] % 13)) {
|
||||
case 12:
|
||||
strncpy(csuitcard, "Ace", 10);
|
||||
break;
|
||||
case 11:
|
||||
strncpy(csuitcard, "King", 10);
|
||||
break;
|
||||
case 10:
|
||||
strncpy(csuitcard, "Queen", 10);
|
||||
break;
|
||||
case 9:
|
||||
strncpy(csuitcard, "Jack", 10);
|
||||
break;
|
||||
default:
|
||||
snprintf(csuitcard, 10, "%d", ((wplayercardsinhand[currentplayer][(cnp - 1)] % 13) + 2));
|
||||
break;
|
||||
}
|
||||
privmsg(warroom, s_module_bot_name, "\0037%s\0039 played Card\00311 %d \0039(%s %s of %s \0039)", wplayernick[currentplayer], cnp, csuitcolour, csuitcard, csuit);
|
||||
cnp--;
|
||||
wstackcards[wstackcardscurrent]= wplayercardsinhand[currentplayer][cnp];
|
||||
wstackcardscurrent++;
|
||||
wplayercardplayed[currentplayer]= wplayercardsinhand[currentplayer][cnp];
|
||||
wplayercardstotal[currentplayer]--;
|
||||
for (wpln = cnp; wpln < wplayercardstotal[currentplayer]; wpln++) {
|
||||
wplayercardsinhand[currentplayer][wpln]= wplayercardsinhand[currentplayer][(wpln +1)];
|
||||
}
|
||||
wplayercardsinhand[currentplayer][wplayercardstotal[currentplayer]]= 0;
|
||||
currentplayer++;
|
||||
if (currentplayer < currentwarplayercount) {
|
||||
askplaycard();
|
||||
} else {
|
||||
checkhandwinner();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks standard hand for a winner (not a war hand)
|
||||
*/
|
||||
|
||||
int checkhandwinner() {
|
||||
int hcnp = 0;
|
||||
int hcnpt = 0;
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (warinprogress == wplayeratwar[wpln]) {
|
||||
if ((wplayercardplayed[wpln] % 13) > hcnp) {
|
||||
hcnp = (wplayercardplayed[wpln] % 13);
|
||||
hcnpt = 1;
|
||||
} else if ((wplayercardplayed[wpln] % 13) == hcnp) {
|
||||
hcnpt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hcnpt == 1) {
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (warinprogress == wplayeratwar[wpln]) {
|
||||
if ((wplayercardplayed[wpln] % 13) == hcnp) {
|
||||
if (warinprogress == 1) {
|
||||
privmsg(warroom, s_module_bot_name, "\0037%s\0039 wins the \0034WAR\0039.", wplayernick[wpln]);
|
||||
} else {
|
||||
privmsg(warroom, s_module_bot_name, "\0037%s\0039 takes the hand.", wplayernick[wpln]);
|
||||
}
|
||||
for (wplnh = 0; wplnh < wstackcardscurrent; wplnh++) {
|
||||
wplayercardsinhand[wpln][wplayercardstotal[wpln]]= wstackcards[wplnh];
|
||||
wplayercardstotal[wpln]++;
|
||||
}
|
||||
clearstack();
|
||||
wpln= currentwarplayercount;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
wplayeratwar[wpln]= 0;
|
||||
}
|
||||
warinprogress= 0;
|
||||
} else {
|
||||
privmsg(warroom, s_module_bot_name, "\0034WAR DECLARED");
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (warinprogress == wplayeratwar[wpln]) {
|
||||
wplayeratwar[wpln] = 0;
|
||||
if ((wplayercardplayed[wpln] % 13) == hcnp) {
|
||||
wplayeratwar[wpln]= 1;
|
||||
if (wplayercardstotal[wpln] < 3) {
|
||||
privmsg(warroom, s_module_bot_name, "\0037%s\0038 Surrenders\0039 (Insufficient Cards)", wplayernick[wpln]);
|
||||
hcnpt--;
|
||||
removewar(wplayernick[wpln]);
|
||||
if (currentwarplayercount < 2) {
|
||||
wpln= currentwarplayercount;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
warinprogress= 1;
|
||||
}
|
||||
currentplayer= 0;
|
||||
playershufflecards();
|
||||
askplaycard();
|
||||
}
|
||||
|
||||
/*
|
||||
* copy war hand to normal for checking
|
||||
*/
|
||||
|
||||
int checkwarwinner() {
|
||||
for (wpln = 0; wpln < currentwarplayercount; wpln++) {
|
||||
if (wplayeratwar[wpln] == 1) {
|
||||
wplayercardplayed[wpln]= wplayerwarcardsplayed[wpln][2];
|
||||
} else {
|
||||
wplayercardplayed[wpln]= 0;
|
||||
}
|
||||
for (wplnh = 0; wplnh < 3; wplnh++) {
|
||||
wplayerwarcardsplayed[wpln][wplnh]= 0;
|
||||
}
|
||||
}
|
||||
checkhandwinner();
|
||||
}
|
||||
|
||||
/*
|
||||
* clears the stack
|
||||
*/
|
||||
|
||||
int clearstack() {
|
||||
for (wpln = 0; wpln < 52; wpln++) {
|
||||
wstackcards[wpln]= 0;
|
||||
}
|
||||
wstackcardscurrent= 0;
|
||||
if (reason == SET_CHANGE) {
|
||||
irc_join (ws_bot, warroom, "+o");
|
||||
irc_chanalert (ws_bot, "Game Now Available In %s", warroom);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
|
77
warserv.h
Normal file
77
warserv.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
/* WarServ - War Card Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2004-2008 Justin Hammond, Mark Hetherington, Jeff Lang
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** WarServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
extern Bot *ws_bot;
|
||||
|
||||
/*
|
||||
* WarServ Module Help
|
||||
*/
|
||||
extern const char *ws_help_set_chan[];
|
||||
extern const char *ws_help_start[];
|
||||
extern const char *ws_help_stop[];
|
||||
extern const char *ws_help_join[];
|
||||
extern const char *ws_help_remove[];
|
||||
extern const char *ws_help_players[];
|
||||
extern const char *ws_help_turn[];
|
||||
extern const char *ws_help_play[];
|
||||
|
||||
/*
|
||||
* Defines
|
||||
*/
|
||||
#define WS_GAME_STOPPED 0x00000001 /* Game Not Running */
|
||||
#define WS_GAME_STARTING 0x00000002 /* Game Starting */
|
||||
#define WS_GAME_PLAYING 0x00000003 /* Game Running */
|
||||
#define WS_GAME_STOPPING 0x00000004 /* Game Running */
|
||||
|
||||
/*
|
||||
* Variables
|
||||
*/
|
||||
extern char warroom[MAXCHANLEN];
|
||||
extern int currentwargamestatus;
|
||||
extern int currentwarplayercount;
|
||||
extern char wplayernick[10][MAXNICK];
|
||||
extern int wplayercardstotal[10];
|
||||
extern int warinprogress;
|
||||
extern int currentplayer;
|
||||
extern int wpln;
|
||||
|
||||
/*
|
||||
* Procedures
|
||||
*/
|
||||
int PlayerNickChange (const CmdParams *cmdparams);
|
||||
int StartWarGame (const CmdParams *cmdparams);
|
||||
int StopWarGame (const CmdParams *cmdparams);
|
||||
int JoinWarGame (const CmdParams *cmdparams);
|
||||
int RemoveWarGame (const CmdParams *cmdparams);
|
||||
int ShowPlayersWarGame (const CmdParams *cmdparams);
|
||||
int ShowTurnWarGame (const CmdParams *cmdparams);
|
||||
int PlayCardsWarGame (const CmdParams *cmdparams);
|
||||
int CheckPlayerPart (const CmdParams *cmdparams);
|
||||
int CheckPlayerQuit (const CmdParams *cmdparams);
|
||||
int CheckPlayerKick (const CmdParams *cmdparams);
|
||||
int CheckPlayerKill (const CmdParams *cmdparams);
|
||||
void stopwar(void);
|
||||
void startcountdowntimer(char *nic);
|
||||
void joinwar(char *nic);
|
||||
void removewar(char *nic);
|
||||
void playwarcards(int cnp1, int cnp2, int cnp3);
|
||||
void playcard(int cnp);
|
17
warserv.sln
Normal file
17
warserv.sln
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WarServ", "warserv.vcproj", "{D4947737-CFE5-4368-92AF-B79C0F55D09B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D4947737-CFE5-4368-92AF-B79C0F55D09B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D4947737-CFE5-4368-92AF-B79C0F55D09B}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
236
warserv.vcproj
Executable file
236
warserv.vcproj
Executable file
|
@ -0,0 +1,236 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="WarServ"
|
||||
ProjectGUID="{D4947737-CFE5-4368-92AF-B79C0F55D09B}"
|
||||
RootNamespace="WarServ"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\dev\include;..\dev\lib\curl;..\dev\lib\pcre"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WarServ_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Ws2_32.lib neostats.lib pcred.lib"
|
||||
OutputFile="../dev/modules/WarServd.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\\dev\lib;..\dev\src\Debug"
|
||||
IgnoreDefaultLibraryNames="LIBC"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/WarServ.pdb"
|
||||
SubSystem="2"
|
||||
ResourceOnlyDLL="false"
|
||||
ImportLibrary="$(OutDir)/WarServ.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""%programfiles%\NeoStats\include";"C:\Program Files\NeoStats\include";win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WarServ_EXPORTS;LIBRARY_MODE;YY_NO_UNISTD_H;TALKFILTERS_EXPORTS"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Ws2_32.lib neostats.lib pcre.lib"
|
||||
OutputFile="WarServ.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""C:\program Files\NeoStats\libs""
|
||||
IgnoreDefaultLibraryNames="LIBC"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
ImportLibrary="$(OutDir)/WarServ.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\events.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\play.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\warserv.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\warserv_help.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\win32\modconfigwin32.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\warserv.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\win32\neostatsversion.rc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
100
warserv_help.c
Normal file
100
warserv_help.c
Normal file
|
@ -0,0 +1,100 @@
|
|||
/* WarServ - War Card Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2004-2008 Justin Hammond, Mark Hetherington, Jeff Lang
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** WarServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "warserv.h"
|
||||
|
||||
const char *ws_help_set_chan[] = {
|
||||
"\2CHAN <#Channel>\2 - Set Channel War Games Play in",
|
||||
NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* Help Text
|
||||
*/
|
||||
|
||||
const char *ws_help_start[] = {
|
||||
"Start a Game in Channel",
|
||||
"Syntax: \2START\2",
|
||||
"",
|
||||
"Starts War Game in configured Channel.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ws_help_stop[] = {
|
||||
"Stops Game",
|
||||
"Syntax: \2STOP\2",
|
||||
"",
|
||||
"Stops Currently Running War Game.",
|
||||
"Only Available to a Current PLayer.",
|
||||
"",
|
||||
"NOTE: May be used at any time by a Global IRCop.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ws_help_join[] = {
|
||||
"Join a game currently Starting",
|
||||
"Syntax: \2JOIN\2",
|
||||
"",
|
||||
"Joins you to the Currently Starting Game.",
|
||||
"NOTE: Once Game Starts no New Joins Allowed.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ws_help_remove[] = {
|
||||
"Remove From Game",
|
||||
"Syntax: \2REMOVE <nick>\2",
|
||||
"",
|
||||
"With No Nick specified, removes you from the current game.",
|
||||
"",
|
||||
"With Nick specified, removes Nick from the curent Game, as",
|
||||
"long as Nick is no longer connected to the network.",
|
||||
"",
|
||||
"NOTE: Global IRCop's may remove players even",
|
||||
"if the player is connected to the network.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ws_help_players[] = {
|
||||
"Display Player List In Channel",
|
||||
"Syntax: \2PLAYERS\2",
|
||||
"",
|
||||
"Displays List of Current Players in channel.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ws_help_turn[] = {
|
||||
"Display Current Player In Channel",
|
||||
"Syntax: \2TURN\2",
|
||||
"",
|
||||
"Shows Current Player waiting to play Cards.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ws_help_play[] = {
|
||||
"Play Card(s)",
|
||||
"Syntax: \2PLAY\2 # <#> <#>",
|
||||
"",
|
||||
"During Normal Round one card number must be entered.",
|
||||
"During a WAR round, 3 card numbers Must be entered.",
|
||||
NULL
|
||||
};
|
311
win32/WarServ.qsp
Normal file
311
win32/WarServ.qsp
Normal file
|
@ -0,0 +1,311 @@
|
|||
[General]
|
||||
FileVersion=1.1
|
||||
FileType=QSetupIniFile
|
||||
ComposerVersion=8.5.0.4
|
||||
OperatingSystem=WinXP 5.1 2600 (Service Pack 2)
|
||||
ProcessorNameString=Intel(R) Xeon(TM) CPU 2.40GHz
|
||||
ComputerRAM=1534 MB
|
||||
ProjectDrive=WIN (2.80 GB Free)
|
||||
DateTime=18-MAR-2008 19:23:10
|
||||
OutputType=EXE
|
||||
Language=ENGLISH
|
||||
License=PRO
|
||||
|
||||
[Project]
|
||||
ProjectName=WarServ
|
||||
ProjectDirectory=win32
|
||||
NonSFXDirectory=
|
||||
MediaFileName=win32\WarServ-Setup
|
||||
CopyMediaToFName=
|
||||
ProgramDescriptiveName=WarServ for NeoStats
|
||||
ProgramVersion=3.0.0.0
|
||||
CompanyName=NeoStats
|
||||
ProgVerLiveUpdate=1
|
||||
RegisterAsApp=0
|
||||
LanguageFlag=1
|
||||
LanguageNames=|
|
||||
UseNonSFXDir=0
|
||||
ClrNonSFXDir=0
|
||||
BuildNonSFXTree=0
|
||||
CompressNonSFXFiles=0
|
||||
ForceCopyNonSFXFiles=0
|
||||
CompressionLevel=0
|
||||
SetupWillExpire=0
|
||||
ExpireByDate=0
|
||||
ExpireByDays=1
|
||||
ExpireDate=2008-03-07
|
||||
ExpireDays=90
|
||||
SpanCDs=0
|
||||
SpanCDsSize=650
|
||||
DebugWindow=0
|
||||
DebugOnThisPC=1
|
||||
DebugOnEveryPC=0
|
||||
|
||||
[Language]
|
||||
|
||||
[LanguageShortcut]
|
||||
|
||||
[LanguageCustomDLG]
|
||||
|
||||
[Display]
|
||||
AddSetupBackground=1
|
||||
SetupBackground3D=0
|
||||
TopLabel=1
|
||||
TopLabelVer=0
|
||||
TopLabel2=0
|
||||
BottomLabel=0
|
||||
TopLabelText="WarServ for NeoStats"
|
||||
TopLabel2Text=""
|
||||
BottomLabelText="Copyright © 2008"
|
||||
BackgroundDesign=Windmill (Right)
|
||||
TopBackgroundColor=16758613
|
||||
BottomBackgroundColor=11613445
|
||||
AddBottomColor=1
|
||||
DlgBmp3DFrame=1
|
||||
DialogStyle=Modern
|
||||
AddDialogBitmap=0
|
||||
DialogBitmapFileName=
|
||||
AddBackgroundBitmap=0
|
||||
BackgroundBitmapFileName=
|
||||
BackgroundBitmapLocation=|Top/Left|0|0|
|
||||
AddBackgroundWave=0
|
||||
BgBmpTransparent=0
|
||||
BackgroundWaveFileName=
|
||||
BackgroundWaveLocation=|Center|300|0|
|
||||
BackgroundWaveLoop=1
|
||||
BackgroundWaveDelay=0
|
||||
AddBackgroundWaveSlider=1
|
||||
BackgroundWaveSliderType=Fixed
|
||||
TopLabelSide=Left
|
||||
TopLabel2Side=Left
|
||||
BottomLabelSide=Left
|
||||
DialogLocation=|Center|0|0|
|
||||
TopLabelFont=|Tahoma|32|16777215|1|0|1|0|
|
||||
TopLabel2Font=|Tahoma|16|16777215|1|0|1|0|
|
||||
BottomLabelFont=|Tahoma|10|16777215|1|0|1|0|
|
||||
CompanyUrl=
|
||||
|
||||
[TargetExe]
|
||||
TargetDirectory=<ProgramFilesDir>NeoStats
|
||||
CommonDirectory=<ProgramFilesDir>NeoStats\modules
|
||||
AuxDirectory=<FontDir>
|
||||
TargetExeName=<Common Folder>\WarServ.dll
|
||||
|
||||
[Dialogs]
|
||||
SelectedDialogs=*Welcome,*License,*Readme,User Information,Setup Type,Custom,*Destination,Associate,Shortcuts,*Confirm Setup,*Copy Files,*Complete
|
||||
LicenseTextFile=COPYING
|
||||
ReadmeTextFile=RELNOTES.win32.txt
|
||||
ReadmeTextFile2=
|
||||
UseNotepad=0
|
||||
SpaceReqOnDriveCheckBox=0
|
||||
SpaceReqOnDrive=
|
||||
RequestUserName=1
|
||||
RequestCompanyName=1
|
||||
RequestSerialNumberAlso=0
|
||||
MandatoryUserName=1
|
||||
MandatoryCompanyName=1
|
||||
MandatorySerialNumber=1
|
||||
FromPcUserName=0
|
||||
FromPcCompanyName=0
|
||||
RequestSerialCheckDLL=0
|
||||
SerialCheckDll=
|
||||
RequestPredefinedSerial=0
|
||||
CaseSensitiveSerial=0
|
||||
RequestTokenizedSerial=0
|
||||
CDSetup=0
|
||||
ShowCompactSetupAlso=1
|
||||
ForcePartialSetup=0
|
||||
ShowProgBar2=1
|
||||
SilentSetup=0
|
||||
EnableCancelButton=1
|
||||
HiddenSetup=0
|
||||
ProposeReadme=0
|
||||
ProposeLaunch=0
|
||||
ProposeRestart=0
|
||||
ProposeReadmeChecked=0
|
||||
ProposeLaunchChecked=0
|
||||
ForceRestart=0
|
||||
ShowCloseRecommendation=1
|
||||
ShowAdwareDisclaimer=0
|
||||
ShowCopyrightWarning=1
|
||||
|
||||
[Shortcuts]
|
||||
AddMainShortCut=0
|
||||
ForceRemoveShortcutFolder=0
|
||||
ProgramLinkFolder=WarServ for NeoStats
|
||||
ProgramLinkName=WarServ
|
||||
ProgramLinkParam=
|
||||
ProgramLinkWorkDir=
|
||||
ProgramLinkRun=Normal Window
|
||||
ProgramLinkIconFile=
|
||||
ProgramLinkIconNum=0
|
||||
StartMenuLinkName=WarServ for NeoStats
|
||||
DesktopLinkName=WarServ for NeoStats
|
||||
SendToLinkName=WarServ for NeoStats
|
||||
StartUpLinkName=WarServ for NeoStats
|
||||
QuickLaunchLinkName=WarServ for NeoStats
|
||||
StartMenuCheckBox=0
|
||||
DesktopCheckBox=0
|
||||
SendToCheckBox=0
|
||||
StartUpCheckBox=0
|
||||
QuickLaunchCheckBox=0
|
||||
StartMenuChecked=1
|
||||
DesktopChecked=1
|
||||
SendToChecked=1
|
||||
StartUpChecked=1
|
||||
QuickLaunchChecked=1
|
||||
SetAllUsers=0
|
||||
SelectedByEndUser=0
|
||||
AddUninstallShortcut=1
|
||||
UnInstallSubFolder=0
|
||||
UnInstallSubFolderText=
|
||||
|
||||
[Billboard]
|
||||
AddBillboard=0
|
||||
Item-000=|1|0|0|1|0|Center|0|0|8388608|16711680|Verdana|14|16777215|1|0|360|360|0|1|0|1|
|
||||
|
||||
[SplitSetup]
|
||||
SplitSetup=0
|
||||
ForceDownload=1
|
||||
DownloadURL_SPLIT=http://
|
||||
ConfirmSplitDownload=0
|
||||
|
||||
[AutoUpdate]
|
||||
AutoUpdate=0
|
||||
CheckAUSetupEnd=0
|
||||
RunAutoUpdate=1
|
||||
AddAutoUpdateShortcut=1
|
||||
AutoUpdateLog=0
|
||||
AutoUpdateSubFolder=0
|
||||
AutoUpdateSubFolderText=
|
||||
ReqConfirmDownload=0
|
||||
ReqConfirmInstall=0
|
||||
ShutDownMethod=Don't Shut Down
|
||||
BackgroundUpdate=0
|
||||
RestartProcess=0
|
||||
InformFinish=0
|
||||
UpdateProjectFName=
|
||||
DownloadURL_UPDATE=http:
|
||||
NameOfUpdateFile=
|
||||
RunningProcess=
|
||||
VersionOriginal=1
|
||||
ValidVersions=
|
||||
VersionNew=1
|
||||
ReAskDays=0
|
||||
AutoUpdateProbeSpin=1
|
||||
AutoUpdateProbeText=Only at Agent Start
|
||||
SelectInformFile=1
|
||||
DownloadUrlInform=1
|
||||
DownloadURL_INFORM=http://
|
||||
NameOfInformFile=
|
||||
UpdateSetupPageIndex=0
|
||||
AutoInformW=360
|
||||
AutoInformH=360
|
||||
|
||||
[Switches]
|
||||
OperatingSystems=All,95,98,ME,NT,2000,XP,2003,Vista
|
||||
OverwriteFlag=1
|
||||
CreateLogFile=0
|
||||
ConfirmExtract=0
|
||||
ShowActivityBar=1
|
||||
TestAdminRights=1
|
||||
TestAdminRightsUnInstall=1
|
||||
SetAllowFullAccess=1
|
||||
TestDotNetFramework=0
|
||||
InstallDotNetFx=0
|
||||
InstallDotNetFxText=
|
||||
InstallDotNetFxUrl=0
|
||||
InstallDotNetFxUrlText=http://
|
||||
DotNetFrameworkReqVer=1.0,1.1,2.0
|
||||
TestExeBeforeInstall=0
|
||||
TestExeBeforeUnInstall=1
|
||||
AutorunCreateInfFile=0
|
||||
AutorunTest=0
|
||||
AutorunStartApp=0
|
||||
AddAppToRunOnce=0
|
||||
AddAppToRun=0
|
||||
IfPreviousInstallationFound=1
|
||||
PreviousInstallationOp=UnInstall before Setup start
|
||||
UnInstallPreviousMode=Silent
|
||||
CreateUnInstall=0
|
||||
ScrambleUnInstallData=0
|
||||
SilentUnInstall=0
|
||||
HiddenUnInstall=0
|
||||
HideErrMsgUnInstall=0
|
||||
HideLogBtnUnInstall=0
|
||||
AddRemoveProgramsUnInstall=1
|
||||
AddChangeButtonUnInstall=0
|
||||
UnInstallExeStampSwitch=0
|
||||
UnInstallExeStamp=
|
||||
UnInstallExeDirSwitch=0
|
||||
UnInstallExeDir=
|
||||
|
||||
[UnInstall]
|
||||
UnInstallDisplayName=WarServ for NeoStats
|
||||
UnInstallDisplayIcon=
|
||||
UnInstallDisplayIconNum=
|
||||
UnInstallHelpLink=
|
||||
UnInstallInfoAboutURL=
|
||||
|
||||
[Registry]
|
||||
|
||||
[IniFile]
|
||||
|
||||
[Environment]
|
||||
|
||||
[Association]
|
||||
OpenWith=0
|
||||
OpenWithName=
|
||||
OpenWithMenuText=Open with
|
||||
OpenWithExtensions=
|
||||
|
||||
[VerInfo]
|
||||
CopyFromExe=0
|
||||
DefineManually=0
|
||||
Item-001=|Comments||
|
||||
Item-002=|CompanyName||
|
||||
Item-003=|FileDescription||
|
||||
Item-004=|FileVersion||
|
||||
Item-005=|InternalName||
|
||||
Item-006=|LegalCopyright||
|
||||
Item-007=|LegalTrademarks||
|
||||
Item-008=|OriginalFilename||
|
||||
Item-009=|ProductName||
|
||||
Item-010=|ProductVersion||
|
||||
CopyIconFromTargetExe=0
|
||||
CopyIconFromOtherApp=0
|
||||
OtherIconAppFileName=
|
||||
Spin1=0
|
||||
Spin2=0
|
||||
|
||||
[Execute]
|
||||
ExecuteDllCheckBox=0
|
||||
ExecutionDllFileName=
|
||||
Exec-000=*||CheckNeoStats|Setup Start|10|Conditional|0|1|Application Found||0|0|0|File Found||0|0|0|File Found||1|Display Message||1|Exit||0|Display Message||0|Display Message||0|Display Message||0|Display Message||1|
|
||||
Arg-000-1=neostats.exe
|
||||
Arg-000-2==
|
||||
Arg-000-6==
|
||||
Arg-000-10==
|
||||
Arg-000-13=NeoStats must be installed to install WarServ
|
||||
Exec-001=*||CheckingRunning|Setup Start|10|While Loop|0|0|Application is Running||0|0|0|File Found||0|0|0|File Found||1|Display Message||0|Display Message||0|Display Message||0|Display Message||0|Display Message||0|Display Message||1|
|
||||
Arg-001-1=neostats.exe
|
||||
Arg-001-2==
|
||||
Arg-001-6==
|
||||
Arg-001-10==
|
||||
Arg-001-13=You must shutdown NeoStats before installing WarServ
|
||||
|
||||
[MSI]
|
||||
Version=1
|
||||
AddMergeModule=0
|
||||
Msm2MsiData=|MSM2MSI_WarServ-Setup.exe.msi|1|1|1|0|
|
||||
|
||||
[GroupNames]
|
||||
Group-000=Modules
|
||||
|
||||
[Group-000]
|
||||
TypicalCompactData=15
|
||||
Description=Modules
|
||||
SizeInKB=0
|
||||
Item-000=Fol*<Common Folder>
|
||||
Item-001=Fil*WarServ.dll
|
||||
|
4
win32/buildwin32snap.bat
Normal file
4
win32/buildwin32snap.bat
Normal file
|
@ -0,0 +1,4 @@
|
|||
@echo off
|
||||
IF EXIST win32\WarServ-Setup*.exe del win32\WarServ-Setup*.exe
|
||||
"C:\Program Files\Pantaray\QSetup\Composer.exe" win32\WarServ.qsp /Compile /Exit
|
||||
move win32\WarServ-Setup.exe win32\WarServ-Setup-3-0-1-%1.exe
|
20
win32/modconfigwin32.h
Normal file
20
win32/modconfigwin32.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/* modconfig.h. Generated by configure. */
|
||||
/* define this to enable debug code for this module */
|
||||
/* #undef DEBUG */
|
||||
|
||||
/* Version number of package */
|
||||
#define MODULE_VERSION "3.0.1"
|
||||
|
||||
/* Major Version */
|
||||
#define MODULE_MAJOR "3"
|
||||
|
||||
/* Minor Version */
|
||||
#define MODULE_MINOR "0"
|
||||
|
||||
/* Revision */
|
||||
#define MODULE_REV "1"
|
||||
|
||||
/* "Full Version" */
|
||||
#define MOD_VERSION "3.0.1"
|
||||
#define MOD_WIN32VER "3,0,1,0"
|
||||
#define MOD_WIN32VERN 3,0,1
|
29
win32/neostatsversion.rc
Normal file
29
win32/neostatsversion.rc
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "modconfigwin32.h"
|
||||
1 VERSIONINFO
|
||||
FILEVERSION MOD_WIN32VERN
|
||||
PRODUCTVERSION MOD_WIN32VERN
|
||||
FILEFLAGSMASK 0x3fL
|
||||
FILEFLAGS 0x1L
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040704e4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "NeoStats"
|
||||
VALUE "Copyright (C) 2008", "Copyright (c) 1999-2008 Justin Hammond, Mark Hetherington, Jeff Lang"
|
||||
VALUE "FileDescription", "NeoStats IRC Services"
|
||||
VALUE "FileVersion", MOD_WIN32VER
|
||||
VALUE "InternalName", "warserv.dll"
|
||||
VALUE "OriginalFilename", "warserv.dll"
|
||||
VALUE "ProductName", "WarServ for win32"
|
||||
VALUE "ProductVersion", MOD_WIN32VER
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x407, 1252
|
||||
END
|
||||
END
|
Reference in a new issue