Initial Upload after conversion to 3.0 API
This commit is contained in:
parent
c8ea57cfe2
commit
7566f15614
20 changed files with 7434 additions and 0 deletions
19
.gitattributes
vendored
19
.gitattributes
vendored
|
@ -1 +1,20 @@
|
|||
* text=auto !eol
|
||||
/AUTHORS -text
|
||||
/COPYING -text
|
||||
/ChangeLog -text
|
||||
/LICENSE -text
|
||||
/Makefile.in -text
|
||||
/NEWS -text
|
||||
/README.YahtzeeServ -text
|
||||
/RELNOTES -text
|
||||
/configure -text
|
||||
/configure.in -text
|
||||
/events.c -text
|
||||
/install-sh -text
|
||||
/modconfig.h.in -text
|
||||
/modconfigwin32.h -text
|
||||
/play.c -text
|
||||
/yahtzeeserv.c -text
|
||||
/yahtzeeserv.h -text
|
||||
/yahtzeeserv.vcproj -text
|
||||
/yahtzeeserv_help.c -text
|
||||
|
|
0
AUTHORS
Normal file
0
AUTHORS
Normal file
273
COPYING
Normal file
273
COPYING
Normal file
|
@ -0,0 +1,273 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2, June 1991
|
||||
Copyright © 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to
|
||||
share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free software--to
|
||||
make sure the software is free for all its users. This General Public
|
||||
License applies to most of the Free Software Foundation's software and to
|
||||
any other program whose authors commit to using it. (Some other Free
|
||||
Software Foundation software is covered by the GNU Library General Public
|
||||
License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the freedom
|
||||
to distribute copies of free software (and charge for this service if you
|
||||
wish), that you receive source code or can get it if you want it, that you
|
||||
can change the software or use pieces of it in new free programs; and that
|
||||
you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to
|
||||
deny you these rights or to ask you to surrender the rights. These
|
||||
restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or
|
||||
for a fee, you must give the recipients all the rights that you have. You
|
||||
must make sure that they, too, receive or can get the source code. And you
|
||||
must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2)
|
||||
offer you this license which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that
|
||||
everyone understands that there is no warranty for this free software. If
|
||||
the software is modified by someone else and passed on, we want its
|
||||
recipients to know that what they have is not the original, so that any
|
||||
problems introduced by others will not reflect on the original authors'
|
||||
reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We
|
||||
wish to avoid the danger that redistributors of a free program will
|
||||
individually obtain patent licenses, in effect making the program
|
||||
proprietary. To prevent this, we have made it clear that any patent must be
|
||||
licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a
|
||||
notice placed by the copyright holder saying it may be distributed under
|
||||
the terms of this General Public License. The "Program", below, refers to
|
||||
any such program or work, and a "work based on the Program" means either
|
||||
the Program or any derivative work under copyright law: that is to say, a
|
||||
work containing the Program or a portion of it, either verbatim or with
|
||||
modifications and/or translated into another language. (Hereinafter,
|
||||
translation is included without limitation in the term "modification".)
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of running the
|
||||
Program is not restricted, and the output from the Program is covered only
|
||||
if its contents constitute a work based on the Program (independent of
|
||||
having been made by running the Program). Whether that is true depends on
|
||||
what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code
|
||||
as you receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice and
|
||||
disclaimer of warranty; keep intact all the notices that refer to this
|
||||
License and to the absence of any warranty; and give any other recipients
|
||||
of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you
|
||||
may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it,
|
||||
thus forming a work based on the Program, and copy and distribute such
|
||||
modifications or work under the terms of Section 1 above, provided that you
|
||||
also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any part
|
||||
thereof, to be licensed as a whole at no charge to all third parties
|
||||
under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when
|
||||
run, you must cause it, when started running for such interactive use
|
||||
in the most ordinary way, to print or display an announcement
|
||||
including an appropriate copyright notice and a notice that there is
|
||||
no warranty (or else, saying that you provide a warranty) and that
|
||||
users may redistribute the program under these conditions, and telling
|
||||
the user how to view a copy of this License. (Exception: if the
|
||||
Program itself is interactive but does not normally print such an
|
||||
announcement, your work based on the Program is not required to print
|
||||
an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Program, and can be
|
||||
reasonably considered independent and separate works in themselves, then
|
||||
this License, and its terms, do not apply to those sections when you
|
||||
distribute them as separate works. But when you distribute the same
|
||||
sections as part of a whole which is a work based on the Program, the
|
||||
distribution of the whole must be on the terms of this License, whose
|
||||
permissions for other licensees extend to the entire whole, and thus to
|
||||
each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise
|
||||
the right to control the distribution of derivative or collective works
|
||||
based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with
|
||||
the Program (or with a work based on the Program) on a volume of a storage
|
||||
or distribution medium does not bring the other work under the scope of
|
||||
this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under
|
||||
Section 2) in object code or executable form under the terms of Sections 1
|
||||
and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections 1
|
||||
and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years,
|
||||
to give any third party, for a charge no more than your cost of
|
||||
physically performing source distribution, a complete machine-readable
|
||||
copy of the corresponding source code, to be distributed under the
|
||||
terms of Sections 1 and 2 above on a medium customarily used for
|
||||
software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to
|
||||
distribute corresponding source code. (This alternative is allowed
|
||||
only for noncommercial distribution and only if you received the
|
||||
program in object code or executable form with such an offer, in
|
||||
accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making
|
||||
modifications to it. For an executable work, complete source code means all
|
||||
the source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and
|
||||
installation of the executable. However, as a special exception, the source
|
||||
code distributed need not include anything that is normally distributed (in
|
||||
either source or binary form) with the major components (compiler, kernel,
|
||||
and so on) of the operating system on which the executable runs, unless
|
||||
that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to
|
||||
copy from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place counts as distribution of the source code,
|
||||
even though third parties are not compelled to copy the source along with
|
||||
the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except
|
||||
as expressly provided under this License. Any attempt otherwise to copy,
|
||||
modify, sublicense or distribute the Program is void, and will
|
||||
automatically terminate your rights under this License. However, parties
|
||||
who have received copies, or rights, from you under this License will not
|
||||
have their licenses terminated so long as such parties remain in full
|
||||
compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed
|
||||
it. However, nothing else grants you permission to modify or distribute the
|
||||
Program or its derivative works. These actions are prohibited by law if you
|
||||
do not accept this License. Therefore, by modifying or distributing the
|
||||
Program (or any work based on the Program), you indicate your acceptance of
|
||||
this License to do so, and all its terms and conditions for copying,
|
||||
distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the original
|
||||
licensor to copy, distribute or modify the Program subject to these terms
|
||||
and conditions. You may not impose any further restrictions on the
|
||||
recipients' exercise of the rights granted herein. You are not responsible
|
||||
for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot distribute so
|
||||
as to satisfy simultaneously your obligations under this License and any
|
||||
other pertinent obligations, then as a consequence you may not distribute
|
||||
the Program at all. For example, if a patent license would not permit
|
||||
royalty-free redistribution of the Program by all those who receive copies
|
||||
directly or indirectly through you, then the only way you could satisfy
|
||||
both it and this License would be to refrain entirely from distribution of
|
||||
the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents
|
||||
or other property right claims or to contest validity of any such claims;
|
||||
this section has the sole purpose of protecting the integrity of the free
|
||||
software distribution system, which is implemented by public license
|
||||
practices. Many people have made generous contributions to the wide range
|
||||
of software distributed through that system in reliance on consistent
|
||||
application of that system; it is up to the author/donor to decide if he or
|
||||
she is willing to distribute software through any other system and a
|
||||
licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original
|
||||
copyright holder who places the Program under this License may add an
|
||||
explicit geographical distribution limitation excluding those countries, so
|
||||
that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of
|
||||
the General Public License from time to time. Such new versions will be
|
||||
similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals of
|
||||
preserving the free status of all derivatives of our free software and of
|
||||
promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
|
||||
THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM
|
||||
PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
5
ChangeLog
Normal file
5
ChangeLog
Normal file
|
@ -0,0 +1,5 @@
|
|||
YahtzeeServ ChangeLog
|
||||
=============================================================================
|
||||
|
||||
3.0 - DeadNotBuried
|
||||
- Initial Release.
|
341
LICENSE
Normal file
341
LICENSE
Normal file
|
@ -0,0 +1,341 @@
|
|||
# $Id: LICENSE 28 2005-02-16 04:24:43Z DNB $
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
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
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
61
Makefile.in
Normal file
61
Makefile.in
Normal file
|
@ -0,0 +1,61 @@
|
|||
#Neostats Module Makefile!
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
LDFLAGS= @LDFLAGS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
DIRECTORY = @DIRINST@/modules/
|
||||
INCLUDES = -I@DIRINST@/include/ -I.
|
||||
|
||||
SRCS= yahtzeeserv.c yahtzeeserv_help.c play.c events.c
|
||||
OBJS= ${SRCS:.c=.o}
|
||||
TARGET= yahtzeeserv.so
|
||||
DOCS=README.YahtzeeServ
|
||||
DATA=
|
||||
SCRIPTS=
|
||||
DISTFILES=$(SRCS) $(DOCS) $(SCRIPTS) *.in configure install-sh ChangeLog *.h LICENSE RELNOTES yahtzeeserv.vcproj modconfigwin32.h
|
||||
DISTDIR= @PACKAGE@-@VERSION@
|
||||
|
||||
all: module
|
||||
@echo "Compilation complete."
|
||||
@echo "Run 'make install' (or 'gmake install' on some systems) to install."
|
||||
@echo "If you require support, see the README file."
|
||||
|
||||
# include dependency info
|
||||
@MAKEDEPENDENCIES@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(INCLUDES) $<
|
||||
$(CC) -MM $(INCLUDES) -c $< > $*.d
|
||||
|
||||
module: $(OBJS)
|
||||
$(LD) -shared -o $(TARGET) $(OBJS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
/bin/rm -rf $(TARGET) *.o *.d Makefile *.log modconfig.h
|
||||
|
||||
distclean:
|
||||
/bin/rm -rf $(TARGET) *.o *.d Makefile *.log modconfig.h config.status configure.scan
|
||||
|
||||
install: module
|
||||
$(INSTALL) -m 644 $(TARGET) $(DIRECTORY)
|
||||
$(INSTALL) -m 644 $(DOCS) $(DIRECTORY)../doc/
|
||||
@echo "Installation complete."
|
||||
@echo "See the README file for instructions on loading this module."
|
||||
|
||||
dist:
|
||||
@echo -n "Creating directories"
|
||||
@-rm -rf $(DISTDIR)
|
||||
@mkdir $(DISTDIR)
|
||||
@echo "Done"
|
||||
@echo -n "Copying distribution files"
|
||||
@for file in $(DISTFILES); do \
|
||||
echo -n "."; \
|
||||
cp -pr $$file $(DISTDIR)/$$file; \
|
||||
done
|
||||
@echo "Done"
|
||||
@tar -czf $(DISTDIR).tar.gz $(DISTDIR)/*
|
||||
@echo "Tar file $(DISTDIR).tar.gz created, Freshmeat Time"
|
||||
|
||||
$(OBJS): Makefile
|
0
NEWS
Normal file
0
NEWS
Normal file
90
README.YahtzeeServ
Normal file
90
README.YahtzeeServ
Normal file
|
@ -0,0 +1,90 @@
|
|||
|
||||
YahtzeeServ Manual
|
||||
_________________________________________________________________
|
||||
|
||||
1. Prerequisites and Installation.
|
||||
|
||||
1.1. Compiling and Installation
|
||||
|
||||
2. Basic Configuration
|
||||
|
||||
3. Operational Commands
|
||||
|
||||
Welcome to the YahtzeeServ Manual. This document will aid you in
|
||||
setting up and running YahtzeeServ on your IRC network.
|
||||
|
||||
YahtzeeServ is a Game Service that allows Users to play Yahtzee.
|
||||
Up to 10 players can play at once.
|
||||
|
||||
1. Prerequisites and Installation.
|
||||
|
||||
YahtzeeServ is designed to run on Top of NeoStats 3.
|
||||
Please refer to the NeoStats website for more
|
||||
information on the requirements for NeoStats.
|
||||
|
||||
YahtzeeServ requires the following:
|
||||
* NeoStats 3.0 or Higher correctly installed and Running
|
||||
* The time to read this entire document.
|
||||
|
||||
|
||||
1.1. Compiling and Installation
|
||||
|
||||
As long as you have successfully setup NeoStats, and installed it
|
||||
correctly, Compiling YahtzeeServ is very simple and straight forward. First
|
||||
you must extract the files from the download package. This is as
|
||||
simple as:
|
||||
bash$ tar -xzf YahtzeeServ-<ver>.tar.gz
|
||||
|
||||
This should then create a directory called YahtzeeServ-<version> where
|
||||
<version> is the Version of YahtzeeServ. Then Proceed to Change into the YahtzeeServ
|
||||
directory, and run Configure as follows:
|
||||
bash$./configure [--with-neostats=<dir>]
|
||||
|
||||
--with-neostats=<dir> should be used if your neostats directory is not
|
||||
in a standard location (~/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 YahtzeeServ. 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" (or "gmake" if you are running BSD) will install YahtzeeServ, this
|
||||
README file, and any auxiluary files needed into your NeoStats directory:
|
||||
|
||||
Once Installation is complete, you can either configure NeoStats to
|
||||
load YahtzeeServ when it starts, or load YahtzeeServ via IRC.
|
||||
|
||||
To Configure NeoStats to automatically load YahtzeeServ when it boots, add
|
||||
the following line to your "neostats.conf" file in the NeoStats
|
||||
directory:
|
||||
|
||||
LOAD_MODULE YahtzeeServ
|
||||
|
||||
To load YahtzeeServ via IRC, you must make sure you have the appropriate
|
||||
permissions and issue the following command:
|
||||
|
||||
/msg neostats load YahtzeeServ
|
||||
|
||||
Thats it. YahtzeeServ is now loaded and ready for use (in fact, it will
|
||||
already be running now, but read on for futher information.
|
||||
|
||||
2. Basic Configuration
|
||||
|
||||
The Channel YahtzeeServ plays in is configured online via IRC. When you
|
||||
first start up YahtzeeServ, it defaults to playing in "#Games_Yahtzee", to
|
||||
change the channel use the following command:
|
||||
|
||||
/msg YahtzeeServ set chan <#channel>
|
||||
|
||||
The new channel name will be saved for future reference, and YahtzeeServ
|
||||
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
|
||||
|
||||
YahtzeeServ has a number of commands to play the game in channel.
|
||||
To list the commands send the text "!help" to the channel YahtzeeServ
|
||||
is set to play in.
|
23
RELNOTES
Normal file
23
RELNOTES
Normal file
|
@ -0,0 +1,23 @@
|
|||
==============================================================================
|
||||
Important information you should know: (READ THIS!)
|
||||
==============================================================================
|
||||
|
||||
This is an alpha release. Not all features will work and there may be major
|
||||
bugs in the software. This release is purely for us to get feedback on the new
|
||||
version of NeoStats and should not be run on production networks. This release
|
||||
is ideal for users with test networks or those that want an opportunity to
|
||||
help us develop the new version with feedback and suggestions.
|
||||
|
||||
No support is provided for this release so if you have problems and are unable
|
||||
to resolve them using the provided documentation, you should use the supported
|
||||
stable 2.5 series instead until NeoStats 3.0 is further along.
|
||||
|
||||
Bugs, requests and suggestions should be reported using the bug tracking
|
||||
system. You must provide all information required as listed in the README
|
||||
section on support or your entry will be removed.
|
||||
|
||||
Settings and data files from 2.5.x will not work with 3.0. Settings for a1
|
||||
may not be compatible with this version. You should delete all files with
|
||||
"config" in the filename from the directory ~/NeoStats 3.0/data before
|
||||
using this version.
|
||||
|
95
configure.in
Normal file
95
configure.in
Normal file
|
@ -0,0 +1,95 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(yahtzeeserv.c)
|
||||
AC_CONFIG_HEADER(modconfig.h)
|
||||
|
||||
PACKAGE=YahtzeeServ
|
||||
MODULE_MAJOR=3
|
||||
MODULE_MINOR=0
|
||||
MODULE_REV=a2
|
||||
VERSION=$MODULE_MAJOR.$MODULE_MINOR.$MODULE_REV
|
||||
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
|
||||
AC_DEFINE_UNQUOTED(MODULE_MINOR, "$MODULE_MINOR")
|
||||
AC_DEFINE_UNQUOTED(MODULE_REV, "$MODULE_REV")
|
||||
DIRINST=~/NeoStats3.0/
|
||||
AC_PREFIX_DEFAULT(~/NeoStats3.0/)
|
||||
CFLAGS="$CFLAGS -O2"
|
||||
|
||||
case "$host_os" in
|
||||
*openbsd*)
|
||||
MAKEDEPENDENCIES="";;
|
||||
*freebsd*)
|
||||
MAKEDEPENDENCIES="";;
|
||||
*)
|
||||
MAKEDEPENDENCIES="-include \$(OBJS:.o=.d)";;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING(Location of NeoStats...)
|
||||
AC_ARG_WITH(neostats,
|
||||
[ --with-neostats=DIR Location of NeoStats installation],
|
||||
[DIRINST=$withval])
|
||||
AC_MSG_RESULT($DIRINST)
|
||||
|
||||
AC_CHECK_FILE($DIRINST/include/neostats.h,
|
||||
[INCLUDEDIR="$DIRINST/include/"],
|
||||
[AC_MSG_ERROR(Can't find existing NeoStats Installation please supply with --with-neostats option)])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -I$INCLUDEDIR"
|
||||
dnl Check we are running the latest supported version of NeoStats
|
||||
AC_MSG_CHECKING(Version of NeoStats...)
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
int main(void) {
|
||||
if (MAJOR >= 3) {
|
||||
if (MINOR >= 0) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
], ns_version_ok='yes',
|
||||
ns_version_ok='no',
|
||||
ns_version_ok='no')
|
||||
if test "$ns_version_ok" = "yes"; then
|
||||
AC_MSG_RESULT(Compatible version);
|
||||
else
|
||||
AC_MSG_ERROR(This module requires NeoStats 3.0.a2 or higher)
|
||||
fi
|
||||
|
||||
dnl check if we are running with Debug....
|
||||
AC_MSG_CHECKING(Whether to Enable Debuging...)
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug - Enable Debuging],
|
||||
[ case "$enableval" in
|
||||
yes)
|
||||
CFLAGS="$CFLAGS -Wall -ggdb"
|
||||
AC_DEFINE(DEBUG,1)
|
||||
AC_MSG_RESULT(yes - Watch your Log Files)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_SUBST(DIRINST)
|
||||
AC_SUBST(MAKEDEPENDENCIES)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(PACKAGE)
|
||||
AC_SUBST(VERSION)
|
||||
AC_OUTPUT(Makefile)
|
||||
echo "Configuration complete."
|
||||
read -p "Press Enter key to read the release notes"
|
||||
clear
|
||||
more RELNOTES
|
||||
echo "This Module was written by:"
|
||||
echo " DeadNotBurried (dnb@majestic-liaisons.com)"
|
||||
echo "Run 'make' (or 'gmake' on some systems) to compile NeoStats."
|
||||
echo "If you require support, see the README file."
|
520
events.c
Normal file
520
events.c
Normal file
|
@ -0,0 +1,520 @@
|
|||
/* YahtzeeServ - Yahtzee Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2003-2005 DeadNotBuried
|
||||
** Portions Copyright (c) 1999-2005, NeoStats
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** YahtzeeServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "yahtzeeserv.h"
|
||||
|
||||
/*
|
||||
* Nick Change Check
|
||||
*/
|
||||
int PlayerNickChange (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeeplayercount < 1) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
for (ypln = 0; ypln < currentyahtzeeplayercount; ypln++) {
|
||||
if (!ircstrcasecmp (ysplayernick[ypln], cmdparams->param)) {
|
||||
strlcpy(ysplayernick[ypln], cmdparams->source->name, MAXNICK);
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display Rules
|
||||
*/
|
||||
int ShowRulePages (CmdParams* cmdparams)
|
||||
{
|
||||
if (cmdparams->ac < 1) {
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Welcome To Yahtzee %s", cmdparams->source->name);
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Written By DeadNotBuried");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "There are currently 4 rule pages");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "To view each page use the rules command");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "placing the page number after the command");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "E.G. '!rules 2' to display page 2.");
|
||||
} else {
|
||||
if (!ircstrcasecmp (cmdparams->av[0], "1")) {
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Objective of the Game");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "---------------------");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Yahtzee can be played alone or in a group.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "The Game being the same for groups, but with players taking");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "turns to roll the dice, with the highest score winning.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "The game consists of 13 turns.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "In each turn, you roll the dice and then score the roll in one of 13 slots.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "You must score once in each slot which means that some slots may have to be");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "sacrificed (score 0 in).");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Each Slot has its own rules for scoring, which will be explained below");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "The object of the game is to maximize your total score.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "After all Players have scored in all 13 Slots, the game ends.");
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "2")) {
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Rolling the Dice");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "----------------");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Yahtzee is played with 5 die, each die is referenced by");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "it's position and not the number it rolls. The Dice are numbered");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "from left to right in their postions as 1 through 5");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "The Dice are rolled automatically for you when it is your turn.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "You then have 2 further chances to improve your score by");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "rolling or keeping the die.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "After the third roll (or before if you wish) you must select");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "a slot to score against, your score will be automatically");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "calculated including any bonus points, and added to your Total.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Play will then continue with the next Player.");
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "3")) {
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Scoring - Part 1");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "----------------");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Once you have the die combination you wish, score the roll in");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "one of the 13 slots. Do this by typing Score and the slot code");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "you wish to score in. Each slot may only be used once per game.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "To see the score slot codes, type score without a slot code.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Each Slot has its own scoring rules as listed:");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Upper Slots:");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "One's through to Six's: Total of the die matching the score slot.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "E.G. rolling a 4 3 4 6 4 and scoring in Four's would give 12 points.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "The same roll scored in the One's Two's or Fives slot would score 0,");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "3 points for the Three's slot, or 6 points for the Six's slot.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "A Bonus 35 points is received if scoring 63 points or more in One's To Six's");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "NOTE: Scoring 3 die in each slot will equal 63 points, enough for the bonus.");
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "4")) {
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Scoring - Part 2");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "----------------");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Lower Slots:");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Score is 0 if requirements not met for the slot.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Full House : 25 points (Three Die the Same, and Two Die the same)");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Short Straight : 30 points (Four Die in order, E.G. 3 4 5 6)");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Long Straight : 40 points (All Five Die in order, E.G. 1 2 3 4 5)");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "3 of a Kind : Total of all Die (Three Die must be the same)");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "4 of a Kind : Total of all Die (Four Die must be the same)");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Chance : Total of all Die (No Requirements)");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Yahtzee : 50 points (ALL Die must be the same)");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, " ");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Yahtzee Bonus : If after Scoring 50 points on Yahtzee, another");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Yahtzee is rolled a Bonus 100 points is added to your total.");
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "NOTE: You must receive points when scoring to receive the Bonus.");
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display Top10 lists
|
||||
*/
|
||||
int ShowTop10Lists (CmdParams* cmdparams)
|
||||
{
|
||||
if (cmdparams->ac < 1) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039Top 10 Scores so far\0038 :");
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039 %d\0038 :\0037 %s \0039with\00311 %d\0039 points.", (ypln + 1), htsslrnick[ypln], htsslr[ypln]);
|
||||
}
|
||||
} else {
|
||||
if (!ircstrcasecmp (cmdparams->av[0], "d")) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039Top 10 Scores so far Today\0038 :");
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039 %d\0038 :\0037 %s \0039with\00311 %d\0039 points.", (ypln + 1), dhtsslrnick[ypln], dhtsslr[ypln]);
|
||||
}
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "w")) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039Top 10 Scores so far This Week\0038 :");
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039 %d\0038 :\0037 %s \0039with\00311 %d\0039 points.", (ypln + 1), whtsslrnick[ypln], whtsslr[ypln]);
|
||||
}
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "m")) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039Top 10 Scores so far This Month\0038 :");
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039 %d\0038 :\0037 %s \0039with\00311 %d\0039 points.", (ypln + 1), mhtsslrnick[ypln], mhtsslr[ypln]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Start Game
|
||||
*/
|
||||
int StartYahtzeeGame (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus == YS_GAME_STOPPED) {
|
||||
startcountdowntimer(cmdparams->source->name);
|
||||
} else if (currentyahtzeeplayercount < 10) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034A game has already started \0037%s\0034, Type '\2\003Join\2\0034' To Join in.", cmdparams->source->name);
|
||||
} else {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\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 Game
|
||||
*/
|
||||
int StopYahtzeeGame (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus != YS_GAME_STOPPED) {
|
||||
for (ypln = 0; ypln < currentyahtzeeplayercount; ypln++) {
|
||||
if (!ircstrcasecmp(ysplayernick[ypln], cmdparams->source->name)) {
|
||||
if ((currentyahtzeeplayercount == 1) || (currenthand == 1)) {
|
||||
stopyahtzee();
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034Yahtzee has been stopped by \0037%s.", cmdparams->source->name);
|
||||
} else {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034Unable to stop Yahtzee when more than one person playing, please use !remove if you wish to exit the game \0037%s.", cmdparams->source->name);
|
||||
}
|
||||
ypln += currentyahtzeeplayercount;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Pass Game To Nick
|
||||
*/
|
||||
int PassYahtzeeGame (CmdParams* cmdparams)
|
||||
{
|
||||
Client *u;
|
||||
int dpe=0;
|
||||
|
||||
if (currentyahtzeeplayercount < 1) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
for (ypln = 0; ypln < currentyahtzeeplayercount; ypln++) {
|
||||
if (!ircstrcasecmp(ysplayernick[ypln], cmdparams->source->name)) {
|
||||
dpe += 1;
|
||||
}
|
||||
}
|
||||
if (dpe < 1) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
u = FindUser(cmdparams->av[0]);
|
||||
if (!u) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "Sorry %s , The Nick %s is not currently Online", cmdparams->source->name, cmdparams->av[0]);
|
||||
return NS_SUCCESS;
|
||||
} else if ( IsExcluded(u) || IsMe(u) || IsBot(u) || IsAway(u) ) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "Sorry %s , %s Can't play your game for you at this time", cmdparams->source->name, u->name);
|
||||
return NS_SUCCESS;
|
||||
} else if (!ircstrcasecmp(cmdparams->source->name, u->name)) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "Just play your hand %s and stop trying to be smart", cmdparams->source->name);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
for (ypln = 0; ypln < currentyahtzeeplayercount; ypln++) {
|
||||
if (!ircstrcasecmp(ysplayernick[ypln], cmdparams->source->name)) {
|
||||
strlcpy(ysplayernick[ypln], u->name, MAXNICK);
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0039 has passed their game to\0037 %s", cmdparams->source->name, u->name);
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Join Player To Game
|
||||
*/
|
||||
int JoinYahtzeeGame (CmdParams* cmdparams) {
|
||||
if (currentyahtzeegamestatus == YS_GAME_STARTING || (currentyahtzeegamestatus == YS_GAME_PLAYING && currenthand < 2)) {
|
||||
if (currentyahtzeeplayercount < 10) {
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
if (!ircstrcasecmp(ysplayernick[ypln], cmdparams->source->name)) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
}
|
||||
strlcpy(ysplayernick[currentyahtzeeplayercount], cmdparams->source->name, MAXNICK);
|
||||
currentyahtzeeplayercount++;
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0038Welcome to Yahtzee \0037%s", cmdparams->source->name);
|
||||
} else {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034Sorry all places are filled \0037%s\0034, your welcome to try the next game though", cmdparams->source->name);
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove Player
|
||||
*/
|
||||
int RemoveYahtzeeGame (CmdParams* cmdparams)
|
||||
{
|
||||
Client *u;
|
||||
char nic[MAXNICK];
|
||||
int tfrpacp;
|
||||
int tfrpacpn;
|
||||
int yplnht;
|
||||
int cpfp;
|
||||
tfrpacp= 0;
|
||||
tfrpacpn= 0;
|
||||
|
||||
if (currentyahtzeeplayercount < 1) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
if (currentyahtzeegamestatus != YS_GAME_STARTING && currentyahtzeegamestatus != YS_GAME_PLAYING) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
if (cmdparams->ac < 1) {
|
||||
strlcpy(nic, cmdparams->source->name, MAXNICK);
|
||||
} else {
|
||||
u = FindUser(cmdparams->av[0]);
|
||||
if (u) {
|
||||
return NS_SUCCESS;
|
||||
} else {
|
||||
strlcpy(nic, cmdparams->av[0], MAXNICK);
|
||||
}
|
||||
}
|
||||
for (ypln = 0; ypln < currentyahtzeeplayercount; ypln++) {
|
||||
if (!ircstrcasecmp(ysplayernick[ypln], nic)) {
|
||||
if (ypln == currentplayer) {
|
||||
tfrpacp= 1;
|
||||
if (currentplayer == 0) {
|
||||
currenthand--;
|
||||
}
|
||||
} else if (ypln < currentplayer) {
|
||||
tfrpacp= 2;
|
||||
tfrpacpn= ypln;
|
||||
}
|
||||
for (yplnh = ypln; yplnh < currentyahtzeeplayercount; yplnh++) {
|
||||
cpfp= (yplnh + 1);
|
||||
if (cpfp == currentyahtzeeplayercount) {
|
||||
strlcpy(ysplayernick[yplnh], " ", MAXNICK);
|
||||
ysplayerscore[yplnh]= 0;
|
||||
for (yplnht = 0; yplnht < 15; yplnht++) {
|
||||
ysplayerhand[yplnh][yplnht]= 0;
|
||||
if (yplnht < 13) {
|
||||
ysplayerhandused[yplnh][yplnht]= "x";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
strlcpy(ysplayernick[yplnh], ysplayernick[cpfp], MAXNICK);
|
||||
ysplayerscore[yplnh]= ysplayerscore[cpfp];
|
||||
for (yplnht = 0; yplnht < 15; yplnht++) {
|
||||
ysplayerhand[yplnh][yplnht]= ysplayerhand[cpfp][yplnht];
|
||||
if (yplnht < 13) {
|
||||
if (!ircstrcasecmp(ysplayerhandused[cpfp][yplnht], "x")) {
|
||||
ysplayerhandused[yplnh][yplnht]= "x";
|
||||
} else {
|
||||
ysplayerhandused[yplnh][yplnht]= "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
currentyahtzeeplayercount--;
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s \0038Removed from the current game of Yahtzee", nic);
|
||||
}
|
||||
}
|
||||
if (currentyahtzeeplayercount < 1) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034Last player removed from Game, Stopping Current Game.");
|
||||
stopyahtzee();
|
||||
} else if (tfrpacp == 1) {
|
||||
if (currentplayer > (currentyahtzeeplayercount - 1)) {
|
||||
currentplayer= 0;
|
||||
}
|
||||
currentroll= 0;
|
||||
if (currentyahtzeegamestatus != YS_GAME_STARTING) {
|
||||
yrolldie();
|
||||
}
|
||||
} else if (tfrpacp == 2) {
|
||||
if (currentplayer > tfrpacpn) {
|
||||
currentplayer--;
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display Current Players
|
||||
*/
|
||||
int ShowPlayersYahtzeeGame (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus == YS_GAME_PLAYING) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039Current Players are\0038 :\0037 %s %s %s %s %s %s %s %s %s %s", ysplayernick[0], ysplayernick[1], ysplayernick[2], ysplayernick[3], ysplayernick[4], ysplayernick[5], ysplayernick[6], ysplayernick[7], ysplayernick[8], ysplayernick[9]);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display Current Players Turn
|
||||
*/
|
||||
int ShowTurnYahtzeeGame (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus == YS_GAME_PLAYING) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039The current Player is \0038 :\0037 %s", ysplayernick[currentplayer]);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Show Players Score Sheet
|
||||
*/
|
||||
int ShowYahtzeeSheet (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus == YS_GAME_PLAYING) {
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
if (!ircstrcasecmp(ysplayernick[ypln], cmdparams->source->name)) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0038 your current scores are :\0039 %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0034\2%s\2\0039 , %s\00311 %d\0039 , Total\00311 %d",
|
||||
cmdparams->source->name, ysscoretype[0], ysplayerhand[ypln][0], ysplayerhandused[ypln][0], ysscoretype[1], ysplayerhand[ypln][1], ysplayerhandused[ypln][1], ysscoretype[2], ysplayerhand[ypln][2], ysplayerhandused[ypln][2], ysscoretype[3], ysplayerhand[ypln][3]
|
||||
, ysplayerhandused[ypln][3], ysscoretype[4], ysplayerhand[ypln][4], ysplayerhandused[ypln][4], ysscoretype[5], ysplayerhand[ypln][5], ysplayerhandused[ypln][5], ysscoretype[13], ysplayerhand[ypln][13], ysscoretype[6], ysplayerhand[ypln][6], ysplayerhandused[ypln][6]
|
||||
, ysscoretype[7], ysplayerhand[ypln][7], ysplayerhandused[ypln][7], ysscoretype[8], ysplayerhand[ypln][8], ysplayerhandused[ypln][8], ysscoretype[9], ysplayerhand[ypln][9], ysplayerhandused[ypln][9], ysscoretype[10], ysplayerhand[ypln][10], ysplayerhandused[ypln][10]
|
||||
, ysscoretype[11], ysplayerhand[ypln][11], ysplayerhandused[ypln][11], ysscoretype[12], ysplayerhand[ypln][12], ysplayerhandused[ypln][12], ysscoretype[14], ysplayerhand[ypln][14], ysplayerscore[ypln]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display The Last Rolled Dice
|
||||
*/
|
||||
int ShowYahtzeeDice (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus == YS_GAME_PLAYING && !ircstrcasecmp(cmdparams->source->name, ysplayernick[currentplayer])) {
|
||||
getdieroll();
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0039 your last roll was roll \00311 %d\0039, you have \00311 %s\0039 showing", ysplayernick[currentplayer], currentroll, tmpstr);
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Score to Sheet Entry
|
||||
*/
|
||||
int ScoreYahtzeeDice (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus != YS_GAME_PLAYING || ircstrcasecmp(cmdparams->source->name,ysplayernick[currentplayer])) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
yscore(cmdparams->av,cmdparams->ac);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Roll Dice
|
||||
*/
|
||||
int RollYahtzeeDice (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus != YS_GAME_PLAYING || ircstrcasecmp(cmdparams->source->name,ysplayernick[currentplayer]) || currentroll > 2) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
reroll(cmdparams->av,cmdparams->ac,"roll");
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Keep Dice
|
||||
*/
|
||||
int KeepYahtzeeDice (CmdParams* cmdparams)
|
||||
{
|
||||
if (currentyahtzeegamestatus != YS_GAME_PLAYING || ircstrcasecmp(cmdparams->source->name,ysplayernick[currentplayer]) || currentroll > 2) {
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
reroll(cmdparams->av,cmdparams->ac,"keep");
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display High Score Pages
|
||||
*/
|
||||
int ShowHighList (CmdParams* cmdparams)
|
||||
{
|
||||
yplnh= 0;
|
||||
if (cmdparams->ac < 1) {
|
||||
yplnh= 1;
|
||||
} else {
|
||||
if (!ircstrcasecmp (cmdparams->av[0], "5")) {
|
||||
yplnh= 81;
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "4")) {
|
||||
yplnh= 61;
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "3")) {
|
||||
yplnh= 41;
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "2")) {
|
||||
yplnh= 21;
|
||||
} else {
|
||||
yplnh= 1;
|
||||
}
|
||||
}
|
||||
if (yplnh > 0) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039Top Scores so far %d-%d\0038 :", yplnh, (yplnh + 19));
|
||||
for (ypln = (yplnh - 1); ypln < (yplnh + 19); ypln++) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039 %d\0038 :\0037 %s \0039with\00311 %d\0039 points.", (ypln + 1), htsslrnick[ypln], htsslr[ypln]);
|
||||
}
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Timer Procedures
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Start Game
|
||||
*/
|
||||
|
||||
int startyahtzee(void) {
|
||||
if (currentyahtzeegamestatus == YS_GAME_STARTING) {
|
||||
if (currentyahtzeeplayercount < 1) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034No Players joined to current Game, Exiting");
|
||||
currentyahtzeegamestatus = YS_GAME_STOPPED;
|
||||
stopyahtzee();
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\00310Yahtzee is now starting, current players are \0037%s %s %s %s %s %s %s %s %s %s", ysplayernick[0], ysplayernick[1], ysplayernick[2], ysplayernick[3], ysplayernick[4], ysplayernick[5], ysplayernick[6], ysplayernick[7], ysplayernick[8], ysplayernick[9]);
|
||||
currentplayer= 0;
|
||||
currentyahtzeegamestatus = YS_GAME_PLAYING;
|
||||
yrolldie();
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reset Score Lists
|
||||
*/
|
||||
int yahtzeeday(void) {
|
||||
irc_chanalert (ys_bot, "\0038It's Midnight Here : \0037Clearing Daily Top 10 List");
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0038It's Midnight Here : \0037Clearing Daily Top 10 List");
|
||||
clearyahtzeedaily();
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
int yahtzeeweek(void) {
|
||||
irc_chanalert (ys_bot, "\0038It's Sunday Here : \0037Clearing Weekly Top 10 List");
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0038It's Sunday Here : \0037Clearing Weekly Top 10 List");
|
||||
clearyahtzeeweekly();
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
int yahtzeemonth(void) {
|
||||
irc_chanalert (ys_bot, "\0038It's The First Here : \0037Clearing Monthly Top 10 List");
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0038It's The First Here : \0037Clearing Monthly Top 10 List");
|
||||
clearyahtzeemonthly();
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
251
install-sh
Normal file
251
install-sh
Normal file
|
@ -0,0 +1,251 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
14
modconfig.h.in
Normal file
14
modconfig.h.in
Normal file
|
@ -0,0 +1,14 @@
|
|||
/* define this to enable debug code for this module */
|
||||
#undef DEBUG
|
||||
|
||||
/* Version number of package */
|
||||
#undef MODULE_VERSION
|
||||
|
||||
/* Major Version */
|
||||
#undef MODULE_MAJOR
|
||||
|
||||
/* Minor Version */
|
||||
#undef MODULE_MINOR
|
||||
|
||||
/* Revision */
|
||||
#undef MODULE_REV
|
15
modconfigwin32.h
Normal file
15
modconfigwin32.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* 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.a2"
|
||||
|
||||
/* Major Version */
|
||||
#define MODULE_MAJOR "3"
|
||||
|
||||
/* Minor Version */
|
||||
#define MODULE_MINOR "0"
|
||||
|
||||
/* Revision */
|
||||
#define MODULE_REV "a2"
|
569
play.c
Normal file
569
play.c
Normal file
|
@ -0,0 +1,569 @@
|
|||
/* YahtzeeServ - Yahtzee Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2003-2005 DeadNotBuried
|
||||
** Portions Copyright (c) 1999-2005, NeoStats
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** YahtzeeServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "yahtzeeserv.h"
|
||||
|
||||
/*
|
||||
* Stops Game
|
||||
*/
|
||||
void stopyahtzee() {
|
||||
if (currentyahtzeegamestatus == YS_GAME_STARTING) {
|
||||
DelTimer ("startyahtzee");
|
||||
}
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
strlcpy(ysplayernick[ypln], " ", MAXNICK);
|
||||
ysplayerscore[ypln]= 0;
|
||||
for (yplnh = 0; yplnh < 15; yplnh++) {
|
||||
ysplayerhand[ypln][yplnh]= 0;
|
||||
}
|
||||
for (yplnh = 0; yplnh < 13; yplnh++) {
|
||||
ysplayerhandused[ypln][yplnh]= "x";
|
||||
}
|
||||
}
|
||||
currentyahtzeeplayercount = 0;
|
||||
currentyahtzeegamestatus = YS_GAME_STOPPED;
|
||||
currenthand= 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Rolls the First Roll after checking game is not over
|
||||
* adds nicks to high score lists if needed,
|
||||
* and lets them know if they made a list
|
||||
*/
|
||||
void yrolldie() {
|
||||
Client *u;
|
||||
char *ydiec[5];
|
||||
char *dienums;
|
||||
int ywn, cdthsl, cdthslf, olutt, dlutt, wlutt, mlutt, dcfegisrw;
|
||||
|
||||
ywn= 0;
|
||||
dcfegisrw= 1;
|
||||
olutt= 0;
|
||||
dlutt= 0;
|
||||
wlutt= 0;
|
||||
mlutt= 0;
|
||||
if (currentplayer == 0) {
|
||||
srand((unsigned int)me.now);
|
||||
currenthand++;
|
||||
for (yplnh = 0; yplnh < 13; yplnh++) {
|
||||
if (!ircstrcasecmp(ysplayerhandused[currentplayer][yplnh], "x")) {
|
||||
dcfegisrw= 0;
|
||||
}
|
||||
}
|
||||
if (dcfegisrw > 0) {
|
||||
currenthand= 14;
|
||||
}
|
||||
if (currenthand > 13) {
|
||||
htsslrn= 0;
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0038Thats the end of the game folks.");
|
||||
for (ypln = 0; ypln < currentyahtzeeplayercount; ypln++) {
|
||||
if ((ypln != 0) && (ysplayerscore[ypln] > ysplayerscore[ywn])) {
|
||||
ywn= ypln;
|
||||
}
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\00310 ended with\00311 %d\00310 points.", ysplayernick[ypln], ysplayerscore[ypln]);
|
||||
}
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s \0038is the winner with\00311 %d \0038points.", ysplayernick[ywn], ysplayerscore[ywn]);
|
||||
for (ypln = 0; ypln < currentyahtzeeplayercount; ypln++) {
|
||||
for (yplnh = 0; yplnh < 100; yplnh++) {
|
||||
if (ysplayerscore[ypln] > htsslr[yplnh]) {
|
||||
olutt= 1;
|
||||
if (yplnh == 0) {
|
||||
if (htsslrn == 0) {
|
||||
strlcpy(htsslrnickold, htsslrnick[0], MAXNICK);
|
||||
htsslrold= htsslr[0];
|
||||
}
|
||||
htsslrn= 1;
|
||||
}
|
||||
for (cdthsl = 99; cdthsl > yplnh; cdthsl--) {
|
||||
cdthslf= (cdthsl - 1);
|
||||
strlcpy(htsslrnick[cdthsl], htsslrnick[cdthslf], MAXNICK);
|
||||
htsslr[cdthsl]= htsslr[cdthslf];
|
||||
}
|
||||
strlcpy(htsslrnick[yplnh], ysplayernick[ypln], MAXNICK);
|
||||
htsslr[yplnh]= ysplayerscore[ypln];
|
||||
u = FindUser(ysplayernick[ypln]);
|
||||
if (u) {
|
||||
irc_prefmsg (ys_bot, u, "Congratulations, You are now on the high score list at position %d", (yplnh + 1));
|
||||
}
|
||||
yplnh= 101;
|
||||
}
|
||||
}
|
||||
for (yplnh = 0; yplnh < 10; yplnh++) {
|
||||
if (ysplayerscore[ypln] > dhtsslr[yplnh]) {
|
||||
dlutt= 1;
|
||||
for (cdthsl = 9; cdthsl > yplnh; cdthsl--) {
|
||||
cdthslf= (cdthsl - 1);
|
||||
strlcpy(dhtsslrnick[cdthsl], dhtsslrnick[cdthslf], MAXNICK);
|
||||
dhtsslr[cdthsl]= dhtsslr[cdthslf];
|
||||
}
|
||||
strlcpy(dhtsslrnick[yplnh], ysplayernick[ypln], MAXNICK);
|
||||
dhtsslr[yplnh]= ysplayerscore[ypln];
|
||||
u = FindUser(ysplayernick[ypln]);
|
||||
if (u) {
|
||||
irc_prefmsg (ys_bot, u, "Congratulations, You are now on the Daily high score list at position %d", (yplnh + 1));
|
||||
}
|
||||
yplnh= 11;
|
||||
}
|
||||
}
|
||||
for (yplnh = 0; yplnh < 10; yplnh++) {
|
||||
if (ysplayerscore[ypln] > whtsslr[yplnh]) {
|
||||
wlutt= 1;
|
||||
for (cdthsl = 9; cdthsl > yplnh; cdthsl--) {
|
||||
cdthslf= (cdthsl - 1);
|
||||
strlcpy(whtsslrnick[cdthsl], whtsslrnick[cdthslf], MAXNICK);
|
||||
whtsslr[cdthsl]= whtsslr[cdthslf];
|
||||
}
|
||||
strlcpy(whtsslrnick[yplnh], ysplayernick[ypln], MAXNICK);
|
||||
whtsslr[yplnh]= ysplayerscore[ypln];
|
||||
u = FindUser(ysplayernick[ypln]);
|
||||
if (u) {
|
||||
irc_prefmsg (ys_bot, u, "Congratulations, You are now on the Weekly high score list at position %d", (yplnh + 1));
|
||||
}
|
||||
yplnh= 11;
|
||||
}
|
||||
}
|
||||
for (yplnh = 0; yplnh < 10; yplnh++) {
|
||||
if (ysplayerscore[ypln] > mhtsslr[yplnh]) {
|
||||
mlutt= 1;
|
||||
for (cdthsl = 9; cdthsl > yplnh; cdthsl--) {
|
||||
cdthslf= (cdthsl - 1);
|
||||
strlcpy(mhtsslrnick[cdthsl], mhtsslrnick[cdthslf], MAXNICK);
|
||||
mhtsslr[cdthsl]= mhtsslr[cdthslf];
|
||||
}
|
||||
strlcpy(mhtsslrnick[yplnh], ysplayernick[ypln], MAXNICK);
|
||||
mhtsslr[yplnh]= ysplayerscore[ypln];
|
||||
u = FindUser(ysplayernick[ypln]);
|
||||
if (u) {
|
||||
irc_prefmsg (ys_bot, u, "Congratulations, You are now on the Monthly high score list at position %d", (yplnh + 1));
|
||||
}
|
||||
yplnh= 11;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (htsslrn == 1) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s \0038now has the highest score, with\00311 %d \0038points, overtaking \0037%s\0038 who had\00311 %d \0038points.", htsslrnick[0], htsslr[0], htsslrnickold, htsslrold);
|
||||
} else {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s \0038still has the highest score, with\00311 %d \0038points.", htsslrnick[0], htsslr[0]);
|
||||
}
|
||||
htsslrn= 0;
|
||||
stopyahtzee();
|
||||
if (olutt == 1) {
|
||||
saveyahtzeeoverall();
|
||||
}
|
||||
if (dlutt == 1) {
|
||||
saveyahtzeedaily();
|
||||
}
|
||||
if (wlutt == 1) {
|
||||
saveyahtzeeweekly();
|
||||
}
|
||||
if (mlutt == 1) {
|
||||
saveyahtzeemonthly();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (ypln = 0; ypln < 5; ypln++) {
|
||||
ydie[ypln]= rand() % 6;
|
||||
if (ydie[ypln] == 0) {
|
||||
ydiec[ypln]= "\0034One\003";
|
||||
} else if (ydie[ypln] == 1) {
|
||||
ydiec[ypln]= "\0034Two\003";
|
||||
} else if (ydie[ypln] == 2) {
|
||||
ydiec[ypln]= "\0034Three\003";
|
||||
} else if (ydie[ypln] == 3) {
|
||||
ydiec[ypln]= "\0034Four\003";
|
||||
} else if (ydie[ypln] == 4) {
|
||||
ydiec[ypln]= "\0034Five\003";
|
||||
} else if (ydie[ypln] == 5) {
|
||||
ydiec[ypln]= "\0034Six\003";
|
||||
}
|
||||
}
|
||||
dienums= joinbuf(ydiec, 5, 0);
|
||||
currentroll= 1;
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0039 this is roll\00311 %d\0039, you rolled\00311 %s", ysplayernick[currentplayer], currentroll, dienums);
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets Current Roll and set variables
|
||||
*/
|
||||
void getdieroll() {
|
||||
char *ydiec[5];
|
||||
char *dienums;
|
||||
for (ypln = 0; ypln < 5; ypln++) {
|
||||
if (ydie[ypln] == 0) {
|
||||
ydiec[ypln]= "\0034One\003";
|
||||
} else if (ydie[ypln] == 1) {
|
||||
ydiec[ypln]= "\0034Two\003";
|
||||
} else if (ydie[ypln] == 2) {
|
||||
ydiec[ypln]= "\0034Three\003";
|
||||
} else if (ydie[ypln] == 3) {
|
||||
ydiec[ypln]= "\0034Four\003";
|
||||
} else if (ydie[ypln] == 4) {
|
||||
ydiec[ypln]= "\0034Five\003";
|
||||
} else if (ydie[ypln] == 5) {
|
||||
ydiec[ypln]= "\0034Six\003";
|
||||
}
|
||||
}
|
||||
tmpstr= joinbuf(ydiec, 5, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Gets Current Roll and set variables
|
||||
*/
|
||||
void yscore(char **argvy, int argcy) {
|
||||
int tstbonus;
|
||||
int scoredthisturn;
|
||||
int scoredalready;
|
||||
scoredalready= 0;
|
||||
if ( argcy < 1 ) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034Sorry\0037 %s\0034, thats not a valid score slot, please use one of the following", ysplayernick[currentplayer]);
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\00311One's (1) , Two's (2) , Three's (3) , Four's (4) , Five's (5) , Six's (6)");
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\00311Full House (FH) , Short Straight (SS) , Long Straight (LS)");
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\00311Three of a Kind (3K) , Four of a Kind (4K) , Chance (C) , Yahtzee (Y)");
|
||||
return;
|
||||
}
|
||||
crs= 0;
|
||||
for (ypln = 0; ypln < 6; ypln++) {
|
||||
dtsc[ypln]= 0;
|
||||
}
|
||||
for (ypln = 0; ypln < 5; ypln++) {
|
||||
dtsc[ydie[ypln]]++;
|
||||
}
|
||||
if (!ircstrcasecmp(argvy[0], "1")) {
|
||||
scoredthisturn= 0;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][0], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scoredie(1);
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "2")) {
|
||||
scoredthisturn= 1;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][1], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scoredie(2);
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "3")) {
|
||||
scoredthisturn= 2;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][2], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scoredie(3);
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "4")) {
|
||||
scoredthisturn= 3;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][3], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scoredie(4);
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "5")) {
|
||||
scoredthisturn= 4;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][4], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scoredie(5);
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "6")) {
|
||||
scoredthisturn= 5;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][5], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scoredie(6);
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "fh")) {
|
||||
scoredthisturn= 6;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][6], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scorefh();
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "ss")) {
|
||||
scoredthisturn= 7;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][7], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scoress();
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "ls")) {
|
||||
scoredthisturn= 8;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][8], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scorels();
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "3k")) {
|
||||
scoredthisturn= 9;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][9], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
score3k();
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "4k")) {
|
||||
scoredthisturn= 10;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][10], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
score4k();
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "c")) {
|
||||
scoredthisturn= 11;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][11], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scorec();
|
||||
}
|
||||
} else if (!ircstrcasecmp(argvy[0], "y")) {
|
||||
scoredthisturn= 12;
|
||||
if (ircstrcasecmp(ysplayerhandused[currentplayer][12], "x")) {
|
||||
scoredalready= 1;
|
||||
} else {
|
||||
scorey();
|
||||
if (crs == 50) {
|
||||
ysplayerhand[currentplayer][12] = 9999;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034Sorry\0037 %s\0034, thats not a valid score slot, please use one of the following", ysplayernick[currentplayer]);
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\00311One's (1) , Two's (2) , Three's (3) , Four's (4) , Five's (5) , Six's (6)");
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\00311Full House (FH) , Short Straight (SS) , Long Straight (LS)");
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\00311Three of a Kind (3K) , Four of a Kind (4K) , Chance (C) , Yahtzee (Y)");
|
||||
return;
|
||||
}
|
||||
if (scoredalready == 1) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0034Sorry\0037 %s\0034 you have already scored on \00311%s", ysplayernick[currentplayer], ysscoretype[scoredthisturn]);
|
||||
return;
|
||||
}
|
||||
ysplayerhandused[currentplayer][scoredthisturn]= "";
|
||||
if (scoredthisturn != 12) {
|
||||
ysplayerhand[currentplayer][scoredthisturn] = crs;
|
||||
}
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0039 scored\00311 %d\0039 on \00311%s", ysplayernick[currentplayer], crs, ysscoretype[scoredthisturn]);
|
||||
if (ysplayerhand[currentplayer][13] < 1) {
|
||||
tstbonus= 0;
|
||||
for (yplnh = 0; yplnh < 6; yplnh++) {
|
||||
tstbonus += ysplayerhand[currentplayer][yplnh];
|
||||
}
|
||||
if (tstbonus > 62) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0039 scored a \0038Bonus\00311 35 \0039points", ysplayernick[currentplayer]);
|
||||
crs += 35;
|
||||
ysplayerhand[currentplayer][13]= 35;
|
||||
ysplayerhandused[currentplayer][13]= "";
|
||||
}
|
||||
}
|
||||
if ((ysplayerhand[currentplayer][12] == 50) && (crs > 0)) {
|
||||
if ( (ydie[0] == ydie[1]) && (ydie[0] == ydie[2]) && (ydie[0] == ydie[3]) && (ydie[0] == ydie[4])) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0039 scored a \0038Bonus\00311 100 \0039points", ysplayernick[currentplayer]);
|
||||
crs += 100;
|
||||
ysplayerhand[currentplayer][14] += 100;
|
||||
ysplayerhandused[currentplayer][14]= "";
|
||||
}
|
||||
}
|
||||
if (ysplayerhand[currentplayer][12] == 9999) {
|
||||
ysplayerhand[currentplayer][12] = 50;
|
||||
}
|
||||
ysplayerscore[currentplayer] += crs;
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0039 now has a total of\00311 %d\0039 points", ysplayernick[currentplayer], ysplayerscore[currentplayer]);
|
||||
currentplayer++;
|
||||
if (currentplayer > (currentyahtzeeplayercount - 1)) {
|
||||
currentplayer= 0;
|
||||
}
|
||||
currentroll= 0;
|
||||
yrolldie();
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* ReRolls Selected Dice
|
||||
*/
|
||||
void reroll(char **argvy, int argcy, char *rolltype) {
|
||||
char *ydiec[5];
|
||||
char *dienums;
|
||||
int keepdie[5];
|
||||
char *tstdni;
|
||||
char *buf;
|
||||
int kdt1;
|
||||
int kdt2;
|
||||
if (!ircstrcasecmp(rolltype, "roll")) {
|
||||
kdt1= 0;
|
||||
kdt2= 1;
|
||||
} else {
|
||||
kdt1= 1;
|
||||
kdt2= 0;
|
||||
}
|
||||
for (ypln = 0; ypln < 5; ypln++) {
|
||||
keepdie[ypln]= kdt2;
|
||||
}
|
||||
buf= joinbuf(argvy, argcy, 0);
|
||||
tstdni= strcasestr(buf, "1");
|
||||
if (!tstdni==NULL) {
|
||||
keepdie[0]= kdt1;
|
||||
}
|
||||
tstdni= strcasestr(buf, "2");
|
||||
if (!tstdni==NULL) {
|
||||
keepdie[1]= kdt1;
|
||||
}
|
||||
tstdni= strcasestr(buf, "3");
|
||||
if (!tstdni==NULL) {
|
||||
keepdie[2]= kdt1;
|
||||
}
|
||||
tstdni= strcasestr(buf, "4");
|
||||
if (!tstdni==NULL) {
|
||||
keepdie[3]= kdt1;
|
||||
}
|
||||
tstdni= strcasestr(buf, "5");
|
||||
if (!tstdni==NULL) {
|
||||
keepdie[4]= kdt1;
|
||||
}
|
||||
for (ypln = 0; ypln < 5; ypln++) {
|
||||
if (keepdie[ypln] < 1) {
|
||||
ydie[ypln]= rand() % 6;
|
||||
if (ydie[ypln] == 0) {
|
||||
ydiec[ypln]= "\0034One\003";
|
||||
} else if (ydie[ypln] == 1) {
|
||||
ydiec[ypln]= "\0034Two\003";
|
||||
} else if (ydie[ypln] == 2) {
|
||||
ydiec[ypln]= "\0034Three\003";
|
||||
} else if (ydie[ypln] == 3) {
|
||||
ydiec[ypln]= "\0034Four\003";
|
||||
} else if (ydie[ypln] == 4) {
|
||||
ydiec[ypln]= "\0034Five\003";
|
||||
} else if (ydie[ypln] == 5) {
|
||||
ydiec[ypln]= "\0034Six\003";
|
||||
}
|
||||
} else {
|
||||
if (ydie[ypln] == 0) {
|
||||
ydiec[ypln]= "\00311One\003";
|
||||
} else if (ydie[ypln] == 1) {
|
||||
ydiec[ypln]= "\00311Two\003";
|
||||
} else if (ydie[ypln] == 2) {
|
||||
ydiec[ypln]= "\00311Three\003";
|
||||
} else if (ydie[ypln] == 3) {
|
||||
ydiec[ypln]= "\00311Four\003";
|
||||
} else if (ydie[ypln] == 4) {
|
||||
ydiec[ypln]= "\00311Five\003";
|
||||
} else if (ydie[ypln] == 5) {
|
||||
ydiec[ypln]= "\00311Six\003";
|
||||
}
|
||||
}
|
||||
}
|
||||
dienums= joinbuf(ydiec, 5, 0);
|
||||
currentroll++;
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037%s\0039 this is roll\00311 %d\0039, you rolled\00311 %s", ysplayernick[currentplayer], currentroll, dienums);
|
||||
if (currentroll == 3) {
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039That was your last roll this turn\0037 %s\0039, select which score to take", ysplayernick[currentplayer]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Start Game
|
||||
*/
|
||||
|
||||
void startcountdowntimer(char *nic) {
|
||||
currentyahtzeegamestatus = YS_GAME_STARTING;
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0037A new game of Yahtzee has been started by %s. Game will start in 30 seconds, type '\2\003!Join\2\0037' to play.", nic);
|
||||
AddTimer (TIMER_TYPE_COUNTDOWN, startyahtzee, "startyahtzee", 30);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Check Scores
|
||||
*/
|
||||
void scoredie(int sconum) {
|
||||
for (ypln = 0; ypln < 5; ypln++) {
|
||||
if (ydie[ypln] == (sconum - 1)) {
|
||||
crs += sconum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void scorefh() {
|
||||
int fhs;
|
||||
fhs= 0;
|
||||
for (ypln = 0; ypln < 6; ypln++) {
|
||||
if ((dtsc[ypln] == 2) || (dtsc[ypln] == 3)) {
|
||||
fhs++;
|
||||
} else if (dtsc[ypln] == 1) {
|
||||
fhs--;
|
||||
}
|
||||
}
|
||||
if (fhs == 2) {
|
||||
crs= 25;
|
||||
}
|
||||
}
|
||||
|
||||
void scoress() {
|
||||
int snd;
|
||||
snd= 0;
|
||||
for (ypln = 0; ypln < 6; ypln++) {
|
||||
if (dtsc[ypln] == 0) {
|
||||
if (snd < 4) {
|
||||
snd= 0;
|
||||
}
|
||||
} else {
|
||||
snd++;
|
||||
}
|
||||
}
|
||||
if (snd > 3) {
|
||||
crs = 30;
|
||||
}
|
||||
}
|
||||
|
||||
void scorels() {
|
||||
if ((dtsc[1] == 1) && (dtsc[2] == 1) && (dtsc[3] == 1) && (dtsc[4] == 1)) {
|
||||
crs = 40;
|
||||
}
|
||||
}
|
||||
|
||||
void score3k() {
|
||||
for (ypln = 0; ypln < 6; ypln++) {
|
||||
if (dtsc[ypln] > 2) {
|
||||
for (yplnh = 0; yplnh < 5; yplnh++) {
|
||||
crs += (ydie[yplnh] + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void score4k() {
|
||||
for (ypln = 0; ypln < 6; ypln++) {
|
||||
if (dtsc[ypln] > 3) {
|
||||
for (yplnh = 0; yplnh < 5; yplnh++) {
|
||||
crs += (ydie[yplnh] + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void scorec() {
|
||||
for (ypln = 0; ypln < 5; ypln++) {
|
||||
crs += (ydie[ypln] + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void scorey() {
|
||||
if ( (ydie[0] == ydie[1]) && (ydie[0] == ydie[2]) && (ydie[0] == ydie[3]) && (ydie[0] == ydie[4])) {
|
||||
crs += 50;
|
||||
}
|
||||
}
|
347
yahtzeeserv.c
Normal file
347
yahtzeeserv.c
Normal file
|
@ -0,0 +1,347 @@
|
|||
/* YahtzeeServ - Yahtzee Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2003-2005 DeadNotBuried
|
||||
** Portions Copyright (c) 1999-2005, NeoStats
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** YahtzeeServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "yahtzeeserv.h"
|
||||
|
||||
/** Copyright info */
|
||||
const char *ys_copyright[] = {
|
||||
"Copyright (c) 2004-2005 DeadNotBuried",
|
||||
"Portions Copyright (c) 1999-2005, NeoStats",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_about[] = {
|
||||
"\2Yahtzee Game Service\2",
|
||||
"",
|
||||
"Plays just like the dice game.",
|
||||
"",
|
||||
"See Rules for instructions.",
|
||||
NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* Commands and Settings
|
||||
*/
|
||||
static bot_cmd ys_commands[]=
|
||||
{
|
||||
{"START", StartYahtzeeGame, 0, 0, ys_help_start, ys_help_start_oneline},
|
||||
{"STOP", StopYahtzeeGame, 0, 0, ys_help_stop, ys_help_stop_oneline},
|
||||
{"JOIN", JoinYahtzeeGame, 0, 0, ys_help_join, ys_help_join_oneline},
|
||||
{"REMOVE", RemoveYahtzeeGame, 0, 0, ys_help_remove, ys_help_remove_oneline},
|
||||
{"PLAYERS", ShowPlayersYahtzeeGame, 0, 0, ys_help_players, ys_help_players_oneline},
|
||||
{"TURN", ShowTurnYahtzeeGame, 0, 0, ys_help_turn, ys_help_turn_oneline},
|
||||
{"PASS", PassYahtzeeGame, 1, 0, ys_help_pass, ys_help_pass_oneline},
|
||||
{"DICE", ShowYahtzeeDice, 0, 0, ys_help_dice, ys_help_dice_oneline},
|
||||
{"SHEET", ShowYahtzeeSheet, 0, 0, ys_help_sheet, ys_help_sheet_oneline},
|
||||
{"ROLL", RollYahtzeeDice, 0, 0, ys_help_roll, ys_help_roll_oneline},
|
||||
{"KEEP", KeepYahtzeeDice, 0, 0, ys_help_keep, ys_help_keep_oneline},
|
||||
{"SCORE", ScoreYahtzeeDice, 0, 0, ys_help_score, ys_help_score_oneline},
|
||||
{"TOP10", ShowTop10Lists, 0, 0, ys_help_top10, ys_help_top10_oneline},
|
||||
{"HIGH", ShowHighList, 0, 0, ys_help_high, ys_help_high_oneline},
|
||||
{"RULES", ShowRulePages, 0, 0, ys_help_rules, ys_help_rules_oneline},
|
||||
{NULL, NULL, 0, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
static bot_setting ys_settings[]=
|
||||
{
|
||||
{"CHAN", &yahtzeeroom, SET_TYPE_CHANNEL, 0, MAXCHANLEN, NS_ULEVEL_ADMIN, NULL, ys_help_set_chan, ys_cmd_set_chan, (void *)"#Games_Yahtzee" },
|
||||
{NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* Module Info definition
|
||||
*/
|
||||
ModuleInfo module_info = {
|
||||
"YahtzeeServ",
|
||||
"Yahtzee Game Module For NeoStats",
|
||||
ys_copyright,
|
||||
ys_about,
|
||||
NEOSTATS_VERSION,
|
||||
"3.0",
|
||||
__DATE__,
|
||||
__TIME__,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
/*
|
||||
* Module event list
|
||||
*/
|
||||
ModuleEvent module_events[] = {
|
||||
{EVENT_NICK, PlayerNickChange},
|
||||
{EVENT_NULL, NULL}
|
||||
};
|
||||
|
||||
/** BotInfo */
|
||||
static BotInfo ys_botinfo =
|
||||
{
|
||||
"YahtzeeServ",
|
||||
"YahtzeeServ1",
|
||||
"Yahtzee",
|
||||
BOT_COMMON_HOST,
|
||||
"Yahtzee Game Service",
|
||||
BOT_FLAG_SERVICEBOT|BOT_FLAG_PERSIST,
|
||||
ys_commands,
|
||||
ys_settings,
|
||||
};
|
||||
|
||||
char *s_module_bot_name;
|
||||
char yahtzeeroom[MAXCHANLEN];
|
||||
char ysplayernick[10][MAXNICK];
|
||||
int ysplayerscore[10];
|
||||
char *ysscoretype[15];
|
||||
int ysplayerhand[10][15];
|
||||
char *ysplayerhandused[10][15];
|
||||
int ypln;
|
||||
int yplnh;
|
||||
int currentyahtzeeplayercount;
|
||||
int currentyahtzeegamestatus;
|
||||
int currentplayer;
|
||||
int currentroll;
|
||||
int currenthand;
|
||||
int ydie[5];
|
||||
char *scoretext[100];
|
||||
int scoretextargs;
|
||||
char *tmpstr;
|
||||
int crs;
|
||||
int htsslrn;
|
||||
int htsslrold;
|
||||
char htsslrnickold[MAXNICK];
|
||||
int htsslr[100];
|
||||
char htsslrnick[100][MAXNICK];
|
||||
int dhtsslr[10];
|
||||
char dhtsslrnick[10][MAXNICK];
|
||||
int whtsslr[10];
|
||||
char whtsslrnick[10][MAXNICK];
|
||||
int mhtsslr[10];
|
||||
char mhtsslrnick[10][MAXNICK];
|
||||
int dtsc[6];
|
||||
|
||||
/*
|
||||
* Online event processing
|
||||
*/
|
||||
int ModSynch (void)
|
||||
{
|
||||
/* Introduce a bot onto the network */
|
||||
ys_bot = AddBot (&ys_botinfo);
|
||||
if (!ys_bot) {
|
||||
return NS_FAILURE;
|
||||
}
|
||||
srand((unsigned int)me.now);
|
||||
irc_chanalert (ys_bot, "Game will start in %s", yahtzeeroom);
|
||||
irc_join (ys_bot, yahtzeeroom, "+o");
|
||||
return NS_SUCCESS;
|
||||
};
|
||||
|
||||
/*
|
||||
* Init module
|
||||
*/
|
||||
int ModInit( void )
|
||||
{
|
||||
ysscoretype[0]= "One's";
|
||||
ysscoretype[1]= "Two's";
|
||||
ysscoretype[2]= "Three's";
|
||||
ysscoretype[3]= "Four's";
|
||||
ysscoretype[4]= "Five's";
|
||||
ysscoretype[5]= "Six's";
|
||||
ysscoretype[6]= "Full House";
|
||||
ysscoretype[7]= "Short Straight";
|
||||
ysscoretype[8]= "Long Straight";
|
||||
ysscoretype[9]= "Three of a Kind";
|
||||
ysscoretype[10]= "Four of a Kind";
|
||||
ysscoretype[11]= "Chance";
|
||||
ysscoretype[12]= "Yahtzee";
|
||||
ysscoretype[13]= "Bonus";
|
||||
ysscoretype[14]= "Yahtzee Bonus";
|
||||
stopyahtzee();
|
||||
htsslrn= 0;
|
||||
htsslrold= 0;
|
||||
for (ypln = 0; ypln < 100; ypln++) {
|
||||
strlcpy(htsslrnick[ypln], " ", MAXNICK);
|
||||
htsslr[ypln]= 0;
|
||||
}
|
||||
ModuleConfig (ys_settings);
|
||||
AddTimer (TIMER_TYPE_DAILY, yahtzeeday, "yahtzeeday", 0);
|
||||
AddTimer (TIMER_TYPE_WEEKLY, yahtzeeweek, "yahtzeeweek", 0);
|
||||
AddTimer (TIMER_TYPE_MONTHLY, yahtzeemonth, "yahtzeemonth", 0);
|
||||
loadyahtzeescores();
|
||||
strlcpy(htsslrnickold, " ", MAXNICK);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Exit module
|
||||
*/
|
||||
int ModFini( void )
|
||||
{
|
||||
if (currentyahtzeegamestatus == YS_GAME_STARTING) {
|
||||
DelTimer ("startyahtzee");
|
||||
}
|
||||
DelTimer ("yahtzeeday");
|
||||
DelTimer ("yahtzeeweek");
|
||||
DelTimer ("yahtzeemonth");
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Overrides
|
||||
*/
|
||||
static int ys_cmd_set_chan(CmdParams *cmdparams, SET_REASON reason)
|
||||
{
|
||||
if (reason == SET_VALIDATE) {
|
||||
if (currentyahtzeegamestatus != YS_GAME_STOPPED) {
|
||||
irc_prefmsg (ys_bot, cmdparams->source, "Unable to change Game Channel while Game in Progress.");
|
||||
return NS_FAILURE;
|
||||
}
|
||||
irc_chanalert (ys_bot, "Game Channel Changing to %s , Parting %s (%s)", cmdparams->av[1], yahtzeeroom, cmdparams->source->name);
|
||||
irc_chanprivmsg (ys_bot, yahtzeeroom, "\0039%s has changed Channels, Game will now be available in %s", cmdparams->source->name, cmdparams->av[1]);
|
||||
irc_part (ys_bot, yahtzeeroom, NULL);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
if (reason == SET_CHANGE) {
|
||||
irc_join (ys_bot, yahtzeeroom, "+o");
|
||||
irc_chanalert (ys_bot, "Game Now Available In %s", yahtzeeroom);
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Loads High Score Lists
|
||||
*/
|
||||
void loadyahtzeescores() {
|
||||
|
||||
char cfgid[255];
|
||||
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
snprintf(cfgid, 255, "HSON%d", ypln);
|
||||
if (DBAFetchStr ("Scores", cfgid, htsslrnick[ypln], MAXNICK) != NS_SUCCESS) {
|
||||
strlcpy (htsslrnick[ypln], " ", MAXNICK);
|
||||
}
|
||||
snprintf(cfgid, 255, "HSOS%d", ypln);
|
||||
if (DBAFetchInt ("Scores", cfgid, &htsslr[ypln]) != NS_SUCCESS) {
|
||||
htsslr[ypln] = 0;
|
||||
}
|
||||
snprintf(cfgid, 255, "HSDN%d", ypln);
|
||||
if (DBAFetchStr ("Scores", cfgid, dhtsslrnick[ypln], MAXNICK) != NS_SUCCESS) {
|
||||
strlcpy (dhtsslrnick[ypln], " ", MAXNICK);
|
||||
}
|
||||
snprintf(cfgid, 255, "HSDS%d", ypln);
|
||||
if (DBAFetchInt ("Scores", cfgid, &dhtsslr[ypln]) != NS_SUCCESS) {
|
||||
dhtsslr[ypln] = 0;
|
||||
}
|
||||
snprintf(cfgid, 255, "HSWN%d", ypln);
|
||||
if (DBAFetchStr ("Scores", cfgid, whtsslrnick[ypln], MAXNICK) != NS_SUCCESS) {
|
||||
strlcpy (whtsslrnick[ypln], " ", MAXNICK);
|
||||
}
|
||||
snprintf(cfgid, 255, "HSWS%d", ypln);
|
||||
if (DBAFetchInt ("Scores", cfgid, &whtsslr[ypln]) != NS_SUCCESS) {
|
||||
whtsslr[ypln] = 0;
|
||||
}
|
||||
snprintf(cfgid, 255, "HSMN%d", ypln);
|
||||
if (DBAFetchStr ("Scores", cfgid, mhtsslrnick[ypln], MAXNICK) != NS_SUCCESS) {
|
||||
strlcpy (mhtsslrnick[ypln], " ", MAXNICK);
|
||||
}
|
||||
snprintf(cfgid, 255, "HSMS%d", ypln);
|
||||
if (DBAFetchInt ("Scores", cfgid, &mhtsslr[ypln]) != NS_SUCCESS) {
|
||||
mhtsslr[ypln] = 0;
|
||||
}
|
||||
}
|
||||
for (ypln = 10; ypln < 100; ypln++) {
|
||||
snprintf(cfgid, 255, "HSON%d", ypln);
|
||||
if (DBAFetchStr ("Scores", cfgid, htsslrnick[ypln], MAXNICK) != NS_SUCCESS) {
|
||||
strlcpy (htsslrnick[ypln], " ", MAXNICK);
|
||||
}
|
||||
snprintf(cfgid, 255, "HSOS%d", ypln);
|
||||
if (DBAFetchInt ("Scores", cfgid, &htsslr[ypln]) != NS_SUCCESS) {
|
||||
htsslr[ypln] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* These clear the appropriate score lists
|
||||
*/
|
||||
void clearyahtzeedaily() {
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
strlcpy(dhtsslrnick[ypln], " ", MAXNICK);
|
||||
dhtsslr[ypln]= 0;
|
||||
}
|
||||
saveyahtzeedaily();
|
||||
}
|
||||
void clearyahtzeeweekly() {
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
strlcpy(whtsslrnick[ypln], " ", MAXNICK);
|
||||
whtsslr[ypln]= 0;
|
||||
}
|
||||
saveyahtzeeweekly();
|
||||
}
|
||||
void clearyahtzeemonthly() {
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
strlcpy(mhtsslrnick[ypln], " ", MAXNICK);
|
||||
mhtsslr[ypln]= 0;
|
||||
}
|
||||
saveyahtzeemonthly();
|
||||
}
|
||||
|
||||
/**
|
||||
* These save the appropriate score lists
|
||||
*/
|
||||
void saveyahtzeeoverall() {
|
||||
char cfgid[255];
|
||||
for (ypln = 0; ypln < 100; ypln++) {
|
||||
snprintf(cfgid, 255, "HSON%d", ypln);
|
||||
DBAStoreStr ("Scores", cfgid, htsslrnick[ypln], MAXNICK);
|
||||
snprintf(cfgid, 255, "HSOS%d", ypln);
|
||||
DBAStoreInt ("Scores", cfgid, &htsslr[ypln]);
|
||||
}
|
||||
}
|
||||
|
||||
void saveyahtzeedaily() {
|
||||
char cfgid[255];
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
snprintf(cfgid, 255, "HSDN%d", ypln);
|
||||
DBAStoreStr ("Scores", cfgid, dhtsslrnick[ypln], MAXNICK);
|
||||
snprintf(cfgid, 255, "HSDS%d", ypln);
|
||||
DBAStoreInt ("Scores", cfgid, &dhtsslr[ypln]);
|
||||
}
|
||||
}
|
||||
void saveyahtzeeweekly() {
|
||||
char cfgid[255];
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
snprintf(cfgid, 255, "HSWN%d", ypln);
|
||||
DBAStoreStr ("Scores", cfgid, whtsslrnick[ypln], MAXNICK);
|
||||
snprintf(cfgid, 255, "HSWS%d", ypln);
|
||||
DBAStoreInt ("Scores", cfgid, &whtsslr[ypln]);
|
||||
}
|
||||
}
|
||||
void saveyahtzeemonthly() {
|
||||
char cfgid[255];
|
||||
for (ypln = 0; ypln < 10; ypln++) {
|
||||
snprintf(cfgid, 255, "HSMN%d", ypln);
|
||||
DBAStoreStr ("Scores", cfgid, mhtsslrnick[ypln], MAXNICK);
|
||||
snprintf(cfgid, 255, "HSMS%d", ypln);
|
||||
DBAStoreInt ("Scores", cfgid, &mhtsslr[ypln]);
|
||||
}
|
||||
}
|
148
yahtzeeserv.h
Normal file
148
yahtzeeserv.h
Normal file
|
@ -0,0 +1,148 @@
|
|||
/* YahtzeeServ - Yahtzee Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2003-2005 DeadNotBuried
|
||||
** Portions Copyright (c) 1999-2005, NeoStats
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** YahtzeeServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
Bot *ys_bot;
|
||||
|
||||
/*
|
||||
* YahtzeeServ Module Help
|
||||
*/
|
||||
extern const char *ys_help_set_chan[];
|
||||
extern const char ys_help_start_oneline[];
|
||||
extern const char ys_help_stop_oneline[];
|
||||
extern const char ys_help_join_oneline[];
|
||||
extern const char ys_help_remove_oneline[];
|
||||
extern const char ys_help_players_oneline[];
|
||||
extern const char ys_help_turn_oneline[];
|
||||
extern const char ys_help_pass_oneline[];
|
||||
extern const char ys_help_dice_oneline[];
|
||||
extern const char ys_help_roll_oneline[];
|
||||
extern const char ys_help_keep_oneline[];
|
||||
extern const char ys_help_score_oneline[];
|
||||
extern const char ys_help_sheet_oneline[];
|
||||
extern const char ys_help_top10_oneline[];
|
||||
extern const char ys_help_high_oneline[];
|
||||
extern const char ys_help_rules_oneline[];
|
||||
extern const char *ys_help_start[];
|
||||
extern const char *ys_help_stop[];
|
||||
extern const char *ys_help_join[];
|
||||
extern const char *ys_help_remove[];
|
||||
extern const char *ys_help_players[];
|
||||
extern const char *ys_help_turn[];
|
||||
extern const char *ys_help_pass[];
|
||||
extern const char *ys_help_dice[];
|
||||
extern const char *ys_help_roll[];
|
||||
extern const char *ys_help_keep[];
|
||||
extern const char *ys_help_score[];
|
||||
extern const char *ys_help_sheet[];
|
||||
extern const char *ys_help_top10[];
|
||||
extern const char *ys_help_high[];
|
||||
extern const char *ys_help_rules[];
|
||||
|
||||
/*
|
||||
* Defines
|
||||
*/
|
||||
#define YS_GAME_STOPPED 0x00000001 /* Game Not Running */
|
||||
#define YS_GAME_STARTING 0x00000002 /* Game Starting */
|
||||
#define YS_GAME_PLAYING 0x00000003 /* Game Running */
|
||||
#define YS_GAME_STOPPING 0x00000004 /* Game Running */
|
||||
|
||||
/*
|
||||
* Variables
|
||||
*/
|
||||
extern char yahtzeeroom[MAXCHANLEN];
|
||||
extern char ysplayernick[10][MAXNICK];
|
||||
extern int ysplayerscore[10];
|
||||
extern char *ysscoretype[15];
|
||||
extern int ysplayerhand[10][15];
|
||||
extern char *ysplayerhandused[10][15];
|
||||
extern int ypln;
|
||||
extern int yplnh;
|
||||
extern int currentyahtzeeplayercount;
|
||||
extern int currentyahtzeegamestatus;
|
||||
extern int currentplayer;
|
||||
extern int currentroll;
|
||||
extern int currenthand;
|
||||
extern int ydie[5];
|
||||
extern char *scoretext[100];
|
||||
extern int scoretextargs;
|
||||
extern char *tmpstr;
|
||||
extern int crs;
|
||||
extern int htsslrn;
|
||||
extern int htsslrold;
|
||||
extern char htsslrnickold[MAXNICK];
|
||||
extern int htsslr[100];
|
||||
extern char htsslrnick[100][MAXNICK];
|
||||
extern int dhtsslr[10];
|
||||
extern char dhtsslrnick[10][MAXNICK];
|
||||
extern int whtsslr[10];
|
||||
extern char whtsslrnick[10][MAXNICK];
|
||||
extern int mhtsslr[10];
|
||||
extern char mhtsslrnick[10][MAXNICK];
|
||||
extern int dtsc[6];
|
||||
|
||||
/*
|
||||
* Procedures
|
||||
*/
|
||||
int PlayerNickChange (CmdParams* cmdparams);
|
||||
int StartYahtzeeGame (CmdParams* cmdparams);
|
||||
int StopYahtzeeGame (CmdParams* cmdparams);
|
||||
int JoinYahtzeeGame (CmdParams* cmdparams);
|
||||
int RemoveYahtzeeGame (CmdParams* cmdparams);
|
||||
int ShowPlayersYahtzeeGame (CmdParams* cmdparams);
|
||||
int ShowTurnYahtzeeGame (CmdParams* cmdparams);
|
||||
int PassYahtzeeGame (CmdParams* cmdparams);
|
||||
int ShowYahtzeeDice (CmdParams* cmdparams);
|
||||
int ShowYahtzeeSheet (CmdParams* cmdparams);
|
||||
int RollYahtzeeDice (CmdParams* cmdparams);
|
||||
int KeepYahtzeeDice (CmdParams* cmdparams);
|
||||
int ScoreYahtzeeDice (CmdParams* cmdparams);
|
||||
int ShowTop10Lists (CmdParams* cmdparams);
|
||||
int ShowHighList (CmdParams* cmdparams);
|
||||
int ShowRulePages (CmdParams* cmdparams);
|
||||
static int ys_cmd_set_chan (CmdParams *cmdparams, SET_REASON reason);
|
||||
void stopyahtzee(void);
|
||||
void yrolldie(void);
|
||||
void getdieroll(void);
|
||||
void yscore(char **argvy, int argcy);
|
||||
void reroll(char **argvy, int argcy, char *rolltype);
|
||||
void startcountdowntimer(char *nic);
|
||||
int startyahtzee(void);
|
||||
void scoredie(int sconum);
|
||||
void scorefh(void);
|
||||
void scoress(void);
|
||||
void scorels(void);
|
||||
void score3k(void);
|
||||
void score4k(void);
|
||||
void scorec(void);
|
||||
void scorey(void);
|
||||
void loadyahtzeescores(void);
|
||||
int yahtzeeday(void);
|
||||
int yahtzeeweek(void);
|
||||
int yahtzeemonth(void);
|
||||
void clearyahtzeedaily(void);
|
||||
void clearyahtzeeweekly(void);
|
||||
void clearyahtzeemonthly(void);
|
||||
void saveyahtzeedaily(void);
|
||||
void saveyahtzeeweekly(void);
|
||||
void saveyahtzeemonthly(void);
|
||||
void saveyahtzeeoverall(void);
|
171
yahtzeeserv.vcproj
Normal file
171
yahtzeeserv.vcproj
Normal file
|
@ -0,0 +1,171 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="yahtzeeserv"
|
||||
ProjectGUID="{E033ECCE-E55E-43BC-89E7-ABE8AA46CE1F}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\dev\include;..\dev\lib\adnswin32;..\dev\lib\keeper;..\dev\lib\curl;..\dev\lib\pcre;.\libopm"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;yahtzeeserv_EXPORTS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Ws2_32.lib neostats.lib pcred.lib"
|
||||
OutputFile="../dev/modules/yahtzeeservd.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="C:\cygwin\home\Mark\nsdev\dev\lib;..\dev\src\Debug"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/yahtzeeserv.pdb"
|
||||
SubSystem="2"
|
||||
ResourceOnlyDLL="TRUE"
|
||||
ImportLibrary="$(OutDir)/yahtzeeserv.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\dev\include;..\dev\lib\adnswin32;..\dev\lib\keeper;..\dev\lib\curl;..\dev\lib\pcre;.\libopm"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;yahtzeeserv_EXPORTS"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="neostats.lib"
|
||||
OutputFile="../yahtzeeserv.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\dev\src\Release"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
ImportLibrary="$(OutDir)/yahtzeeserv.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</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=".\yahtzeeserv.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\yahtzeeserv_help.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\modconfigwin32.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\yahtzeeserv.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}">
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ChangeLog">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\configure.in">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Makefile.in">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\modconfig.h.in">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Relnotes">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
183
yahtzeeserv_help.c
Normal file
183
yahtzeeserv_help.c
Normal file
|
@ -0,0 +1,183 @@
|
|||
/* YahtzeeServ - Yahtzee Game Service - NeoStats Addon Module
|
||||
** Copyright (c) 2003-2005 DeadNotBuried
|
||||
** Portions Copyright (c) 1999-2005, NeoStats
|
||||
**
|
||||
** 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
|
||||
**
|
||||
** YahtzeeServ CVS Identification
|
||||
** $Id$
|
||||
*/
|
||||
|
||||
#include "neostats.h" /* Required for bot support */
|
||||
#include "yahtzeeserv.h"
|
||||
|
||||
const char *ys_help_set_chan[] = {
|
||||
"\2CHAN <#Channel>\2 - Set Channel Yahtzee Games Play in",
|
||||
NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* Help Text
|
||||
*/
|
||||
const char ys_help_start_oneline[] = "Start a Game in Channel";
|
||||
const char ys_help_stop_oneline[] = "Stops Game";
|
||||
const char ys_help_join_oneline[] = "Join a game currently Starting";
|
||||
const char ys_help_remove_oneline[] = "Remove From Game";
|
||||
const char ys_help_players_oneline[] = "Display Player List In Channel";
|
||||
const char ys_help_turn_oneline[] = "Display Current Player In Channel";
|
||||
const char ys_help_pass_oneline[] = "Passes game to the specified nick";
|
||||
const char ys_help_dice_oneline[] = "Shows your currently rolled dice";
|
||||
const char ys_help_sheet_oneline[] = "Shows yuour current score sheet";
|
||||
const char ys_help_roll_oneline[] = "Rolls the specified Dice, keeping the rest";
|
||||
const char ys_help_keep_oneline[] = "Keeps the specified Dice, and rolld the rest";
|
||||
const char ys_help_score_oneline[] = "Scores to the entry on the score sheet";
|
||||
const char ys_help_top10_oneline[] = "Shows the Top 10 Score Lists in channel";
|
||||
const char ys_help_high_oneline[] = "Displays the Overall High Score Page Selected, In Channel";
|
||||
const char ys_help_rules_oneline[] = "Displays the rules pages";
|
||||
|
||||
const char *ys_help_start[] = {
|
||||
"Syntax: \2START\2",
|
||||
"",
|
||||
"Starts Yahtzee Game in configured Channel.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_stop[] = {
|
||||
"Syntax: \2STOP\2",
|
||||
"",
|
||||
"Stops Currently Running Yahtzee Game.",
|
||||
"Only Available to a Current Player, if",
|
||||
"only one player playing. otherwise players",
|
||||
"should use REMOVE to leave the game.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_join[] = {
|
||||
"Syntax: \2JOIN\2",
|
||||
"",
|
||||
"Joins you to the Currently Starting Game.",
|
||||
"",
|
||||
"NOTE: Joins are allowed once game has",
|
||||
"started, only untill each player has",
|
||||
"scored their first points",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_remove[] = {
|
||||
"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.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_players[] = {
|
||||
"Syntax: \2PLAYERS\2",
|
||||
"",
|
||||
"Displays List of Current Players in channel.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_turn[] = {
|
||||
"Syntax: \2TURN\2",
|
||||
"",
|
||||
"Shows Current Player waiting to roll dice, or score.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_pass[] = {
|
||||
"Syntax: \2PASS\2 <nick>",
|
||||
"",
|
||||
"Passes your game to nick",
|
||||
"nick MUST be connected to the network.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_dice[] = {
|
||||
"Syntax: \2DICE\2",
|
||||
"",
|
||||
"Shows the dice you have currently",
|
||||
"rolled, in channel",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_sheet[] = {
|
||||
"Syntax: \2SHEET\2 <nick>",
|
||||
"",
|
||||
"Shows your current Score Sheet in channel",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_roll[] = {
|
||||
"Syntax: \2ROLL\2 <#> <#> <#> <#> <#>",
|
||||
"",
|
||||
"Rolls the specified Dice",
|
||||
"",
|
||||
"NOTE: Dice are numbered 1 to 5, from left to right",
|
||||
"the position number should be used, not the number showing",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_keep[] = {
|
||||
"Syntax: \2KEEP\2 <#> <#> <#> <#> <#>",
|
||||
"",
|
||||
"Keeps the specified Dice, and rolls the rest",
|
||||
"",
|
||||
"NOTE: Dice are numbered 1 to 5, from left to right",
|
||||
"the position number should be used, not the number showing",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_score[] = {
|
||||
"Syntax: \2SCORE\2 <entry>",
|
||||
"",
|
||||
"Scores to the specified entry on the score sheet",
|
||||
"",
|
||||
"Valid Entires are :",
|
||||
"1 , 2 , 3 , 4 , 5 , 6 , fh",
|
||||
"ss , ls , 3k , 4k , c , y",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_top10[] = {
|
||||
"Syntax: \2TOP10\2 <?>",
|
||||
"",
|
||||
"Displays the Top 10 Score Lists in channel",
|
||||
"",
|
||||
"With no parameters the Top 10 overall is listed.",
|
||||
"\"top10 d\" Lists the Top 10 Scores for the current day",
|
||||
"\"top10 w\" Lists the Top 10 Scores for the current week",
|
||||
"\"top10 m\" Lists the Top 10 Scores for the current month",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_high[] = {
|
||||
"Syntax: \2HIGH\2 <#>",
|
||||
"",
|
||||
"Displays the Overall High Score Page Specified, in Channel",
|
||||
"Valid Pages are numbered from 1 to 5",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ys_help_rules[] = {
|
||||
"Syntax: \2RULES\2 <#>",
|
||||
"",
|
||||
"Displays the selected Rules Page",
|
||||
"Valid page numbers are from 1 to 4",
|
||||
NULL
|
||||
};
|
Reference in a new issue