Recovered from microbel

This commit is contained in:
rot 2025-03-05 08:35:31 +01:00 committed by h7x4
commit 88b92402a8
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
601 changed files with 82177 additions and 0 deletions

1
.cvsignore Normal file

@ -0,0 +1 @@
Makefile .deps config.log config.status config.cache

340
LICENSE Normal file

@ -0,0 +1,340 @@
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.

4
Makefile.am Normal file

@ -0,0 +1,4 @@
SUBDIRS = common client server gos worldsrv util mudworld
## should be BUILD_FILES or something...
CONFIG_CLEAN_FILES = lib/*

329
Makefile.in Normal file

@ -0,0 +1,329 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
CXX = @CXX@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
LEX = @LEX@
MAKEINFO = @MAKEINFO@
NETLIBS = @NETLIBS@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
TIFF_CFLAGS = @TIFF_CFLAGS@
TIFF_LIBS = @TIFF_LIBS@
VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = common client server gos worldsrv util mudworld
CONFIG_CLEAN_FILES = lib/*
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in \
install-sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-recursive
dvi-am:
dvi: dvi-recursive
check-am: all-am
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
install-exec-am:
install-exec: install-exec-recursive
install-data-am:
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am:
uninstall: uninstall-recursive
all-am: Makefile
all-redirect: all-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-tags distclean-generic clean-am
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all installdirs-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

36
README Normal file

@ -0,0 +1,36 @@
PVVMUD a 3D MUD
Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
Introduction
============
PVVMUD is a 3D MUD using the OpenGL API to display a 3D virtual world. The
interact with this world through the pvvmud client program. The world
consist of at least three servers.
Running pvvmud
==============
Start the tree servers: pvvmudsrv, gossrv and worldsrv.
Then start any number of pvvmud clients.
Contributors
============
Anders Reggestad (andersr@pvv.ntnu.no)
- Server code
- Client code
- Geometry code
- Test world modeling
Mathias Mølster Lidal (mathiasm@pvv.ntnu.no)
- Client console code
- Geometry port from c to c++.
Jin Egil Aas-Eng (jine@pvv.ntnu.no)
- Code for starting servers at different hosts
Steinar Hamre (steinarh@pvv.ntnu.no)
- Poll network code
And all the people that have posted to the pvvmud maillist
- Discussion
- Ideas

113
aclocal.m4 vendored Normal file

@ -0,0 +1,113 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "[$]*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
if test "[$]*" != "X $srcdir/configure conftestfile" \
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])
dnl AM_PROG_LEX
dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
AC_DEFUN(AM_PROG_LEX,
[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
AC_PROG_LEX
AC_DECL_YYTEXT])

13
bsdtree/ground_ccity.bsdt Normal file

@ -0,0 +1,13 @@
NODE 0.0 -1.0 0.0 200.0
NODE -1.0 0.0 0.0 200.0
NODE 0.0 1.0 0.0 200.0
NODE 1.0 0.0 0.0 200.0
NODE 0.0 0.0 1.0 0.0
NODE 0.0 0.0 -1.0 300.0
IN
OUT
OUT
OUT
OUT
OUT
OUT

4
client/.cvsignore Normal file

@ -0,0 +1,4 @@
pvvmud
goscache
.pvvmud_history
pvvmudscreen.tex

0
client/.pvvmud.rc Normal file

29
client/.pvvmud_ifm Normal file

@ -0,0 +1,29 @@
playerlook_up key_z
playerlook_down key_a
playerlook_right key_s
playerlook_left key_x
playerlook_forward key_space
playermove_stepleft key_h
playermove_stepbackward key_j
playermove_stepforward key_k
playermove_stepright key_l
usercommand_0 key_0
usercommand_1 key_1
usercommand_2 key_2
usercommand_3 key_3
usercommand_4 key_4
usercommand_5 key_5
usercommand_6 key_6
usercommand_7 key_7
usercommand_8 key_8
usercommand_9 key_9
quit key_escape
toggle_inputmode key_enter
playerlook_forward key_up
playerlook_backward key_down
playerlook_left key_left
playerlook_right key_right
playerlook_up key_page_up
playerlook_down key_page_down
pick mouse_left_up
dump key_d

15
client/Makefile.am Normal file

@ -0,0 +1,15 @@
CC = $(CXX) $(CXXFLAGS)
INCLUDES = -I../common/include -Icoreclient -Irenderer -Igui @X_CFLAGS@ @GL_CFLAGS@ -DPVVMUDCLIENT
SUBDIRS = coreclient renderer gui
CLEANFILES = goscache/*
bin_PROGRAMS = pvvmud
pvvmud_SOURCES = pvvmud.C pvvmudclient.C cliviewpoint.C inputfunction.C inputfunctionmap.C stdinput.C clicmdparser.C
pvvmud_LDADD = coreclient/libcoreclient.a gui/libgui.a renderer/librenderer.a -L../common/lib/gos -lgos -L../common/lib/texture -ltexture -L../common/lib/srvcli -lsrvcli -L../common/lib/geometry -lgeometry -L../common/lib/world -lworld -L../common/lib/utils -lpvvmudutils -lsrvcli -L../common/lib/crypto -lcrypto @TIFF_LIBS@ -ltiff @GL_LIBS@ -lglut -lMesaGLU -lMesaGL @X_LIBS@ -lXi -lXext -lXmu -lXt @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ -lm @NETLIBS@

432
client/Makefile.in Normal file

@ -0,0 +1,432 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CXX = @CXX@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
LEX = @LEX@
MAKEINFO = @MAKEINFO@
NETLIBS = @NETLIBS@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
TIFF_CFLAGS = @TIFF_CFLAGS@
TIFF_LIBS = @TIFF_LIBS@
VERSION = @VERSION@
YACC = @YACC@
CC = $(CXX) $(CXXFLAGS)
INCLUDES = -I../common/include -Icoreclient -Irenderer -Igui @X_CFLAGS@ @GL_CFLAGS@ -DPVVMUDCLIENT
SUBDIRS = coreclient renderer gui
CLEANFILES = goscache/*
bin_PROGRAMS = pvvmud
pvvmud_SOURCES = pvvmud.C pvvmudclient.C cliviewpoint.C inputfunction.C inputfunctionmap.C stdinput.C clicmdparser.C
pvvmud_LDADD = coreclient/libcoreclient.a gui/libgui.a renderer/librenderer.a -L../common/lib/gos -lgos -L../common/lib/texture -ltexture -L../common/lib/srvcli -lsrvcli -L../common/lib/geometry -lgeometry -L../common/lib/world -lworld -L../common/lib/utils -lpvvmudutils -lsrvcli -L../common/lib/crypto -lcrypto @TIFF_LIBS@ -ltiff @GL_LIBS@ -lglut -lMesaGLU -lMesaGL @X_LIBS@ -lXi -lXext -lXmu -lXt @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ -lm @NETLIBS@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
PROGRAMS = $(bin_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
pvvmud_OBJECTS = pvvmud.o pvvmudclient.o cliviewpoint.o inputfunction.o \
inputfunctionmap.o stdinput.o clicmdparser.o
pvvmud_DEPENDENCIES = coreclient/libcoreclient.a gui/libgui.a \
renderer/librenderer.a
pvvmud_LDFLAGS =
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
DEP_FILES = .deps/clicmdparser.P .deps/cliviewpoint.P \
.deps/inputfunction.P .deps/inputfunctionmap.P .deps/pvvmud.P \
.deps/pvvmudclient.P .deps/stdinput.P
SOURCES = $(pvvmud_SOURCES)
OBJECTS = $(pvvmud_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .C .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign client/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-binPROGRAMS:
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
distclean-binPROGRAMS:
maintainer-clean-binPROGRAMS:
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
done
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
pvvmud: $(pvvmud_OBJECTS) $(pvvmud_DEPENDENCIES)
@rm -f pvvmud
$(CXXLINK) $(pvvmud_LDFLAGS) $(pvvmud_OBJECTS) $(pvvmud_LDADD) $(LIBS)
.C.o:
$(CXXCOMPILE) -c $<
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = client
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign client/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
%.o: %.C
@echo '$(CXXCOMPILE) -c $<'; \
$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.C
@echo '$(LTCXXCOMPILE) -c $<'; \
$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
info-am:
info: info-recursive
dvi-am:
dvi: dvi-recursive
check-am: all-am
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
install-exec-am: install-binPROGRAMS
install-exec: install-exec-recursive
install-data-am:
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am: uninstall-binPROGRAMS
uninstall: uninstall-recursive
all-am: Makefile $(PROGRAMS)
all-redirect: all-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(bindir)
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \
clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
distclean-depend distclean-generic clean-am
distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-recursive
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile install-data-recursive \
uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

100
client/clicmdparser.C Normal file

@ -0,0 +1,100 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <string.h>
#include <stdlib.h>
#include "pvvmud.H"
#include "pvvmudclient.H"
CCliCmdParser::CCliCmdParser(CPvvmudClient * client):
CCommandParser()
{
m_client = client;
setCommandPrefix('!');
addCommand("help",(CommandFunc_t)&commandHelp);
addCommand("dump",(CommandFunc_t)&commandDump);
}
CCliCmdParser::~CCliCmdParser(){
}
void CCliCmdParser::printMsg(const string & msg){
m_client->getConsole()->addMsg((char*)msg.c_str());
}
void CCliCmdParser::commandUnknown(const string & commandString){
printMsg("Unkown command: " + commandString + "\n");
}
void CCliCmdParser::commandChat(const string & chatMessage){
m_client->getManager()->sendMsg(chatMessage.c_str());
}
///////////////////////////////////////////////////////////////////////////////
// commandHelp
// Syntax: /help [command]
///////////////////////////////////////////////////////////////////////////////
void CCliCmdParser::commandHelp(argv_t & argv){
if (argv.size() == 2){
if (argv[1] == "help"){
printMsg(
"help [<command>]\n"
" Use this command to get help.\n"
);
} else if (argv[1] == "dump"){
printMsg(
"dump [ screen | world ]\n"
" screen : Dump screen to file \"pvvmudscreen.tif\"\n"
" world : Dump world hiearchy to stdout.\n"
);
} else {
printMsg( "Unkown kommand\n" );
}
} else {
printMsg(
"Help\n"
" Client commands start with '!'\n"
" Commands:\n"
" !help\n"
" !dump\n"
" Use !help <command> for help about a command\n"
);
}
}
///////////////////////////////////////////////////////////////////////////////
// commandDump
///////////////////////////////////////////////////////////////////////////////
void CCliCmdParser::commandDump(argv_t & argv){
if (argv[1] == "screen"){
// m_client->getInputFunction()->executeFunction("capture");
m_client->getInputFunction()->executeFunction("key_c");
} else if (argv[1] == "world"){
// m_client->getInputFunction()->executeFunction("dump");
m_client->getInputFunction()->executeFunction("key_d");
} else {
parseCommand("!help dump");
}
}

45
client/clicmdparser.H Normal file

@ -0,0 +1,45 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLICMDPARSER_H
#define _CLICMDPARSER_H
#include "commandparser.H"
#include "pvvmudclient.H"
class CCliCmdParser : public CCommandParser {
CPvvmudClient * m_client;
public:
CCliCmdParser(CPvvmudClient * client);
virtual ~CCliCmdParser();
private:
void printMsg(const string & msg);
virtual void commandUnknown(const string & commandString);
virtual void commandChat(const string & chatMessage);
void commandHelp(argv_t & argv);
void commandDump(argv_t & argv);
};
#endif // _CLICMDPARSER_H

34
client/client.H Normal file

@ -0,0 +1,34 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIENT_H
#define _CLIENT_H
#include <GL/glut.h>
#include "mudtypes.h"
#include "pvvmud.H"
// #define TEXTURECACHE_USEFILE
#define USE_LOCAL_FILE_CACHE
void save_params();
void mousePick(int x,int y);
#endif // _CLIENT_H

21
client/client.html Normal file

@ -0,0 +1,21 @@
<HTML>
<HEAD>
<TITLE>PVVMUD - client</TITLE>
</HEAD>
<BODY>
<H1>Client</H1>
<P>The PVVMUD client are the user interface for playing PVVMUD.</P>
<H2>Status</H2>
<P>Current version are just a viewer for bog files</P>
<H2>Work to do</H2>
<UL>
<LI>Implement som kind of <A HREF="../doc/scenefileformat.html">scene description</A> format.
<LI>Implement communication with a server. OK Andersr
<LI>Forward user actions to a server. OK Andersr
</UL>
</BODY>
</HTML>

59
client/cliviewpoint.C Normal file

@ -0,0 +1,59 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "client.H"
#include "cliviewpoint.H"
#include "matrix.H"
#include <GL/glut.h>
CCliViewpoint::CCliViewpoint(CCliWorld * world){
m_world = world;
}
void CCliViewpoint::transform(){
CMatrix transform;
CCliObject * target = (CCliObject*)m_world->getObject(getTargetId());
if (target != NULL){
target->getInvGlobalTransform(transform);
}
transform.rotate(-getDirection());
transform.translate(-getPosition());
glMultMatrixd(transform.getVector());
return;
double * pos = getPosition().getVector();
double * dir = getDirection().getVector();
glRotated(-dir[0],0.0,0.0,1.0);
glRotated(-dir[1],0.0,1.0,0.0);
glRotated(-dir[2],1.0,0.0,0.0);
glTranslated(-pos[0],-pos[1],-pos[2]);
}
void CCliViewpoint::setAspectRatio( float aspectRatio ){
this->aspectRatio = aspectRatio;
}

41
client/cliviewpoint.H Normal file

@ -0,0 +1,41 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIVIEWPOINT_H
#define _CLIVIEWPOINT_H
#include "viewpoint.H"
#include "cliworld.H"
class CCliViewpoint: public CViewpoint {
float aspectRatio;
CCliWorld * m_world;
public:
CCliViewpoint(CCliWorld * world);
void transform();
void setAspectRatio( float aspectRatio );
};
#endif // _CLIVIEWPOINT_H

@ -0,0 +1,8 @@
INCLUDES = -I.. -I../renderer -I../gui -I../../common/include @X_CFLAGS@ @GL_CFLAGS@ -DPVVMUDCLIENT
noinst_LIBRARIES = libcoreclient.a
libcoreclient_a_SOURCES = cligos.C cliobject.C \
clisrvmanager.C clisrvmessage.C clisrvprotocol.C \
cliworld.C cliworldmanager.C cliworldmessage.C cliworldprotocol.C \
clientcache.C

@ -0,0 +1,334 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
CXX = @CXX@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
LEX = @LEX@
MAKEINFO = @MAKEINFO@
NETLIBS = @NETLIBS@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
TIFF_CFLAGS = @TIFF_CFLAGS@
TIFF_LIBS = @TIFF_LIBS@
VERSION = @VERSION@
YACC = @YACC@
INCLUDES = -I.. -I../renderer -I../gui -I../../common/include @X_CFLAGS@ @GL_CFLAGS@ -DPVVMUDCLIENT
noinst_LIBRARIES = libcoreclient.a
libcoreclient_a_SOURCES = cligos.C cliobject.C clisrvmanager.C clisrvmessage.C clisrvprotocol.C cliworld.C cliworldmanager.C cliworldmessage.C cliworldprotocol.C clientcache.C
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
libcoreclient_a_LIBADD =
libcoreclient_a_OBJECTS = cligos.o cliobject.o clisrvmanager.o \
clisrvmessage.o clisrvprotocol.o cliworld.o cliworldmanager.o \
cliworldmessage.o cliworldprotocol.o clientcache.o
AR = ar
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
DEP_FILES = .deps/clientcache.P .deps/cligos.P .deps/cliobject.P \
.deps/clisrvmanager.P .deps/clisrvmessage.P .deps/clisrvprotocol.P \
.deps/cliworld.P .deps/cliworldmanager.P .deps/cliworldmessage.P \
.deps/cliworldprotocol.P
SOURCES = $(libcoreclient_a_SOURCES)
OBJECTS = $(libcoreclient_a_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .C .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign client/coreclient/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstLIBRARIES:
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
libcoreclient.a: $(libcoreclient_a_OBJECTS) $(libcoreclient_a_DEPENDENCIES)
-rm -f libcoreclient.a
$(AR) cru libcoreclient.a $(libcoreclient_a_OBJECTS) $(libcoreclient_a_LIBADD)
$(RANLIB) libcoreclient.a
.C.o:
$(CXXCOMPILE) -c $<
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = client/coreclient
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign client/coreclient/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
%.o: %.C
@echo '$(CXXCOMPILE) -c $<'; \
$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.C
@echo '$(LTCXXCOMPILE) -c $<'; \
$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile $(LIBRARIES)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-tags distclean-depend distclean-generic \
clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

@ -0,0 +1,109 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <sys/param.h>
#include "pvvmud.H"
#include "clientcache.H"
#include "clisrvmanager.H"
#include "msggos.H"
CCliGeometryCache::CCliGeometryCache(CCliSrvManager * manager){
m_manager = manager;
}
CObject * CCliGeometryCache::failFunc(int id){
char fileName[MAXPATHLEN];
#ifdef USE_LOCAL_FILE_CACHE
// Load from local cache if file exist
sprintf(fileName,"goscache/%i.bog",id);
FILE * file = fopen(fileName,"r");
if (file != NULL){
CGeometry * geo = m_manager->newGeometry(id);
geo->readBOG(file);
fclose(file);
return geo;
} else {
m_manager->request(GOSREQUEST_GEOMETRY,id);
CCache::add(id,NULL);
}
#else
m_manager->request(GOSREQUEST_GEOMETRY,id);
CCache::add(id,NULL);
#endif // USE_LOCAL_FILE_CACHE
return NULL;
}
CCliMaterialCache::CCliMaterialCache(CCliSrvManager * manager){
m_manager = manager;
}
CObject * CCliMaterialCache::failFunc(int id){
char fileName[MAXPATHLEN];
#ifdef USE_LOCAL_FILE_CACHE
// Load from local cache if file exist
sprintf(fileName,"goscache/%i.bmat",id);
FILE * file = fopen(fileName,"r");
if (file != NULL){
CMaterial * mat = m_manager->newMaterial(id);
mat->load(fileName);
fclose(file);
return mat;
} else {
m_manager->request(GOSREQUEST_MATERIAL,id);
CCache::add(id,NULL);
}
#else
m_manager->request(GOSREQUEST_MATERIAL,id);
CCache::add(id,NULL);
#endif // USE_LOCAL_FILE_CACHE
return NULL;
}
CCliTextureCache::CCliTextureCache(CCliSrvManager * manager){
m_manager = manager;
}
CObject * CCliTextureCache::failFunc(int id){
char fileName[MAXPATHLEN];
#ifdef USE_LOCAL_FILE_CACHE
// Load from local cache if file exist
sprintf(fileName,"goscache/%i.tex",id);
FILE * file = fopen(fileName,"r");
if (file != NULL){
CTexture * tex = m_manager->newTexture(id);
tex->load(fileName);
fclose(file);
return tex;
} else {
m_manager->request(GOSREQUEST_TEXTURE,id);
CCache::add(id,NULL);
}
#else
m_manager->request(GOSREQUEST_TEXTURE,id);
CCache::add(id,NULL);
#endif // USE_LOCAL_FILE_CACHE
return NULL;
}

@ -0,0 +1,50 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIENTCACHE_H
#define _CLIENTCACHE_H
#include "geometry.H"
#include "material.H"
#include "texture.H"
class CCliSrvManager;
class CCliGeometryCache: public CGeometryCache {
CCliSrvManager * m_manager;
public:
CCliGeometryCache(CCliSrvManager * manager);
virtual CObject * failFunc(int id);
};
class CCliMaterialCache: public CMaterialCache {
CCliSrvManager * m_manager;
public:
CCliMaterialCache(CCliSrvManager * manager);
virtual CObject * failFunc(int id);
};
class CCliTextureCache: public CTextureCache {
CCliSrvManager * m_manager;
public:
CCliTextureCache(CCliSrvManager * manager);
virtual CObject * failFunc(int id);
};
#endif // _CLIENTCACHE_H

@ -0,0 +1,67 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include <iostream.h>
#include "cligos.H"
#include "clisrvmanager.H"
#include "glgeometry.H"
#include "glmaterial.H"
#include "gltexture.H"
CCliGOS::CCliGOS(CCliSrvManager * manager,CTimeKeeper * timeKeeper,CInetAddress *GOSAddress):CGOS(timeKeeper,GOSAddress){
this->manager = manager;
}
void CCliGOS::error(){
}
void CCliGOS::geometry(CGeometry * geometry){
manager->addGeometry(geometry);
}
void CCliGOS::material(CMaterial * material){
manager->addMaterial(material);
}
void CCliGOS::texture(CTexture * texture){
manager->addTexture(texture);
}
CGeometry * CCliGOS::newGeometry(int geometryId, int numVertices,
int numNormals, int numTexCoords, int numPolygons){
CGeometry * geo = manager->newGeometry(geometryId);
geo->setSize(numVertices,numNormals,
numTexCoords,numPolygons);
return geo;
// return new CGLGeometry(geometryId,numVertices,numNormals,
// numTexCoords,numPolygons);
}
CMaterial * CCliGOS::newMaterial(int materialId){
return manager->newMaterial(materialId);
// return new CGLMaterial(materialId);
}
CTexture * CCliGOS::newTexture(int textureId){
return manager->newTexture(textureId);
// return new CGLTexture(textureId);
}

@ -0,0 +1,45 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIGOS_H
#define _CLIGOS_H
#include "gos.H"
class CCliSrvManager;
class CCliGOS : public CGOS {
CCliSrvManager * manager;
public:
CCliGOS(CCliSrvManager * manager,CTimeKeeper * timeKeeper,CInetAddress *GOSAddress);
virtual void error();
virtual void geometry(CGeometry * geometry);
virtual void material(CMaterial * material);
virtual void texture(CTexture * texture);
virtual CGeometry * newGeometry(int geometryId, int numVertices,
int numNormals, int numTexCoords, int numPolygons);
virtual CMaterial * newMaterial(int materialId);
virtual CTexture * newTexture(int textureId);
};
#endif // _CLIGOS_H

@ -0,0 +1,69 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include "cliobject.H"
#include "geometry.H"
#include "material.H"
#include "texture.H"
#include "renderer.H"
#include "pvvmudclient.H"
CCliObject::CCliObject(DWORD objectId, CWorldWorld * world, DWORD geometryId,const CPosition & position, const CDirection & direction )
:CWorldObject(objectId,world,geometryId,position,direction){
}
CCliObject::CCliObject(DWORD objectId, CWorldObject * parent, DWORD geometryId,const CPosition & position, const CDirection & direction )
:CWorldObject(objectId,parent,geometryId,position,direction){
}
CListener * CCliObject::getListener(){
return NULL;
}
void CCliObject::draw(CRenderer * renderer){
CGeometryCache * objGeoCache = renderer->getClient()->getGeometryCache();
CTextureCache * materialCache = renderer->getClient()->getTextureCache();
CMaterialCache * textureCache = renderer->getClient()->getMaterialCache();
CGeometry * objGeo = objGeoCache->get( getGeometryId() );
renderer->prepareDraw(this);
renderer->transform(getPosition(), getDirection());
if (objGeo != NULL) objGeo->draw( textureCache, materialCache);
CObjectListItem * item = getFirst();
while (item != NULL){
CCliObject * object = (CCliObject*)item->getObject();
item = item->getNext();
object->draw( renderer );
}
renderer->postDraw();
}

@ -0,0 +1,38 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIOBJECT_H
#define _CLIOBJECT_H
#include "worldobject.H"
#include "renderer.H"
class CCliObject : public CWorldObject {
public:
CCliObject(DWORD objectId, CWorldWorld * world, DWORD geometryId,const CPosition & position, const CDirection & direction );
CCliObject(DWORD objectId, CWorldObject * parent, DWORD geometryId,const CPosition & position, const CDirection & direction );
virtual CListener * getListener();
void draw(CRenderer * renderer);
};
#endif // _CLIOBJECT_H

@ -0,0 +1,302 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "client.H"
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <iostream.h>
#include <netinet/in.h>
#include "socket.H"
#include "clisrvmanager.H"
#include "msgsrvcli.H"
#include "pvvmudclient.H"
#include "glgeometry.H"
#include "glmaterial.H"
#include "gltexture.H"
CCliSrvManager::CCliSrvManager(CCliSrvProtocol * protocol,CTimeKeeper * timeKeeper):CManager(protocol){
m_timeKeeper = timeKeeper;
getProtocol()->setName("Server");
getProtocol()->setManager(this);
m_world = new CCliWorld();
m_viewpoint = new CCliViewpoint(m_world);
m_cligos = NULL;
m_worldsrv = NULL;
}
CCliSrvManager::~CCliSrvManager(){
if (m_world != NULL) delete m_world;
if (m_viewpoint != NULL) delete m_viewpoint;
#ifndef TEXTURECACHE_USEFILE
if (m_cligos != NULL) delete m_cligos;
#endif
}
void CCliSrvManager::setClient(CPvvmudClient * client) {
m_client = client;
}
CPvvmudClient * CCliSrvManager::getClient() {
return m_client;
}
COption * CCliSrvManager::getOption() {
return m_client->getOption();
}
void CCliSrvManager::communicate(){
getProtocol()->readyToRead();
getProtocol()->readyToWrite();
}
void CCliSrvManager::init(){
cdebug << "Client manager init\n";
// createStartFrame();
}
void CCliSrvManager::hello(){
getProtocol()->login(getOption()->getString("username"),
getOption()->getString("passwd"),
FALSE); // This is not a new user!
}
void CCliSrvManager::serverInfo(CInetAddress * worldSrvAddress,CInetAddress * gosAddress){
#ifndef TEXTURECACHE_USEFILE
try {
m_cligos = new CCliGOS(this,m_timeKeeper, gosAddress);
cdebug << "Client GOS manager connected.\n";
} catch (CSocketException * e){
cdebug << "Failed to connect to GOS\n";
m_cligos = NULL;
}
#endif
try {
CClientSocket * socket =
new CClientSocket(worldSrvAddress->getAddress(),worldSrvAddress->getPort());
socket->setNonBlocking();
cdebug << "Client World manager connected.\n";
m_worldsrv =
new CCliWorldManager(this, new CCliWorldProtocol(socket,m_timeKeeper));
} catch (CSocketException * e){
cdebug << "Failed to connect to world server\n";
m_worldsrv = NULL;
}
if (m_cligos != NULL && m_worldsrv != NULL){
// getProtocol()->sendGetWorld();
// deleteStartFrame();
getProtocol()->sendOnline();
} else {
quit();
}
}
void CCliSrvManager::quit(){
getProtocol()->bye();
}
void CCliSrvManager::exit(){
::exit(0);
}
void CCliSrvManager::changeMasterCellId(DWORD newMasterCellId){
m_worldsrv->getProtocol()->sendChangeMasterCell(newMasterCellId);
}
void CCliSrvManager::createStartFrame(){
double trans[3];
trans[0] = 0; trans[1] = 80; trans[2] = 0;
double rot[3];
rot[0] = 90; rot[1] = 0; rot[2] = 0;
// world->addObject(-1,0,0,trans,rot);
}
void CCliSrvManager::deleteStartFrame(){
clearWorld();
}
void CCliSrvManager::animate(){
m_world->animate();
}
void CCliSrvManager::draw(CRenderer * renderer){
m_world->draw(renderer);
}
void CCliSrvManager::updateViewpoint( const CPosition & position,
const CDirection & direction,DWORD targetId ){
m_viewpoint->setPosition( position );
m_viewpoint->setDirection( direction );
m_viewpoint->setTargetId( targetId );
cdebug << "Viewpoint: Target: " << targetId << " Pos: " << position
<< " Dir: " << direction << "\n";
}
void CCliSrvManager::playerMove( int move ){
getProtocol()->sendCommand( move);
}
void CCliSrvManager::playerLook( int look ){
getProtocol()->sendCommand( look);
}
void CCliSrvManager::userCommand(int num){
if ((num >= USERCOMMAND_1) && (num <= USERCOMMAND_5)){
doAction(num - USERCOMMAND_1);
} else {
getProtocol()->sendCommand( num);
}
}
void CCliSrvManager::selection(int objectId){
getProtocol()->sendSelection( objectId );
}
void CCliSrvManager::sendMsg( const char * msg ){
getProtocol()->sendMsg( msg );
}
void CCliSrvManager::sendPing(){
if (m_worldsrv != NULL) m_worldsrv->sendPing();
}
void CCliSrvManager::clearWorld(){
m_world->clearWorld();
}
void CCliSrvManager::doAction(int actionNum){
cdebug << "Do action " << actionNum+1 << " on object "
<< actionObjectId[actionNum] << "\n";
getProtocol()->sendAction(actionObjectId[actionNum],actionNum+1);
}
void CCliSrvManager::addAction(int objectId, CAction * action){
actionObjectId[action->getId()-1] = objectId;
}
int CCliSrvManager::request(int requestType,int requestId){
cdebug << "Request("<<requestType<<") for : " << requestId << "\n";
if (m_cligos != NULL) {
m_cligos->request(requestType,requestId);
return TRUE;
}
return FALSE;
}
void CCliSrvManager::addGeometry(CGeometry * geometry){
CGeometry * geo = getClient()->getGeometryCache()->add(geometry);
if (geo != NULL) delete geo;
cdebug << "Geometry " << geometry->getId() << " loaded\n";
#ifdef USE_LOCAL_FILE_CACHE
DIR * dir = opendir("goscache");
if (dir != NULL){
closedir(dir);
} else {
mkdir("goscache",S_IRWXU);
}
char fileName[256];
sprintf(fileName,"goscache/%i.bog",geometry->getId());
geometry->save(fileName);
#endif // USE_LOCAL_FILE_CACHE
}
void CCliSrvManager::addMaterial(CMaterial * material){
CMaterial * mat = getClient()->getMaterialCache()->add(material);
if (mat != NULL) delete mat;
cdebug << "Material " << material->getId() << " loaded\n";
#ifdef USE_LOCAL_FILE_CACHE
DIR * dir = opendir("goscache");
if (dir != NULL){
closedir(dir);
} else {
mkdir("goscache",S_IRWXU);
}
char fileName[256];
sprintf(fileName,"goscache/%i.bmat",material->getId());
material->save(fileName);
#endif // USE_LOCAL_FILE_CACHE
}
void CCliSrvManager::addTexture(CTexture * texture){
CTexture * tex = getClient()->getTextureCache()->add(texture);
if (tex != NULL) delete tex;
cdebug << "Texture " << texture->getId() << " loaded\n";
#ifdef USE_LOCAL_FILE_CACHE
DIR * dir = opendir("goscache");
if (dir != NULL){
closedir(dir);
} else {
mkdir("goscache",S_IRWXU);
}
char fileName[256];
sprintf(fileName,"goscache/%i.tex",texture->getId());
texture->save(fileName);
#endif // USE_LOCAL_FILE_CACHE
}
void CCliSrvManager::dump(){
m_world->dump();
}
CGeometry * CCliSrvManager::newGeometry(int geometryId){
return new CGLGeometry(geometryId);
}
CMaterial * CCliSrvManager::newMaterial(int materialId){
return new CGLMaterial(materialId);
}
CTexture * CCliSrvManager::newTexture(int textureId){
return new CGLTexture(textureId);
}

@ -0,0 +1,101 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLISRVMANAGER_H
#define _CLISRVMANAGER_H
#include "clisrvprotocol.H"
#include "cliworld.H"
#include "cliviewpoint.H"
#include "action.H"
#include "manager.H"
#include "cligos.H"
#include "cliworldmanager.H"
#include "option.H"
class CPvvmudClient;
class CCliSrvManager: public CManager {
CCliWorld * m_world;
CCliViewpoint * m_viewpoint;
CCliGOS * m_cligos;
CCliWorldManager * m_worldsrv;
CPvvmudClient * m_client;
// Action list
int actionObjectId[5];
CTimeKeeper * m_timeKeeper;
public:
CCliSrvManager(CCliSrvProtocol * protocol,CTimeKeeper * timeKeeper);
virtual ~CCliSrvManager();
CCliSrvProtocol * getProtocol(){ return (CCliSrvProtocol*)CManager::getCommunicate();}
CCliWorld* getWorld(){ return m_world; }
void setClient(CPvvmudClient * client);
CPvvmudClient * getClient();
COption * getOption();
void communicate();
void init();
void hello();
void serverInfo(CInetAddress * worldSrvAddress,CInetAddress * gosAddress);
void quit();
void exit();
void changeMasterCellId(DWORD newMasterCellId);
void createStartFrame();
void deleteStartFrame();
void animate();
void draw(CRenderer * renderer);
void updateViewpoint( const CPosition & position,
const CDirection & direction,
DWORD targetId);
void playerMove( int move );
void playerLook( int look );
void userCommand(int num);
void selection( int objectId );
void sendMsg( const char * msg );
void sendPing();
void clearWorld();
void doAction(int actionNum);
void addAction(int objectId,CAction * action);
CCliViewpoint * getViewpoint(){ return m_viewpoint; }
int request(int requestType,int requestId);
void addGeometry(CGeometry * geometry);
void addMaterial(CMaterial * material);
void addTexture(CTexture * texture);
void dump();
virtual CGeometry * newGeometry(int geometryId);
virtual CMaterial * newMaterial(int materialId);
virtual CTexture * newTexture(int textureId);
};
#endif // _CLISRVMANAGER_H

@ -0,0 +1,309 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include <stdio.h>
#include <stdlib.h>
#include "client.H"
#include "clisrvmessage.H"
#include "clisrvmanager.H"
///////////////////////////////////////////////////////////////////////////////
//
// CMsgHelloCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgHelloCli::CMsgHelloCli():CMsgHello(){
}
CMsgHelloCli * CMsgHelloCli::createMsg(){
return new CMsgHelloCli();
}
int CMsgHelloCli::executeMsg(){
cdebug << "Hello from server!\n";
CCliSrvManager * manager = (CCliSrvManager*)getManager();
if (getVersion() != PROTOCOL_VERSION){
cdebug << "ERROR: Wrong protocol version!\n";
exit(2);
}
manager->hello();
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgServerInfoCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgServerInfoCli::CMsgServerInfoCli():CMsgServerInfo(){
}
CMsgServerInfoCli * CMsgServerInfoCli::createMsg(){
return new CMsgServerInfoCli();
}
int CMsgServerInfoCli::executeMsg(){
CInetAddress * worldSrvAddress, * gosAddress;
worldSrvAddress = getWorldSrvAddress();
gosAddress = getGOSAddress();
cdebug << "Server info: WorldSrv" << worldSrvAddress->getAddressString() << "GOS" << worldSrvAddress->getAddressString() << " world " << gosAddress->getAddressString() << "\n";
CCliSrvManager * manager = (CCliSrvManager*)getManager();
manager->serverInfo(worldSrvAddress,gosAddress);
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgByeCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgByeCli::CMsgByeCli():CMsgBye(){
}
CMsgByeCli * CMsgByeCli::createMsg(){
return new CMsgByeCli();
}
int CMsgByeCli::executeMsg(){
cout << "Bye from server: " << getReasonString(getReason()) << "\n";
CCliSrvManager * manager = (CCliSrvManager*)getManager();
manager->exit();
return TRUE;
}
/*
///////////////////////////////////////////////////////////////////////////////
//
// CMsgGeometryObjectCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgGeometryObjectCli::CMsgGeometryObjectCli():CMsgGeometryObject(){
}
CMsgGeometryObjectCli * CMsgGeometryObjectCli::createMsg(){
return new CMsgGeometryObjectCli();
}
int CMsgGeometryObjectCli::executeMsg(){
double pos[3],dir[3];
cdebug << "New geometryobject(" << getWorldObjectId() << ") from server with geometry(" << getGeometryId() << ") and parent(" << getParentId() << ")!\n",
getPosition(pos);
getDirection(dir);
cdebug ("Pos: %f %f %f Dir: %f %f %f\n",pos[0],pos[1],pos[2],dir[0],dir[1],dir[2]);
CCliSrvManager * manager = (CCliSrvManager*)getManager();
manager->addWorldObject(getParentId(),getWorldObjectId(),
getGeometryId(),pos,dir);
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgGeoObjRemoveCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgGeoObjRemoveCli::CMsgGeoObjRemoveCli():CMsgGeoObjRemove(){
}
CMsgGeoObjRemoveCli * CMsgGeoObjRemoveCli::createMsg(){
return new CMsgGeoObjRemoveCli();
}
int CMsgGeoObjRemoveCli::executeMsg(){
cdebug("Remove geometryobject(%i) from parent(%i)\n",getWorldObjectId(),
getParentId());
CCliSrvManager * manager = (CCliSrvManager*)getManager();
manager->removeWorldObject(getWorldObjectId(),getParentId());
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgUpdatePosition
//
///////////////////////////////////////////////////////////////////////////////
CMsgUpdatePositionCli::CMsgUpdatePositionCli():CMsgUpdatePosition(){
}
CMsgUpdatePositionCli * CMsgUpdatePositionCli::createMsg(){
return new CMsgUpdatePositionCli();
}
int CMsgUpdatePositionCli::executeMsg(){
double pos[3];
CCliSrvManager * manager = (CCliSrvManager*)getManager();
getPosition(pos);
manager->updatePosition(getWorldObjectId(),pos);
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgUpdateDirection
//
///////////////////////////////////////////////////////////////////////////////
CMsgUpdateDirectionCli::CMsgUpdateDirectionCli():CMsgUpdateDirection(){
}
CMsgUpdateDirectionCli * CMsgUpdateDirectionCli::createMsg(){
return new CMsgUpdateDirectionCli();
}
int CMsgUpdateDirectionCli::executeMsg(){
double dir[3];
CCliSrvManager * manager = (CCliSrvManager*)getManager();
getDirection(dir);
manager->updateDirection(getWorldObjectId(),dir);
return TRUE;
}
*/
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCommand
//
///////////////////////////////////////////////////////////////////////////////
CMsgCommandCli::CMsgCommandCli():CMsgCommand(){
}
CMsgCommandCli * CMsgCommandCli::createMsg(){
return new CMsgCommandCli();
}
int CMsgCommandCli::executeMsg(){
CCliSrvManager * manager = (CCliSrvManager*)getManager();
switch(getCommand()){
case MSGCOMMAND_CLIENTCLEARWORLD:
cdebug << "MsgCommand: Clear world\n";
manager->clearWorld();
break;
}
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgViewpointCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgViewpointCli::CMsgViewpointCli():CMsgViewpoint(){
}
CMsgViewpointCli * CMsgViewpointCli::createMsg(){
return new CMsgViewpointCli();
}
int CMsgViewpointCli::executeMsg(){
CPosition pos; CDirection dir;
CCliSrvManager * manager = (CCliSrvManager*)getManager();
getPosition(pos); getDirection(dir);
manager->updateViewpoint(pos,dir,getTargetId());
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgMsgCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgMsgCli::CMsgMsgCli():CMsgMsg(){
}
CMsgMsgCli * CMsgMsgCli::createMsg(){
return new CMsgMsgCli();
}
int CMsgMsgCli::executeMsg(){
char * msg = (char*)malloc(getMsgLength());
getMsg(msg);
CCliSrvManager * manager = (CCliSrvManager*)getManager();
manager->getClient()->getConsole()->addMsg(msg);
cdebug << "MSG: " << msg << "\n";
free(msg);
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgActionListCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgActionListCli::CMsgActionListCli():CMsgActionList(){
}
CMsgActionListCli * CMsgActionListCli::createMsg(){
return new CMsgActionListCli();
}
int CMsgActionListCli::executeMsg(){
CCliSrvManager * manager = (CCliSrvManager*)getManager();
cdebug << "Action list for object: " << getObjectId() << "\n";
CObjectListItem * item = getActionList()->getFirst();
while (item != NULL){
CAction * action = (CAction*)item->getObject();
cdebug << "Action: " << action->getId() << " " << action->getName() << "\n";
manager->addAction(getObjectId(),action);
item = item->getNext();
}
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgPlayerInfoCli
//
///////////////////////////////////////////////////////////////////////////////
CMsgPlayerInfoCli::CMsgPlayerInfoCli():CMsgPlayerInfo(){
}
CMsgPlayerInfoCli * CMsgPlayerInfoCli::createMsg(){
return new CMsgPlayerInfoCli();
}
int CMsgPlayerInfoCli::executeMsg(){
CCliSrvManager * manager = (CCliSrvManager*)getManager();
cdebug << "Player info with mastercell : " << getMasterCellId() << "\n",
manager->changeMasterCellId(getMasterCellId());
return TRUE;
}

@ -0,0 +1,115 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLISRVMESSAGE_H
#define _CLISRVMESSAGE_H
#include "msgsrvcli.H"
#include "msgworld.H"
#include "msgmsg.H"
#include "msgactionlist.H"
#include "pvvmudclient.H"
class CMsgHelloCli: public CMsgHello {
public:
CMsgHelloCli();
static CMsgHelloCli * createMsg();
virtual int executeMsg();
};
class CMsgServerInfoCli: public CMsgServerInfo {
public:
CMsgServerInfoCli();
static CMsgServerInfoCli * createMsg();
virtual int executeMsg();
};
class CMsgByeCli: public CMsgBye {
public:
CMsgByeCli();
static CMsgByeCli * createMsg();
virtual int executeMsg();
};
//class CMsgGeometryObjectCli: public CMsgGeometryObject {
//public:
// CMsgGeometryObjectCli();
// static CMsgGeometryObjectCli * createMsg();
// virtual int executeMsg();
//};
//class CMsgGeoObjRemoveCli: public CMsgGeoObjRemove {
//public:
// CMsgGeoObjRemoveCli();
// static CMsgGeoObjRemoveCli * createMsg();
// virtual int executeMsg();
//};
//class CMsgUpdatePositionCli: public CMsgUpdatePosition {
//public:
// CMsgUpdatePositionCli();
// static CMsgUpdatePositionCli * createMsg();
// virtual int executeMsg();
//};
//class CMsgUpdateDirectionCli: public CMsgUpdateDirection {
//public:
// CMsgUpdateDirectionCli();
// static CMsgUpdateDirectionCli * createMsg();
// virtual int executeMsg();
//};
class CMsgCommandCli: public CMsgCommand {
public:
CMsgCommandCli();
static CMsgCommandCli * createMsg();
virtual int executeMsg();
};
class CMsgViewpointCli: public CMsgViewpoint {
public:
CMsgViewpointCli();
static CMsgViewpointCli * createMsg();
virtual int executeMsg();
};
class CMsgMsgCli: public CMsgMsg {
public:
CMsgMsgCli();
static CMsgMsgCli * createMsg();
virtual int executeMsg();
};
class CMsgActionListCli: public CMsgActionList {
public:
CMsgActionListCli();
static CMsgActionListCli * createMsg();
virtual int executeMsg();
};
class CMsgPlayerInfoCli: public CMsgPlayerInfo {
public:
CMsgPlayerInfoCli();
static CMsgPlayerInfoCli * createMsg();
virtual int executeMsg();
};
#endif // _CLISRVMESSAGE_H

@ -0,0 +1,75 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include "clisrvprotocol.H"
#include "clisrvmessage.H"
CCliSrvProtocol::CCliSrvProtocol(CSocket * socket,CTimeKeeper * timeKeeper)
:CCommunicate(socket,timeKeeper){
addMsg((MsgCreateFunc_t)CMsgHelloCli::createMsg);
addMsg((MsgCreateFunc_t)CMsgByeCli::createMsg);
addMsg((MsgCreateFunc_t)CMsgCommandCli::createMsg);
addMsg((MsgCreateFunc_t)CMsgViewpointCli::createMsg);
addMsg((MsgCreateFunc_t)CMsgMsgCli::createMsg);
addMsg((MsgCreateFunc_t)CMsgActionListCli::createMsg);
addMsg((MsgCreateFunc_t)CMsgServerInfoCli::createMsg);
addMsg((MsgCreateFunc_t)CMsgPlayerInfoCli::createMsg);
}
void CCliSrvProtocol::login(char * name, char * passwd,BOOL newUser){
CMsgLogin * msg = new CMsgLogin(name,passwd,newUser);
sendMessage(msg,TRUE);
}
void CCliSrvProtocol::bye(){
CMsgBye * msg = new CMsgBye();
sendMessage(msg,TRUE);
}
void CCliSrvProtocol::sendOnline(){
CMsgCommand * msg = new CMsgCommand(MSGCOMMAND_ONLINE);
sendMessage(msg,TRUE);
}
void CCliSrvProtocol::sendGetWorld(){
CMsgGetWorld * msg = new CMsgGetWorld();
sendMessage(msg,TRUE);
}
void CCliSrvProtocol::sendCommand(int command){
CMsgCommand * msg = new CMsgCommand(command);
sendMessage(msg,TRUE);
}
void CCliSrvProtocol::sendSelection(int objectId){
CMsgSelection * msg = new CMsgSelection(objectId);
sendMessage(msg,TRUE);
}
void CCliSrvProtocol::sendAction(int objectId,int actionId){
CMsgAction * msg = new CMsgAction(objectId,actionId);
sendMessage(msg,TRUE);
}
void CCliSrvProtocol::sendMsg(const char *msg){
CMsgMsg * msgmsg = new CMsgMsg(msg);
sendMessage(msgmsg,TRUE);
}

@ -0,0 +1,41 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLISRVPROTOCOL_H
#define _CLISRVPROTOCOL_H
#include "communicate.H"
#include "socket.H"
class CCliSrvProtocol : public CCommunicate {
public:
CCliSrvProtocol(CSocket * socket,CTimeKeeper * timeKeeper);
void login(char * name, char * passwd, BOOL newUser);
void bye();
void sendOnline();
void sendGetWorld();
void sendCommand(int command);
void sendSelection(int objectId);
void sendAction(int objectId,int actionId);
void sendMsg(const char * msg);
};
#endif // _CLISRVPROTOCOL_H

@ -0,0 +1,52 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include "cliworld.H"
CCliWorld::CCliWorld(){
}
CListener * CCliWorld::getListener(){
return NULL;
}
CCliObject * CCliWorld::newObject(char * name, DWORD objectId,
CWorldObject * parent, DWORD geometryId,
const CPosition & position, const CDirection & direction )
{
if (parent == NULL){
return new CCliObject(objectId,this,geometryId,position,direction);
}
return new CCliObject(objectId,parent,geometryId,position,direction);
}
void CCliWorld::draw(CRenderer * renderer){
CObjectListItem * item = getFirst();
while (item != NULL){
CCliObject * cell = (CCliObject*)item->getObject();
item = item->getNext();
cell->draw( renderer );
}
}

@ -0,0 +1,39 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIWORLD_H
#define _CLIWORLD_H
#include "worldworld.H"
#include "cliobject.H"
#include "renderer.H"
class CCliWorld : public CWorldWorld {
public:
CCliWorld();
virtual CCliObject * newObject(char * name,DWORD objectId, CWorldObject * parent, DWORD geometryId,const CPosition & position, const CDirection & direction );
virtual CListener * getListener();
void draw(CRenderer * renderer);
};
#endif // _CLIWORLD_H

@ -0,0 +1,92 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "client.H"
#include <iostream.h>
#include "cliworldmanager.H"
#include "clisrvmanager.H"
#include "msgsrvcli.H"
CCliWorldManager::CCliWorldManager(CCliSrvManager * client, CCliWorldProtocol * protocol):CManager(protocol){
m_client = client;
getProtocol()->setName("World");
m_pingPong = new CPingPong(MAXPINGPONG);
m_pingCounter = 0;
m_pingCounterMax = 0;
}
CCliWorldManager::~CCliWorldManager(){
delete m_pingPong;
}
CCliWorldProtocol * CCliWorldManager::getProtocol(){
return (CCliWorldProtocol*)CManager::getCommunicate();
}
CCliWorld * CCliWorldManager::getWorld(){
return m_client->getWorld();
}
void CCliWorldManager::quit(){
cdebug << "Connection to world server lost!\n";
}
void CCliWorldManager::hello(){
cdebug << "Hello from world server!\n";
}
void CCliWorldManager::sendPing(){
m_pingCounter++;
if (m_pingCounter > m_pingCounterMax){
if (m_pingCounterMax < MAXPINGPONG)
m_pingCounterMax = m_pingCounter;
m_pingCounter = 0;
DWORD sendTime = getWorld()->getTime();
BYTE sequenceNumber = m_pingPong->sendPing(sendTime);
cout << "PING: " << (int)sequenceNumber
<< " time " << sendTime << endl;
CCliWorldProtocol * protocol = getProtocol();
protocol->sendMessage(new CMsgPing( sequenceNumber ),TRUE);
}
}
void CCliWorldManager::pong(BYTE sequenceNumber, DWORD serverTime){
DWORD reciveTime = getWorld()->getTime();
long timediff = m_pingPong->recivePong(reciveTime,sequenceNumber,serverTime);
cout << "PONG: sequence number " << (int)sequenceNumber
<< " serverTime " << serverTime
<< " recive time " << reciveTime
<< " time diff " << timediff << endl;
cout << "Ping info " << *m_pingPong << endl;
getWorld()->fixTime(timediff);
}

@ -0,0 +1,56 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIWORLDMANAGER_H
#define _CLIWORLDMANAGER_H
#include "manager.H"
#include "cliworldprotocol.H"
#include "cliworld.H"
#include "pingpong.H"
class CCliSrvManager;
class CCliWorldManager : public CManager {
CCliSrvManager * m_client;
CPingPong * m_pingPong;
int m_pingCounter;
int m_pingCounterMax;
public:
CCliWorldManager(CCliSrvManager * client, CCliWorldProtocol * protocol);
virtual ~CCliWorldManager();
CCliWorldProtocol * getProtocol();
CCliWorld * getWorld();
virtual void quit();
void hello();
void sendPing();
void pong(BYTE sequenceNumber, DWORD serverTime);
};
#endif // _CLIWORLDMANAGER_H

@ -0,0 +1,234 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include <iostream.h>
#include "cliworldmessage.H"
#include "cliworldmanager.H"
CMsgCliWorldHello::CMsgCliWorldHello():CMsgHello(){
}
CMsgCliWorldHello * CMsgCliWorldHello::createMsg(){
return new CMsgCliWorldHello();
}
int CMsgCliWorldHello::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
if (getVersion() != PROTOCOL_VERSION){
cdebug << "ERROR: Wrong protocol version!\n";
exit(2);
}
manager->hello();
return TRUE;
}
/*
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldCell
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldCell::CMsgCliWorldCell():CMsgCell(){
}
CMsgCliWorldCell * CMsgCliWorldCell::createMsg(){
return new CMsgCliWorldCell();
}
int CMsgCliWorldCell::executeMsg(){
cdebug << "Cell " << getCellId() << " with geometry " << getGeometryId()
<< " with position " << getPosition() <<"\n";
CCliWorldManager * manager = (CCliWorldManager*)getManager();
CWorldObject * cell = manager->getWorld()->addCell(getCellId(),getGeometryId());
cell->setPosition(getPosition());
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldRemoveCell
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldRemoveCell::CMsgCliWorldRemoveCell():CMsgRemoveCell(){
}
CMsgCliWorldRemoveCell * CMsgCliWorldRemoveCell::createMsg(){
return new CMsgCliWorldRemoveCell();
}
int CMsgCliWorldRemoveCell::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
manager->getWorld()->removeCell(getCellId());
return TRUE;
}
*/
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldObject
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldObject::CMsgCliWorldObject():CMsgObject(){
}
CMsgCliWorldObject * CMsgCliWorldObject::createMsg(){
return new CMsgCliWorldObject();
}
int CMsgCliWorldObject::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
cdebug << "Object " << getObjectId() << " with parent " << getParentId() << " with geometry " << getGeometryId()
<< " with position " << getPosition() <<" with direction " << getDirection() << "\n";
if (manager->getWorld()->createObject(getParentId(),"object",getObjectId(),
getGeometryId(),getPosition(),
getDirection())==NULL){
cdebug << "Failed to create object " << getObjectId() << "\n";
}
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldRemoveObject
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldRemoveObject::CMsgCliWorldRemoveObject():CMsgRemoveObject(){
}
CMsgCliWorldRemoveObject * CMsgCliWorldRemoveObject::createMsg(){
return new CMsgCliWorldRemoveObject();
}
int CMsgCliWorldRemoveObject::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
cdebug << "REMOVE : Object: " << getObjectId() << " Parent: " << getParentId() << "\n";
manager->getWorld()->removeObject(getObjectId(),getParentId());
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldUpdatePosition
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldUpdatePosition::CMsgCliWorldUpdatePosition():CMsgUpdatePosition(){
}
CMsgCliWorldUpdatePosition * CMsgCliWorldUpdatePosition::createMsg(){
return new CMsgCliWorldUpdatePosition();
}
int CMsgCliWorldUpdatePosition::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
manager->getWorld()->updatePosition(getObjectId(),getPosition());
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldUpdateDirection
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldUpdateDirection::CMsgCliWorldUpdateDirection():CMsgUpdateDirection(){
}
CMsgCliWorldUpdateDirection * CMsgCliWorldUpdateDirection::createMsg(){
return new CMsgCliWorldUpdateDirection();
}
int CMsgCliWorldUpdateDirection::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
manager->getWorld()->updateDirection(getObjectId(),getDirection());
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldUpdateHierarchy
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldUpdateHierarchy::CMsgCliWorldUpdateHierarchy():CMsgUpdateHierarchy(){
}
CMsgCliWorldUpdateHierarchy * CMsgCliWorldUpdateHierarchy::createMsg(){
return new CMsgCliWorldUpdateHierarchy();
}
int CMsgCliWorldUpdateHierarchy::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
manager->getWorld()->updateHierarchy(getObjectId(),getParentId());
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldPong
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldPong::CMsgCliWorldPong():CMsgPong(){
}
CMsgCliWorldPong * CMsgCliWorldPong::createMsg(){
return new CMsgCliWorldPong();
}
int CMsgCliWorldPong::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
manager->pong(getSequenceNumber(),getServerTime());
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//
// CMsgCliWorldRotate
//
///////////////////////////////////////////////////////////////////////////////
CMsgCliWorldRotate::CMsgCliWorldRotate():CMsgRotate(){
}
CMsgCliWorldRotate * CMsgCliWorldRotate::createMsg(){
return new CMsgCliWorldRotate();
}
int CMsgCliWorldRotate::executeMsg(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
manager->getWorld()->rotate(getObjectId(),getAngleSpeed());
return TRUE;
}

@ -0,0 +1,100 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIWORLDMESSAGE_H
#define _CLIWORLDMESSAGE_H
#include "msgsrvcli.H"
#include "msgworld.H"
class CMsgCliWorldHello : public CMsgHello {
public:
CMsgCliWorldHello();
static CMsgCliWorldHello * createMsg();
virtual int executeMsg();
};
/*
class CMsgCliWorldCell : public CMsgCell {
public:
CMsgCliWorldCell();
static CMsgCliWorldCell * createMsg();
virtual int executeMsg();
};
class CMsgCliWorldRemoveCell : public CMsgRemoveCell {
public:
CMsgCliWorldRemoveCell();
static CMsgCliWorldRemoveCell * createMsg();
virtual int executeMsg();
};
*/
class CMsgCliWorldObject : public CMsgObject {
public:
CMsgCliWorldObject();
static CMsgCliWorldObject * createMsg();
virtual int executeMsg();
};
class CMsgCliWorldRemoveObject : public CMsgRemoveObject {
public:
CMsgCliWorldRemoveObject();
static CMsgCliWorldRemoveObject * createMsg();
virtual int executeMsg();
};
class CMsgCliWorldUpdatePosition: public CMsgUpdatePosition {
public:
CMsgCliWorldUpdatePosition();
static CMsgCliWorldUpdatePosition * createMsg();
virtual int executeMsg();
};
class CMsgCliWorldUpdateDirection: public CMsgUpdateDirection {
public:
CMsgCliWorldUpdateDirection();
static CMsgCliWorldUpdateDirection * createMsg();
virtual int executeMsg();
};
class CMsgCliWorldUpdateHierarchy: public CMsgUpdateHierarchy {
public:
CMsgCliWorldUpdateHierarchy();
static CMsgCliWorldUpdateHierarchy * createMsg();
virtual int executeMsg();
};
class CMsgCliWorldPong: public CMsgPong {
public:
CMsgCliWorldPong();
static CMsgCliWorldPong * createMsg();
virtual int executeMsg();
};
class CMsgCliWorldRotate: public CMsgRotate {
public:
CMsgCliWorldRotate();
static CMsgCliWorldRotate * createMsg();
virtual int executeMsg();
};
#endif // _CLIWORLDMESSAGE_H

@ -0,0 +1,49 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "client.H"
#include "cliworldprotocol.H"
#include "cliworldmanager.H"
#include "cliworldmessage.H"
#include "msgworld.H"
CCliWorldProtocol::CCliWorldProtocol(CSocket * socket, CTimeKeeper * timeKeeper):CCommunicate(socket,timeKeeper){
addMsg((MsgCreateFunc_t)CMsgCliWorldHello::createMsg);
// addMsg((MsgCreateFunc_t)CMsgCliWorldCell::createMsg);
// addMsg((MsgCreateFunc_t)CMsgCliWorldRemoveCell::createMsg);
addMsg((MsgCreateFunc_t)CMsgCliWorldObject::createMsg);
addMsg((MsgCreateFunc_t)CMsgCliWorldRemoveObject::createMsg);
addMsg((MsgCreateFunc_t)CMsgCliWorldUpdatePosition::createMsg);
addMsg((MsgCreateFunc_t)CMsgCliWorldUpdateDirection::createMsg);
addMsg((MsgCreateFunc_t)CMsgCliWorldUpdateHierarchy::createMsg);
addMsg((MsgCreateFunc_t)CMsgCliWorldPong::createMsg);
addMsg((MsgCreateFunc_t)CMsgCliWorldRotate::createMsg);
}
void CCliWorldProtocol::quit(){
CCliWorldManager * manager = (CCliWorldManager*)getManager();
manager->quit();
}
void CCliWorldProtocol::sendChangeMasterCell(DWORD newMasterCellId){
CMsgChangeMasterCell * msg = new CMsgChangeMasterCell(newMasterCellId);
sendMessage(msg,TRUE);
}

@ -0,0 +1,37 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CLIWORLDPROTOCOL_H
#define _CLIWORLDPROTOCOL_H
#include "communicate.H"
class CCliWorldProtocol : public CCommunicate {
public:
CCliWorldProtocol(CSocket * socket, CTimeKeeper * timeKeeper);
virtual void quit();
// Messages
void sendChangeMasterCell(DWORD newMasterCellId);
};
#endif // _CLIWORLDPROTOCOL_H

5
client/gui/Makefile.am Normal file

@ -0,0 +1,5 @@
INCLUDES = -I.. -I../renderer -I../coreclient -I../../common/include @X_CFLAGS@ @GL_CFLAGS@ -DPVVMUDCLIENT
noinst_LIBRARIES = libgui.a
libgui_a_SOURCES = glutgui.C gui.C

328
client/gui/Makefile.in Normal file

@ -0,0 +1,328 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
CXX = @CXX@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
LEX = @LEX@
MAKEINFO = @MAKEINFO@
NETLIBS = @NETLIBS@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
TIFF_CFLAGS = @TIFF_CFLAGS@
TIFF_LIBS = @TIFF_LIBS@
VERSION = @VERSION@
YACC = @YACC@
INCLUDES = -I.. -I../renderer -I../coreclient -I../../common/include @X_CFLAGS@ @GL_CFLAGS@ -DPVVMUDCLIENT
noinst_LIBRARIES = libgui.a
libgui_a_SOURCES = glutgui.C gui.C
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
libgui_a_LIBADD =
libgui_a_OBJECTS = glutgui.o gui.o
AR = ar
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
DEP_FILES = .deps/glutgui.P .deps/gui.P
SOURCES = $(libgui_a_SOURCES)
OBJECTS = $(libgui_a_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .C .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign client/gui/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstLIBRARIES:
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
libgui.a: $(libgui_a_OBJECTS) $(libgui_a_DEPENDENCIES)
-rm -f libgui.a
$(AR) cru libgui.a $(libgui_a_OBJECTS) $(libgui_a_LIBADD)
$(RANLIB) libgui.a
.C.o:
$(CXXCOMPILE) -c $<
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = client/gui
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign client/gui/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
%.o: %.C
@echo '$(CXXCOMPILE) -c $<'; \
$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.C
@echo '$(LTCXXCOMPILE) -c $<'; \
$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile $(LIBRARIES)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-tags distclean-depend distclean-generic \
clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

103
client/gui/glutgui.C Normal file

@ -0,0 +1,103 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include "glutgui.H"
#include "glrenderer.H"
#include "pvvmudclient.H"
CGlutGUI * CGlutGUI::m_glutgui = NULL;
void glutgui_display(){
CGlutGUI::m_glutgui->display();
}
void glutgui_idle() {
CGlutGUI::m_glutgui->idle();
}
void glutgui_reshape(int height, int width){
CGlutGUI::m_glutgui->reshape(height,width);
}
void glutgui_visible(int vis) {
CGlutGUI::m_glutgui->visible(vis);
}
void glutgui_key(unsigned char k, int x, int y) {
CGlutGUI::m_glutgui->getClient()->getInputFunction()->key(k, x, y);
}
void glutgui_special(int k, int x, int y) {
CGlutGUI::m_glutgui->getClient()->getInputFunction()->special(k, x, y);
}
void glutgui_mouse(int button, int state, int x, int y) {
CGlutGUI::m_glutgui->getClient()->getInputFunction()->mouse(button, state, x, y);
}
CGlutGUI::CGlutGUI(int argc, char * argv[], CRenderer * r, CPvvmudClient * cli, int width, int height) : CGUI(r, cli, width, height) {
m_glutgui = this;
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH );
glutInitWindowSize(width, height);
glutCreateWindow("PVVMUD");
glutDisplayFunc(glutgui_display);
glutReshapeFunc(glutgui_reshape);
glutVisibilityFunc(glutgui_visible);
glutKeyboardFunc(glutgui_key);
glutSpecialFunc(glutgui_special);
glutMouseFunc(glutgui_mouse);
}
//int * CGlutGUI::getSize() {}
void CGlutGUI::display() {
((COGLRenderer*)getRenderer())->setMode(GL_RENDER);
getRenderer()->draw();
glutSwapBuffers();
}
void CGlutGUI::idle() {
// manager->communicate();
getClient()->getTimeKeeper()->poll(0);
getClient()->pollConsole();
glutPostRedisplay();
}
void CGlutGUI::visible(int vis) {
if (vis == GLUT_VISIBLE)
glutIdleFunc(glutgui_idle);
else
glutIdleFunc(NULL);
}
void CGlutGUI::reshape(int width, int height) {
getRenderer()->reshape(width, height);
}
void CGlutGUI::run() {
glutMainLoop();
}

42
client/gui/glutgui.H Normal file

@ -0,0 +1,42 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GLUTGUI_H
#define _GLUTGUI_H
#include <GL/glut.h>
#include "gui.H"
class CGlutGUI : public CGUI {
public:
static CGlutGUI * m_glutgui;
CGlutGUI(int argc, char * argv[], CRenderer * r, CPvvmudClient * cli, int width, int height);
~CGlutGUI() {}
virtual void reshape(int height, int width);
void display();
void idle();
void visible(int vis);
void key(unsigned char k, int x, int y);
void special(int k, int x, int y);
void mouse(int button, int state, int x, int y);
virtual void run();
void start();
};
#endif // _GLUTGUI_H

66
client/gui/gui.C Normal file

@ -0,0 +1,66 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <iostream.h>
#include "pvvmud.H"
#include "gui.H"
CGUI::CGUI(CRenderer * r, CPvvmudClient * cli, int width, int height) {
m_width = width;
m_height = height;
m_renderer = r;
m_client = cli;
}
CGUI::~CGUI(){
}
CRenderer * CGUI::getRenderer() {
return m_renderer;
}
void CGUI::setRenderer(CRenderer * r) {
m_renderer = r;
}
CPvvmudClient *CGUI::getClient() {
return m_client;
}
int CGUI::getWidth() {
return m_width;
}
int CGUI::getHeight() {
return m_height;
}
void CGUI::setWidth(int width) {
m_width = width;
}
void CGUI::setHeight(int height) {
m_height = height;
}
void CGUI::run(){
}
void CGUI::reshape(int height, int width) {
}

49
client/gui/gui.H Normal file

@ -0,0 +1,49 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GUI_H
#define _GUI_H
class CPvvmudClient;
class CRenderer;
class CGUI {
int m_width;
int m_height;
CRenderer * m_renderer;
CPvvmudClient * m_client;
public:
CGUI(CRenderer * r, CPvvmudClient * cli, int width, int height);
virtual ~CGUI();
CRenderer * getRenderer();
void setRenderer(CRenderer * r);
CPvvmudClient * getClient();
int getWidth();
int getHeight();
void setWidth(int width);
void setHeight(int height);
virtual void reshape(int height, int width);
/*virtual void display();
virtual void visible();
virtual void key();
virtual void special();
virtual void mouse();*/
virtual void run();
};
#endif // _GUI_H

313
client/inputfunction.C Normal file

@ -0,0 +1,313 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include "client.H"
#include "inputfunction.H"
#include "msgsrvcli.H"
#include "srvcliconsole.H"
// Commandline for creating default map
// grep addInp inputfunction.C | tr '"' ' ' | awk '{print $4 " " $2}' > .pvvmud_ifm
//
//
CInputFunction::CInputFunction(CCliSrvManager * manager, CRenderer * renderer){
m_manager = manager;
m_renderer = renderer;
addInputFunction("key_H","playermove_runleft",
(InputFunction_t)&playerMove,PLAYERMOVE_RUNLEFT);
addInputFunction("key_J","playermove_runbackward",
(InputFunction_t)&playerMove,PLAYERMOVE_RUNBACKWARD);
addInputFunction("key_K","playermove_runforward",
(InputFunction_t)&playerMove,PLAYERMOVE_RUNFORWARD);
addInputFunction("key_L","playermove_runright",
(InputFunction_t)&playerMove,PLAYERMOVE_RUNRIGHT);
addInputFunction("","playermove_moveleft",
(InputFunction_t)&playerMove,PLAYERMOVE_MOVELEFT);
addInputFunction("","playermove_movebackward",
(InputFunction_t)&playerMove,PLAYERMOVE_MOVEBACKWARD);
addInputFunction("","playermove_moveforward",
(InputFunction_t)&playerMove,PLAYERMOVE_MOVEFORWARD);
addInputFunction("","playermove_moveright",
(InputFunction_t)&playerMove,PLAYERMOVE_MOVERIGHT);
addInputFunction("key_h","playermove_stepleft",
(InputFunction_t)&playerMove,PLAYERMOVE_STEPLEFT);
addInputFunction("key_j","playermove_stepbackward",
(InputFunction_t)&playerMove,PLAYERMOVE_STEPBACKWARD);
addInputFunction("key_k","playermove_stepforward",
(InputFunction_t)&playerMove,PLAYERMOVE_STEPFORWARD);
addInputFunction("key_l","playermove_stepright",
(InputFunction_t)&playerMove,PLAYERMOVE_STEPRIGHT);
addInputFunction("key_0","usercommand_0",
(InputFunction_t)&userCommand,USERCOMMAND_0);
addInputFunction("key_1","usercommand_1",
(InputFunction_t)&userCommand,USERCOMMAND_1);
addInputFunction("key_2","usercommand_2",
(InputFunction_t)&userCommand,USERCOMMAND_2);
addInputFunction("key_3","usercommand_3",
(InputFunction_t)&userCommand,USERCOMMAND_3);
addInputFunction("key_4","usercommand_4",
(InputFunction_t)&userCommand,USERCOMMAND_4);
addInputFunction("key_5","usercommand_5",
(InputFunction_t)&userCommand,USERCOMMAND_5);
addInputFunction("key_6","usercommand_6",
(InputFunction_t)&userCommand,USERCOMMAND_6);
addInputFunction("key_7","usercommand_7",
(InputFunction_t)&userCommand,USERCOMMAND_7);
addInputFunction("key_8","usercommand_8",
(InputFunction_t)&userCommand,USERCOMMAND_8);
addInputFunction("key_9","usercommand_9",
(InputFunction_t)&userCommand,USERCOMMAND_9);
addInputFunction("key_escape","quit",
(InputFunction_t)&quitFunction,-1);
addInputFunction("key_space","playerlook_default",
(InputFunction_t)&playerlook,PLAYERLOOK_DEFAULT);
addInputFunction("key_enter", "toggle_inputmode",
(InputFunction_t)&consoleFunction, TOGGLE_CONSOLE_MODE);
addInputFunction("key_tab", "show_hide_console",
(InputFunction_t)&consoleFunction, CONSOLE_SHOW_HIDE);
addInputFunction("key_up","playerlook_forward",
(InputFunction_t)&playerlook,PLAYERLOOK_FORWARD);
addInputFunction("key_down","playerlook_backward",
(InputFunction_t)&playerlook,PLAYERLOOK_BACKWARD);
addInputFunction("key_left","playerlook_left",
(InputFunction_t)&playerlook,PLAYERLOOK_LEFT);
addInputFunction("key_right","playerlook_right",
(InputFunction_t)&playerlook,PLAYERLOOK_RIGHT);
addInputFunction("key_page_up","playerlook_up",
(InputFunction_t)&playerlook,PLAYERLOOK_UP);
addInputFunction("key_page_down","playerlook_down",
(InputFunction_t)&playerlook,PLAYERLOOK_DOWN);
addInputFunction("mouse_left_up","pick",
(InputFunction_t)&pickFunction,-1);
addInputFunction("key_d","dump",
(InputFunction_t)&dumpFunc,DUMP_WORLD);
addInputFunction("key_c","capture",
(InputFunction_t)&dumpFunc,DUMP_SCREEN);
loadMap(".pvvmud_ifm");
}
void CInputFunction::setRenderer(CRenderer * renderer) {
m_renderer = renderer;
}
CRenderer * CInputFunction::getRenderer() {
return m_renderer;
}
void CInputFunction::setConsole(CConsole * console) {
m_console = console;
}
CConsole * CInputFunction::getConsole() {
return m_console;
}
void CInputFunction::processHits(int hits, unsigned int buffer[]){
int i;
unsigned int selection, zvalue;
unsigned int names,z2,z1,*ptr,j;
cdebug << "hits = " << hits;
selection = 0; zvalue = 0xFFFFFFFF;
ptr = buffer;
for (i = 0; i < hits; i++){
names = *ptr; ptr++;
z1 = *ptr; ptr++;
z2 = *ptr; ptr++;
if (z2 < zvalue){
selection = *ptr;
zvalue = z2;
}
for (j=0; j < names; j++){
cdebug << ptr;
ptr++;
}
}
cdebug << "Selection = " << selection << "\n";
m_manager->selection(selection);
}
int CInputFunction::playerlook(int argument){
m_manager->playerLook(argument);
return 0;
}
int CInputFunction::playerMove(int argument){
m_manager->playerMove(argument);
return 0;
}
int CInputFunction::userCommand(int argument){
m_manager->userCommand(argument);
return 0;
}
int CInputFunction::quitFunction(int argument){
CSrvCliConsole * c = (CSrvCliConsole *)getConsole();
c->saveHistory();
// save_params();
m_manager->quit();
return 0;
}
int CInputFunction::consoleFunction(int argument) {
switch (argument) {
case TOGGLE_CONSOLE_MODE:
cout << "Input" << getConsole()->getInputMode() << " -> ";
getConsole()->changeInputMode();
cout << getConsole()->getInputMode() << '\n';
break;
case CONSOLE_SHOW_HIDE:
cout << "Visible" << getConsole()->isVisible() << " -> ";
getConsole()->setVisible();
cout << getConsole()->isVisible() << '\n';
break;
default:
cout << "Error\n";
}
return 0;
}
int CInputFunction::pickFunction(int argument){
m_renderer->mousePick(m_xx, m_yy);
return 0;
}
int CInputFunction::dumpFunc(int argument){
switch (argument){
case DUMP_WORLD:
m_manager->dump();
break;
case DUMP_SCREEN:
m_renderer->dumpScreen("pvvmudscreen.tex");
break;
}
return 0;
}
void CInputFunction::key(unsigned char k, int x, int y){
m_xx = x; m_yy = y; // Save position i global variables
if (getConsole()->getInputMode()) {
getConsole()->keyboardInput(k);
}
else {
switch (k){
case ' ':
executeFunction("key_space");
break;
case 27: /* Escape */
executeFunction("key_escape");
break;
case '\r':
executeFunction("key_enter");
break;
case '\t':
executeFunction("key_tab");
break;
default:
char keybuf[6];
strcpy(keybuf,"key_?");
keybuf[4] = k;
executeFunction(keybuf);
}
}
glutPostRedisplay();
}
void CInputFunction::special(int k, int x, int y) {
m_xx = x; m_yy = y; // Save position i global variables
if (getConsole()->getInputMode()) {
switch (k) {
case GLUT_KEY_UP:
getConsole()->keyboardInput(KEY_UP);
break;
case GLUT_KEY_DOWN:
getConsole()->keyboardInput(KEY_DOWN);
break;
} // swich
} // if
switch (k) {
case GLUT_KEY_UP:
executeFunction("key_up");
break;
case GLUT_KEY_DOWN:
executeFunction("key_down");
break;
case GLUT_KEY_LEFT:
executeFunction("key_left");
break;
case GLUT_KEY_RIGHT:
executeFunction("key_right");
break;
case GLUT_KEY_PAGE_UP:
executeFunction("key_page_up");
break;
case GLUT_KEY_PAGE_DOWN:
executeFunction("key_page_down");
break;
default:
return;
}
glutPostRedisplay();
}
void CInputFunction::mouse(int button, int state, int x, int y){
m_xx = x; m_yy = y; // Save position i global variables
switch(button){
case GLUT_LEFT_BUTTON:
if (state == GLUT_UP)
executeFunction("mouse_left_up");
else
executeFunction("mouse_left_down");
break;
case GLUT_MIDDLE_BUTTON:
if (state == GLUT_UP)
executeFunction("mouse_middle_up");
else
executeFunction("mouse_middle_down");
break;
case GLUT_RIGHT_BUTTON:
if (state == GLUT_UP)
executeFunction("mouse_right_up");
else
executeFunction("mouse_right_down");
break;
}
}

67
client/inputfunction.H Normal file

@ -0,0 +1,67 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _INPUTFUNCTION_H
#define _INPUTFUNCTION_H
#include "inputfunctionmap.H"
#include "clisrvmanager.H"
#define TOGGLE_CONSOLE_MODE 0
#define CONSOLE_SHOW_HIDE 1
#define DUMP_SCREEN 0
#define DUMP_WORLD 1
class CRenderer;
class CInputFunction: public CInputFunctionMap {
int m_xx,m_yy;
CCliSrvManager * m_manager;
CRenderer * m_renderer;
CConsole * m_console;
int playerlook(int argument);
int playerMove(int argument);
int userCommand(int argument);
int quitFunction(int argument);
int consoleFunction(int argument);
int pickFunction(int argument);
int dumpFunc(int argument);
public:
CInputFunction(CCliSrvManager * manager, CRenderer * renderer);
void setRenderer(CRenderer * renderer);
CRenderer * getRenderer();
void setConsole(CConsole * console);
CConsole * getConsole();
void processHits(int hits, unsigned int buffer[]);
void key(unsigned char k, int x, int y);
void special(int k, int x, int y);
void mouse(int button, int state, int x, int y);
};
#endif // _INPUTFUNCTION_H

117
client/inputfunctionmap.C Normal file

@ -0,0 +1,117 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream.h>
#include "client.H"
#include "inputfunctionmap.H"
CInputFunctionMapItem::CInputFunctionMapItem(CInputFunctionMap * inputFunctionMap, char * functionIdString, InputFunction_t inputFunction){
this->inputIdStr = NULL;
this->functionIdStr = functionIdString;
this->inputFunction = inputFunction;
argument = -1;
m_inputFunctionMap = inputFunctionMap;
}
CInputFunctionMapItem::CInputFunctionMapItem(CInputFunctionMap * inputFunctionMap, char * inputIdString, char * functionIdString, InputFunction_t inputFunction,int argument){
this->inputIdStr = inputIdString;
this->functionIdStr = functionIdString;
this->inputFunction = inputFunction;
this->argument = argument;
m_inputFunctionMap = inputFunctionMap;
}
void CInputFunctionMapItem::setInputIdStr(char * inputIdString){
this->inputIdStr = (char*)malloc(strlen(inputIdString)+1);
strcpy(this->inputIdStr,inputIdString);
}
int CInputFunctionMapItem::executeFunction(int argument){
return (m_inputFunctionMap->*inputFunction)(argument);
}
int CInputFunctionMapItem::executeFunction(){
return executeFunction(argument);
}
CInputFunctionMap::CInputFunctionMap(){
inputFunctionMap = new CObjectList();
}
void CInputFunctionMap::addInputFunction(char * functionIdString, InputFunction_t inputFunction){
inputFunctionMap->addLast(new CInputFunctionMapItem(this,functionIdString,inputFunction));
}
void CInputFunctionMap::addInputFunction(char * inputIdString, char * functionIdString, InputFunction_t inputFunction, int argument){
inputFunctionMap->addLast(new CInputFunctionMapItem(this,inputIdString,functionIdString,inputFunction,argument));
}
void CInputFunctionMap::loadMap(char * fileName){
char inputIdString[256];
char functionIdString[256];
FILE * mapFile = fopen(fileName,"r");
if (mapFile == NULL){
cdebug << "Failed to open input function map file " << fileName << "\n";
return;
}
while (fscanf(mapFile,"%s %s\n",functionIdString,inputIdString)==2){
setFunctionInputId(functionIdString,inputIdString);
}
fclose(mapFile);
}
void CInputFunctionMap::setFunctionInputId(char * functionIdString,char * inputIdString){
CObjectListItem * item = inputFunctionMap->getFirst();
while (item != NULL){
CInputFunctionMapItem * IFMItem = (CInputFunctionMapItem*)item->getObject();
if (strcmp(functionIdString,IFMItem->getFunctionIdStr())==0){
return IFMItem->setInputIdStr(inputIdString);
}
item = item->getNext();
}
}
int CInputFunctionMap::executeFunction(char * inputIdStr, int argument ){
CObjectListItem * item = inputFunctionMap->getFirst();
while (item != NULL){
CInputFunctionMapItem * IFMItem = (CInputFunctionMapItem*)item->getObject();
if (strcmp(inputIdStr,IFMItem->getInputIdStr())==0){
return IFMItem->executeFunction(argument);
}
item = item->getNext();
}
return -1;
}
int CInputFunctionMap::executeFunction(char * inputIdStr ){
CObjectListItem * item = inputFunctionMap->getFirst();
while (item != NULL){
CInputFunctionMapItem * IFMItem = (CInputFunctionMapItem*)item->getObject();
if (strcmp(inputIdStr,IFMItem->getInputIdStr())==0){
return IFMItem->executeFunction();
}
item = item->getNext();
}
return -1;
}

56
client/inputfunctionmap.H Normal file

@ -0,0 +1,56 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _INPUTFUNCTIONMAP_H
#define _INPUTFUNCTIONMAP_H
#include "objectlist.H"
class CInputFunctionMap;
typedef int (CInputFunctionMap::*InputFunction_t)(int argument);
class CInputFunctionMapItem : public CObject {
char *inputIdStr,*functionIdStr;
InputFunction_t inputFunction;
int argument;
CInputFunctionMap * m_inputFunctionMap;
public:
CInputFunctionMapItem(CInputFunctionMap * inputFunctionMap, char * functionIdString, InputFunction_t inputFunction);
CInputFunctionMapItem(CInputFunctionMap * inputFunctionMap, char * inputIdString, char * functionIdString, InputFunction_t inputFunction, int argument);
void setInputIdStr(char * inputIdString);
char *getInputIdStr(){ return inputIdStr; }
char *getFunctionIdStr(){ return functionIdStr; }
int executeFunction(int argument);
int executeFunction();
};
class CInputFunctionMap {
CObjectList * inputFunctionMap;
public:
CInputFunctionMap();
void addInputFunction(char * functionIdString, InputFunction_t inputFunction);
void addInputFunction(char * inputIdString, char * functionIdString, InputFunction_t inputFunction, int argument);
void loadMap(char * fileName);
void setFunctionInputId(char * functionIdString,char * inputIdString);
int executeFunction(char * inputIdStr, int argument );
int executeFunction(char * inputIdStr);
};
#endif // _INPUTFUNCTIONMAP_H

25
client/inputfunctions.H Normal file

@ -0,0 +1,25 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
int initInputFunctions();
void key(unsigned char k, int x, int y);
void special(int k, int x, int y);
void mouse(int button, int state, int x, int y);

25
client/pvvmud.C Normal file

@ -0,0 +1,25 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmudclient.H"
int main(int argc, char * argv[]) {
CPvvmudClient * client = new CPvvmudClient(argc, argv);
client->run();
}

146
client/pvvmudclient.C Normal file

@ -0,0 +1,146 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include "pvvmudclient.H"
#include "glrenderer.H"
#include "gltexture.H"
#include "glsrvcliconsole.H"
CPvvmudClient::CPvvmudClient(int argc,char * argv[]) {
m_option = new COption;
//m_stdInput = new CStdInput();
m_option->setValue("server",'s',"localhost");
m_option->setValue("username",'u',"Guest");
m_option->setValue("passwd",'p',"pvv");
m_option->loadOption("pvvmud.conf");
m_option->parseArguments(argc,argv);
initGlobalData(m_option);
m_gui = new CGlutGUI(argc,argv,m_renderer, this, 400, 300);
m_renderer = new COGLRenderer(this);
m_console = new CGLSrvCliConsole(this, 40, 20);
m_console->setColor(0.8, 0.8, 0.8);
m_commandParser = new CCliCmdParser(this);
m_gui->setRenderer(m_renderer);
m_inputFunction->setRenderer(m_renderer);
m_inputFunction->setConsole(m_console);
m_renderer->setConsole(m_console);
GLTexture_Init();
m_geometryCache = new CCliGeometryCache(getManager());
m_materialCache = new CCliMaterialCache(getManager());
m_textureCache = new CCliTextureCache(getManager());
m_lastTime.getTime();
cdebug << "GeoCache at addr: " << m_geometryCache << "\n";
m_manager->init();
}
void CPvvmudClient::run() {
m_gui->run();
}
void CPvvmudClient::initGlobalData(COption * option) {
CClientSocket * socket;
if ((m_option->getString("server"))==NULL) {
cdebug << "Error : Argument error in -server\n";
exit(1);
}
try {
CInetAddress addr(m_option->getString("server"), SERVER_CLIENT_PORT);
socket = new CClientSocket(addr.getAddress(), addr.getPort() );
} catch (CSocketException * e){
delete e;
cdebug << "Failed to connect to server!\n";
exit(1);
}
socket->setNonBlocking();
m_timeKeeper = new CTimeKeeper();
m_manager = new CCliSrvManager( new CCliSrvProtocol( socket,m_timeKeeper ), m_timeKeeper);
m_manager->setClient(this);
m_inputFunction = new CInputFunction(m_manager, m_renderer);
if (m_inputFunction == NULL){
cdebug << "Out of memory!!!\n";
exit(23);
}
m_timeKeeper->addHeartBeat(512,this);
}
CGeometryCache * CPvvmudClient::getGeometryCache() {
return m_geometryCache;
}
CTextureCache * CPvvmudClient::getTextureCache() {
return m_textureCache;
}
CMaterialCache * CPvvmudClient::getMaterialCache() {
return m_materialCache;
}
CConsole * CPvvmudClient::getConsole() {
return m_console;
}
CCliSrvManager * CPvvmudClient::getManager() {
return m_manager;
}
CTimeKeeper * CPvvmudClient::getTimeKeeper() {
return m_timeKeeper;
}
CGUI * CPvvmudClient::getGUI() {
return m_gui;
}
CInputFunction * CPvvmudClient::getInputFunction() {
return m_inputFunction;
}
CStdInput * CPvvmudClient::getStdInput() {
return m_stdInput;
}
COption * CPvvmudClient::getOption() {
return m_option;
}
int CPvvmudClient::timeKeeperHB(){
m_manager->sendPing();
return TRUE;
}
void CPvvmudClient::pollConsole(){
const char * msg = getConsole()->getLine();
if (msg != NULL) {
m_commandParser->parseCommand(msg);
}
}

87
client/pvvmudclient.H Normal file

@ -0,0 +1,87 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _PVVMUDCLIENT_H
#define _PVVMUDCLIENT_H
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <netdb.h>
#include "gui.H"
#include "glutgui.H"
#include "renderer.H"
#include "console.H"
#include "inputfunction.H"
#include "time.H"
#include "clisrvmanager.H"
#include "timekeeper.H"
#include "option.H"
#include "clientcache.H"
#include "stdinput.H"
#include "clicmdparser.H"
class CPvvmudClient : public CTimeKeeperItem {
public:
CGUI * m_gui;
CRenderer * m_renderer;
CConsole * m_console;
CCliCmdParser * m_commandParser;
CCliSrvManager * m_manager;
CTimeKeeper * m_timeKeeper;
CInputFunction * m_inputFunction;
CStdInput * m_stdInput;
COption * m_option;
CTime m_lastTime, m_currTime;
// Cache-objects
CCliGeometryCache * m_geometryCache;
CCliTextureCache * m_textureCache;
CCliMaterialCache * m_materialCache;
CPvvmudClient(int argc,char *argv[]);
void run();
void initGlobalData(COption * option);
CGeometryCache * getGeometryCache();
CTextureCache * getTextureCache();
CMaterialCache * getMaterialCache();
CConsole * getConsole();
CGUI * getGUI();
CCliSrvManager * getManager();
CTimeKeeper * getTimeKeeper();
CInputFunction * getInputFunction();
CStdInput * getStdInput();
COption * getOption();
virtual int timeKeeperHB();
virtual void pollConsole();
};
#endif // _PVVMUDCLIENT_H

@ -0,0 +1,5 @@
INCLUDES = -I.. -I../gui -I../coreclient -I../../common/include @X_CFLAGS@ @GL_CFLAGS@ -DPVVMUDCLIENT
noinst_LIBRARIES = librenderer.a
librenderer_a_SOURCES = renderer.C glgeometry.C glmaterial.C glrenderer.C gltexture.C console.C glconsole.C srvcliconsole.C glsrvcliconsole.C

332
client/renderer/Makefile.in Normal file

@ -0,0 +1,332 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
CXX = @CXX@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
LEX = @LEX@
MAKEINFO = @MAKEINFO@
NETLIBS = @NETLIBS@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
TIFF_CFLAGS = @TIFF_CFLAGS@
TIFF_LIBS = @TIFF_LIBS@
VERSION = @VERSION@
YACC = @YACC@
INCLUDES = -I.. -I../gui -I../coreclient -I../../common/include @X_CFLAGS@ @GL_CFLAGS@ -DPVVMUDCLIENT
noinst_LIBRARIES = librenderer.a
librenderer_a_SOURCES = renderer.C glgeometry.C glmaterial.C glrenderer.C gltexture.C console.C glconsole.C srvcliconsole.C glsrvcliconsole.C
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
librenderer_a_LIBADD =
librenderer_a_OBJECTS = renderer.o glgeometry.o glmaterial.o \
glrenderer.o gltexture.o console.o glconsole.o srvcliconsole.o \
glsrvcliconsole.o
AR = ar
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
DEP_FILES = .deps/console.P .deps/glconsole.P .deps/glgeometry.P \
.deps/glmaterial.P .deps/glrenderer.P .deps/glsrvcliconsole.P \
.deps/gltexture.P .deps/renderer.P .deps/srvcliconsole.P
SOURCES = $(librenderer_a_SOURCES)
OBJECTS = $(librenderer_a_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .C .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign client/renderer/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstLIBRARIES:
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
librenderer.a: $(librenderer_a_OBJECTS) $(librenderer_a_DEPENDENCIES)
-rm -f librenderer.a
$(AR) cru librenderer.a $(librenderer_a_OBJECTS) $(librenderer_a_LIBADD)
$(RANLIB) librenderer.a
.C.o:
$(CXXCOMPILE) -c $<
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = client/renderer
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign client/renderer/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
%.o: %.C
@echo '$(CXXCOMPILE) -c $<'; \
$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.C
@echo '$(LTCXXCOMPILE) -c $<'; \
$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile $(LIBRARIES)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-tags distclean-depend distclean-generic \
clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

264
client/renderer/console.C Normal file

@ -0,0 +1,264 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <iostream.h>
#include <malloc.h>
#include <string.h>
#include "pvvmud.H"
#include "console.H"
#include "pvvmudclient.H"
CConsole::CConsole(CPvvmudClient * cli) {
CConsole(cli, 40, 20);
}
CConsole::CConsole(CPvvmudClient * cli, int rows, int cols) {
m_client = cli;
m_cols = cols;
m_rows = rows;
m_print_x = m_print_y = 0;
m_visible = FALSE;
m_state = FALSE;
m_echo = TRUE;
m_dataReady = FALSE;
// Calculate start point for drawing (assumes 8-by-13 font)
int cons_width = 8 * rows;
int cons_height = 13 * cols;
m_screen_x = (getClient()->getGUI()->getWidth() - cons_width) / 2;
m_screen_y = getClient()->getGUI()->getHeight() - (getClient()->getGUI()->getHeight() - cons_height) / 2;
m_input_x = 0;
m_input_y = m_cols - 1;
m_charColor = (double*)malloc(sizeof(double) * 3);
m_numInputChars = 0;
m_bufStart = 0;
// Allocate space for console data (one extra char for newline)
m_console =(char*)malloc(sizeof(char) * (m_cols+1)*m_rows);
memset(m_console, 0, (m_cols+1)*m_rows);
} // CConsole()
CConsole::~CConsole() {
free(m_console);
free(m_charColor);
}
void CConsole::drawText() {
}
void CConsole::addMsg(char * msg) {
}
int CConsole::printLine(char * string) {
int i = print(string);
if (i) {
// Add newline
m_console[m_print_y*m_rows+m_print_x] = '\n';
if (m_print_y < m_cols) {
m_print_y++;
m_print_x = 0;
} // if
else {
m_print_y = m_print_x = 0; //Reached end of console, return to top.
} // else
} // if
return i;
} // printLine()
int CConsole::print(char * string) {
char c;
int i = 0;
while ((c=string[i++])) {
if (m_print_y >= m_cols-2) {
scroll(1);
m_print_y--;
}
if (m_print_x == m_rows-1) { // Check if the cursor is at the end of a line
m_console[m_print_y*m_rows+m_print_x] = '\n';
if (m_print_y >= (m_cols-2)) { // check if the cursor is at the bottom
scroll(1);
m_print_x = 0;
m_print_y--;
} // if
else {
m_print_y++;
m_print_x = 0;
} // else
i--;
} // if
else if (m_print_x < m_rows) {
m_console[m_print_y*m_rows+m_print_x] = c;
m_print_x++;
} // else if
else { // m_print> m_rows => error condition (never supposed to happen)
return 0;
}
if (c == '\n') {
m_console[m_print_y*m_rows+m_print_x] = '\n';
m_print_y++;
m_print_x = 0;
} // if
} // while
return 1;
}
int CConsole::printChar(char c) {
char * tmp = (char*)malloc(sizeof(char)*2);
tmp[0] = c;
tmp[1] = 0;
print(tmp);
free(tmp);
}
void CConsole::echoChar(char c) {
if (m_input_x < m_rows) {
m_console[m_input_y * m_rows + m_input_x] = c;
m_input_x++;
}
}
void CConsole::clear() {
memset(m_console, 0, getRows()*(getCols()+1));
setCursorPos(0, 0);
}
void CConsole::scroll(int lines) {
for (int i=lines;i<m_cols;i++) {
memcpy(&m_console[(i-lines)*(m_rows)], &m_console[i*(m_rows)], m_rows+1);
}
}
void CConsole::keyboardInput(char k) {
switch (k) {
case '\r':
changeInputMode();
if (m_inputBuffer != "") {
setDataReady();
}
break;
case '\b':
if (m_numInputChars != 0) {
m_numInputChars--;
m_input_x--;
m_console[m_input_y * m_rows + m_input_x] = 0;
}
break;
default:
if (m_echo) {
echoChar(k);
}
m_inputBuffer += k;
}
}
const char * CConsole::getLine() {
if (getDataReady()) {
const char * s = m_inputBuffer.c_str();
cout << s << '\n';
m_inputBuffer = "";
setDataReady(FALSE);
return s;
}
else {
return NULL; // No data ready
}
}
/*char CConsole::getChar() {
if (m_numInputChars) {
char c = m_inputBuffer[m_bufStart++];
if (m_bufStart >= INPUTSIZE) {
m_bufStart = 0;
m_numInputChars--;
} // if
} // if
} // getChar()*/
void CConsole::setCursorPos(int x, int y) {
m_print_x = x;
m_print_y = y;
}
int CConsole::getRows() {
return m_rows;
}
int CConsole::getCols() {
return m_cols;
}
double * CConsole::getColor() {
return m_charColor;
}
void CConsole::setColor(double red, double green, double blue) {
m_charColor[0] = red;
m_charColor[1] = green;
m_charColor[2] = blue;
}
CPvvmudClient * CConsole::getClient() {
return m_client;
}
int CConsole::changeInputMode() {
if(m_state)
m_state = 0;
else {
m_visible = TRUE;
m_state = 1;
m_input_x = 0;
m_input_y = m_cols - 1;
} // else
for(int i=0;i<getRows();i++) {
m_console[m_input_y*getRows()+i]=0;
}
return 0;
}
int CConsole::getInputMode() {
return m_state;
}
int CConsole::setVisible() {
m_visible = (m_visible) ? 0 : 1;
return 0;
}
int CConsole::isVisible() {
return m_visible;
}
void CConsole::setEcho(BOOL e) {
m_echo = e;
}
BOOL CConsole::getEcho() {
return m_echo;
}
void CConsole::setDataReady(BOOL d) {
m_dataReady = d;
}
BOOL CConsole::getDataReady() {
return m_dataReady;
}

95
client/renderer/console.H Normal file

@ -0,0 +1,95 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef CCONSOLE_H
#define CCONSOLE_H
#include <string>
class CPvvmudClient;
//class CConsoleCursor {
class CConsole {
int m_cols; // Number of columns
int m_rows; // Number of rows
int m_state; // State variable
int m_visible;
int num_msgs; // Number of messages printed on console
BOOL m_echo;
BOOL m_dataReady;
CPvvmudClient * m_client;
protected:
char * m_console;
string m_inputBuffer;
int m_numInputChars;
int m_bufStart;
double * m_charColor;
int m_screen_x; // Startpoint (in screen coordinates)
int m_screen_y;
int m_print_x; // Position for writing
int m_print_y;
int m_input_x; // Position for echo
int m_input_y;
void setDataReady(BOOL d=TRUE);
void scrollMsgs();
public:
const int INPUTSIZE = 80;
CConsole(CPvvmudClient * cli);
CConsole(CPvvmudClient * cli, int cols, int rows);
virtual ~CConsole();
virtual void drawText();
virtual void addMsg(char * msg);
int printLine(char * string);
int print(char * string);
int printChar(char c);
void printMsg(char * msg);
void echoChar(char c);
void clear();
void scroll(int lines);
virtual void keyboardInput(char k);
const char * getLine();
void setCursorPos(int x, int y);
int getRows();
int getCols();
double * getColor();
void setColor(double red, double green, double blue);
CPvvmudClient * getClient();
int changeInputMode();
int getInputMode();
int setVisible();
int isVisible();
void setEcho(BOOL e);
BOOL getEcho();
BOOL getDataReady();
};
#endif // CCONSOLE_H

115
client/renderer/glconsole.C Normal file

@ -0,0 +1,115 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <iostream.h>
#include "pvvmud.H"
#include "glconsole.H"
#include "pvvmudclient.H"
GLubyte CGLConsole::m_cursor[13] = {
0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
0x00, 0x00, 0xff,
0xff};
CGLConsole::CGLConsole(CPvvmudClient * cli) : CConsole(cli) {
m_font = GLUT_BITMAP_8_BY_13;
}
CGLConsole::CGLConsole(CPvvmudClient * cli, int rows, int cols) : CConsole(cli, rows, cols) {
m_font = GLUT_BITMAP_8_BY_13;
setCursorPos(1, 10);
}
CGLConsole::~CGLConsole() {
}
CGLConsole::drawString(char *string) {
int len,t;
t = 0;
len = getRows();
while (t < len && string[t] != '\n') {
if (string[t] != 0) {
glutBitmapCharacter(m_font,string[t]);
}
t++;
} // while
//cout << '\n';
}
void CGLConsole::drawText() {
int x, y;
// Kode for å tegna opp tekstkonsoll
glDisable(GL_DEPTH_TEST);
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
// Darken background
glLoadIdentity();
GLdouble dark[4] = {0.0, 0.0, 0.0, 0.5};
//glRotatef(-90, 1.0, 0.0, 0.0);
gluLookAt(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0);
//CCliViewpoint * viewpoint = getClient()->getManager()->getViewpoint();
//viewpoint->transform();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel(GL_FLAT);
glBegin(GL_QUADS);
glColor4dv(dark);
glVertex3f(-300, -300, 0.5);
glVertex3f(-300, 300, 0.5);
glVertex3f(300, 300, 0.5);
glVertex3f(300, -300, 0.5);
glEnd();
glDisable(GL_BLEND);
glShadeModel(GL_SMOOTH);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-0.5,getClient()->getGUI()->getWidth() ,-0.5,getClient()->getGUI()->getHeight(),-1.0,1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor3dv(m_charColor);
x = m_screen_x;
y = m_screen_y;
for (int i=0;i<getCols();i++) {
glRasterPos2i(x, y);
drawString(&m_console[i*getRows()]);
y-=13;
} // for
// Draw cursor
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if (getInputMode()) {
glRasterPos2i(m_screen_x + (8*m_input_x), m_screen_y - (13*(m_input_y+1)));
glBitmap(8, 13, 0.0, 0.0, 0.0, 0.0, m_cursor);
}
}

@ -0,0 +1,39 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef CGLCONSOLE_H
#define CGLCONSOLE_H
#include <GL/glut.h>
#include "console.H"
class CGLConsole : public CConsole {
void *m_font;
drawString(char *string);
public:
static GLubyte m_cursor[13];
CGLConsole(CPvvmudClient * cli);
CGLConsole(CPvvmudClient * cli, int cols, int rows);
~CGLConsole();
virtual void drawText();
};
#endif // CGLCONSOLE_H

@ -0,0 +1,219 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include "glgeometry.H"
/*******************************************************************************
*
* Constructor for ObjectGeometry
*
******************************************************************************/
CGLGeometry::CGLGeometry( int objectGeometryId )
:CGeometry( objectGeometryId )
{
}
CGLGeometry::CGLGeometry( int objectGeometryId, int numVertices,
int numNormals, int numTexCoords, int numPolygons )
:CGeometry( objectGeometryId, numVertices, numNormals,
numTexCoords, numPolygons)
{
}
/*******************************************************************************
*
* Destructor for ObjectGeometry
*
******************************************************************************/
CGLGeometry::~CGLGeometry(){
}
/*******************************************************************************
*
* Draw ObjectGeometry
*
******************************************************************************/
int CGLGeometry::draw( CMaterialCache * matCache,
CTextureCache * texCache ){
int pp,ii;
CPolygon * polygon;
CIntArray *normalIndex,*vertexIndex,*texCoordIndex;
int numVertex, numNormal, numTexCoord;
// CNormal * normal;
// CVertex * vertex;
// CTexCoord * texCoord;
CMaterial * mat;
for (pp = 0; pp < this->polygonList->getNumElements(); pp ++){
polygon = this->polygonList->get( pp );
numVertex = polygon->getVertexIList()->getNumElements();
numNormal = polygon->getNormalIList()->getNumElements();
numTexCoord = polygon->getTexCoordIList()->getNumElements();
mat = matCache->get( polygon->getMaterial() );
if (mat == NULL){
mat = matCache->get( 0 );
// cdebug(stderr,"Using default material %i for object %i\n",polygon->getMaterial(),id);
}
if (mat != NULL) mat->exec( texCache );
// else cdebug(stderr,"Failed to find material!\n");
vertexIndex = polygon->getVertexIList();//->getIndex();
normalIndex = polygon->getNormalIList();//->getIndex();
texCoordIndex = polygon->getTexCoordIList();//->getIndex();
//vertex = this->vertexList->getVertex();
//normal = this->normalList->getNormal();
//texCoord = this->texCoordList->getTexCoord();
glBegin( (GLenum)polygon->getType() );
switch ( polygon->getType() ){
case POLYGON_POLYGON:
case POLYGON_QUAD_STRIP:
case POLYGON_TRIANGLE_STRIP:
case POLYGON_TRIANGLE_FAN:
if (numVertex == numNormal) {
// One normal for each vertex
if (numVertex == numTexCoord){
// Texture Coordinates
for (ii = 0; ii < numVertex; ii++){
glNormal3dv(normalList->get(normalIndex->get(ii)));
glTexCoord2dv(texCoordList->get(texCoordIndex->get(ii)));
glVertex3dv(vertexList->get(texCoordIndex->get(ii)));
}
} else {
// No texture coordinates
for (ii = 0; ii < numVertex; ii++){
glNormal3dv(normalList->get(normalIndex->get(ii)));
glVertex3dv(vertexList->get(texCoordIndex->get(ii)));
}
}
} else {
// One normal for object
if (numVertex == numTexCoord){
// Texture Coordinates
glNormal3dv(normalList->get(0));
for (ii = 0; ii < numVertex; ii++){
glTexCoord2dv(texCoordList->get(texCoordIndex->get(ii)));
glVertex3dv(vertexList->get(texCoordIndex->get(ii)));
}
} else {
// No texture coordinates
glNormal3dv(normalList->get(0));
for (ii = 0; ii < numVertex; ii++){
glVertex3dv(vertexList->get(texCoordIndex->get(ii)));
}
}
}
break;
case POLYGON_QUADS:
if (numVertex == numNormal) {
// One normal for each vertex
if (numNormal == numTexCoord){
// Texture Coordinates
for (ii = 0; ii < numVertex; ii++){
glNormal3dv(normalList->get(normalIndex->get(ii)));
glTexCoord2dv(texCoordList->get(normalIndex->get(ii)));
glVertex3dv(vertexList->get(vertexIndex->get(ii)));
}
} else {
for (ii = 0; ii < numVertex; ii++){
glNormal3dv(normalList->get(normalIndex->get(ii)));
glVertex3dv(vertexList->get(vertexIndex->get(ii)));
}
}
} else {
// One normal for each quad
if (numVertex == numTexCoord){
// Texture Coordinates
for (ii = 0; ii < numVertex; ii++){
if (ii%4 == 0) glNormal3dv(normalList->get(normalIndex->get(ii/4)));
glTexCoord2dv(texCoordList->get(texCoordIndex->get(ii)));
glVertex3dv(vertexList->get(vertexIndex->get(ii)));
}
} else {
for (ii = 0; ii < numVertex; ii++){
if (ii%4 == 0) glNormal3dv(normalList->get(normalIndex->get(ii/4)));
glVertex3dv(vertexList->get(vertexIndex->get(ii)));
}
}
}
break;
case POLYGON_TRIANGLES:
if (numVertex == numNormal) {
// One normal for each vertex
if (numVertex == numTexCoord){
// Texture Coordinates
for (ii = 0; ii < numVertex; ii++){
glNormal3dv(normalList->get(normalIndex->get(ii)));
glTexCoord2dv(texCoordList->get(texCoordIndex->get(ii)));
glVertex3dv(vertexList->get(vertexIndex->get(ii)));
}
} else {
for (ii = 0; ii < numVertex; ii++){
glNormal3dv(normalList->get(normalIndex->get(ii)));
glVertex3dv(vertexList->get(vertexIndex->get(ii)));
}
}
} else {
// One normal for each triangle
if (numVertex == numNormal){
// Texture Coordinates
for (ii = 0; ii < numVertex; ii++){
if (ii%3 == 0) glNormal3dv(normalList->get(normalIndex->get(ii/3)));
glTexCoord2dv(texCoordList->get(texCoordIndex->get(ii)));
glVertex3dv(vertexList->get(vertexIndex->get(ii)));
}
} else {
for (ii = 0; ii < numVertex; ii++){
if (ii%3 == 0) glNormal3dv(normalList->get(normalIndex->get(ii/3)));
glVertex3dv(vertexList->get(vertexIndex->get(ii)));
}
}
}
break;
}
glEnd( );
}
if (next != NULL) {
next->draw( matCache, texCache );
}
return TRUE;
}

@ -0,0 +1,37 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GLGEOMETRY_H
#define _GLGEOMETRY_H
#include "geometry.H"
class CGLGeometry : public CGeometry{
public:
CGLGeometry(int objectGeometryId);
CGLGeometry(int objectGeometryId, int numVertices,
int numNormals, int numTexCoords, int numPolygons);
virtual ~CGLGeometry();
virtual int draw( CMaterialCache * matCache, CTextureCache * texCache );
};
#endif /* _GLGEOMETRY_H */

@ -0,0 +1,63 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <GL/gl.h>
#include <iostream.h>
#include "pvvmud.H"
#include "glmaterial.H"
CGLMaterial::CGLMaterial():CMaterial(){
}
CGLMaterial::CGLMaterial(int materialId):CMaterial(materialId){
}
int CGLMaterial::exec(CTextureCache * texCache){
CTexture * tex;
if (getTextureId() != -1){
if ((tex = texCache->get(getTextureId()))== NULL){
if ((tex = texCache->get(0)) == NULL){
cdebug << "Failed to find texture!\n";
glDisable(GL_TEXTURE_2D);
} else {
cdebug << "Using default texture for id " << getTextureId() << "\n";
glEnable(GL_TEXTURE_2D);
tex->exec();
}
} else {
glEnable(GL_TEXTURE_2D);
tex->exec();
}
} else {
glDisable(GL_TEXTURE_2D);
}
glMaterialfv(GL_FRONT, GL_AMBIENT, m_ambient );
glMaterialfv(GL_FRONT, GL_DIFFUSE, m_diffuse );
glMaterialfv(GL_FRONT, GL_SPECULAR, m_specular );
glMaterialfv(GL_FRONT, GL_SHININESS, m_shininess );
glMaterialfv(GL_FRONT, GL_EMISSION, m_emission );
return TRUE;
}

@ -0,0 +1,38 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GLMATERIAL_H
#define _GLMATERIAL_H
#include "material.H"
#define MAT_NOTEXTURE -1
class CGLMaterial : public CMaterial {
public:
CGLMaterial();
CGLMaterial(int materialId);
virtual ~CGLMaterial() {}
virtual int exec(CTextureCache * texCache);
};
#endif /* _GLMATERIAL_H */

@ -0,0 +1,188 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <iostream.h>
#include "pvvmud.H"
#include "glrenderer.H"
#include "cliviewpoint.H"
#include "pvvmudclient.H"
COGLRenderer::COGLRenderer(CPvvmudClient * cli) : CRenderer(cli) {
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);
{
GLfloat gray[4] = {0.2, 0.2, 0.2, 1.0};
GLfloat white[4] = {1.0, 1.0, 1.0, 1.0};
GLfloat ambient[4] = {0.4, 0.4, 0.4, 1.0};
glLightfv(GL_LIGHT0, GL_AMBIENT, gray);
glLightfv(GL_LIGHT0, GL_DIFFUSE, white);
glEnable(GL_LIGHT0);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambient);
}
glEnable( GL_TEXTURE_2D );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
// glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST );
glDisable(GL_TEXTURE_2D);
}
COGLRenderer::~COGLRenderer(){
}
void COGLRenderer::prepareDraw(CWorldObject * object) {
if (m_mode == GL_SELECT) {
glLoadName(object->getObjectId());
}
}
void COGLRenderer::draw() {
GLfloat light_position[4] = { 0.0, 0.5, 1.0, 0.0 };
glLoadIdentity();
glEnable(GL_DEPTH_TEST);
// glEnable(GL_TEXTURE_2D);
glEnable(GL_LIGHTING);
glClearColor(0.5,0.5,0.9,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(-90, 1.0, 0.0, 0.0);
CCliViewpoint * viewpoint = getClient()->getManager()->getViewpoint();
viewpoint->transform();
glLightfv(GL_LIGHT0,GL_POSITION,light_position);
getClient()->getManager()->animate();
getClient()->getManager()->draw(this);
glPopMatrix();
if (getConsole()->isVisible()) {
getConsole()->drawText();
}
glFlush();
// Moved to pvvmudclient->pollConsole()
// const char * s = getConsole()->getLine();
// if (s != NULL) {
// getClient()->getManager()->sendMsg(s);
// }
getClient()->getGUI()->reshape(getClient()->getGUI()->getWidth(), getClient()->getGUI()->getHeight());
}
void COGLRenderer::transform(CPosition &pos, CDirection &dir) {
const double * position = pos.getVector();
const double * direction = dir.getVector();
glPushMatrix();
glTranslated(position[0],position[1],position[2]);
glRotated(direction[2],1,0,0);
glRotated(direction[1],0,1,0);
glRotated(direction[0],0,0,1);
}
void COGLRenderer::reshape(int width, int height) {
getClient()->getGUI()->setWidth(width);
getClient()->getGUI()->setHeight(height);
GLfloat aspectViewport = (GLfloat) height / (GLfloat) width;
setAspectViewport(aspectViewport);
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-0.1, 0.1, -0.1*aspectViewport, 0.1*aspectViewport, 0.2, 1000.0);
glMatrixMode(GL_MODELVIEW);
}
void COGLRenderer::postDraw() {
glPopMatrix();
}
#define SELECTBUFSIZE 1024
void COGLRenderer::mousePick(int x, int y) {
cdebug << "Mouse pick " << x << " " << y << "\n";
GLuint selectBuf[SELECTBUFSIZE];
GLint hits;
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT, viewport);
glSelectBuffer(SELECTBUFSIZE, selectBuf);
glRenderMode(GL_SELECT);
glInitNames();
glPushName((GLuint)(-1));
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluPickMatrix(x,viewport[3]-y,1.0,1.0,viewport);
glFrustum(-0.1, 0.1, -0.1*m_aspectViewport, 0.1*m_aspectViewport, 0.2, 1000.0);
setMode(GL_SELECT);
draw();
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glFlush();
hits = glRenderMode(GL_RENDER);
getClient()->getInputFunction()->processHits(hits, selectBuf);
}
GLfloat COGLRenderer::getAspectViewport() {
return m_aspectViewport;
}
void COGLRenderer::setAspectViewport(GLfloat av) {
m_aspectViewport = av;
}
void COGLRenderer::setMode(GLenum mode) {
m_mode = mode;
}
void COGLRenderer::dumpScreen(char * texFileName){
GLint viewport[4];
int width,height;
BYTE *data;
CTexture * texture = new CTexture();
glGetIntegerv(GL_VIEWPORT,viewport);
width = viewport[2];
height = viewport[3];
data = (BYTE*)malloc(width*height*4*sizeof(BYTE));
glReadPixels(0,0,width,height,GL_RGBA,GL_UNSIGNED_BYTE,(GLvoid*)data);
texture->setTextureMap(new CTextureMap(width,height,data));
texture->save(texFileName);
delete texture;
}

@ -0,0 +1,46 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GLRENDERER_H
#define _GLRENDERER_H
#include <GL/gl.h>
#include <GL/glut.h>
#include "renderer.H"
class COGLRenderer : public CRenderer {
GLenum m_mode;
GLfloat m_aspectViewport;
public:
COGLRenderer(CPvvmudClient * cli);
virtual ~COGLRenderer();
virtual void prepareDraw(CWorldObject * object);
virtual void transform(CPosition &pos, CDirection &dir);
virtual void draw();
virtual void postDraw();
virtual void mousePick(int x, int y);
virtual void reshape(int width, int height);
GLfloat getAspectViewport();
void setAspectViewport(GLfloat av);
void setMode(GLenum mode);
virtual void dumpScreen(char * texFileName);
};
#endif // _GLRENDERER_H

@ -0,0 +1,116 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <iostream.h>
#include "pvvmud.H"
#include "glsrvcliconsole.H"
#include "pvvmudclient.H"
GLubyte CGLSrvCliConsole::m_cursor[13] = {
0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
0x00, 0x00, 0xff,
0xff};
CGLSrvCliConsole::CGLSrvCliConsole(CPvvmudClient * cli) : CSrvCliConsole(cli) {
m_font = GLUT_BITMAP_8_BY_13;
}
CGLSrvCliConsole::CGLSrvCliConsole(CPvvmudClient * cli, int rows, int cols) : CSrvCliConsole(cli, rows, cols) {
m_font = GLUT_BITMAP_8_BY_13;
setCursorPos(1, 10);
}
CGLSrvCliConsole::~CGLSrvCliConsole() {
}
CGLSrvCliConsole::drawString(char *string) {
int len,t;
t = 0;
len = getRows();
while (t < len && string[t] != '\n') {
if (string[t] != 0) {
glutBitmapCharacter(m_font,string[t]);
}
t++;
} // while
//cout << '\n';
}
void CGLSrvCliConsole::drawText() {
int x, y;
//printMsgs();
// Kode for å tegna opp tekstkonsoll
glDisable(GL_DEPTH_TEST);
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
// Darken background
glLoadIdentity();
GLdouble dark[4] = {0.0, 0.0, 0.0, 0.5};
//glRotatef(-90, 1.0, 0.0, 0.0);
gluLookAt(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0);
//CCliViewpoint * viewpoint = getClient()->getManager()->getViewpoint();
//viewpoint->transform();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel(GL_FLAT);
glBegin(GL_QUADS);
glColor4dv(dark);
glVertex3f(-300, -300, 0.5);
glVertex3f(-300, 300, 0.5);
glVertex3f(300, 300, 0.5);
glVertex3f(300, -300, 0.5);
glEnd();
glDisable(GL_BLEND);
glShadeModel(GL_SMOOTH);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-0.5,getClient()->getGUI()->getWidth() ,-0.5,getClient()->getGUI()->getHeight(),-1.0,1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor3dv(m_charColor);
x = m_screen_x;
y = m_screen_y;
for (int i=0;i<getCols();i++) {
glRasterPos2i(x, y);
drawString(&m_console[i*getRows()]);
y-=13;
} // for
// Draw cursor
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if (getInputMode()) {
glRasterPos2i(m_screen_x + (8*m_input_x), m_screen_y - (13*(m_input_y+1)));
glBitmap(8, 13, 0.0, 0.0, 0.0, 0.0, m_cursor);
}
}

@ -0,0 +1,39 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef CGLSRVCLICONSOLE_H
#define CGLSRVCLICONSOLE_H
#include <GL/glut.h>
#include "srvcliconsole.H"
class CGLSrvCliConsole : public CSrvCliConsole {
void *m_font;
drawString(char *string);
public:
static GLubyte m_cursor[13];
CGLSrvCliConsole(CPvvmudClient * cli);
CGLSrvCliConsole(CPvvmudClient * cli, int cols, int rows);
~CGLSrvCliConsole();
virtual void drawText();
};
#endif // CGLSRVCLICONSOLE_H

146
client/renderer/gltexture.C Normal file

@ -0,0 +1,146 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "gltexture.H"
#ifdef HAVE_GL_GLUT_H
#include <GL/glut.h>
#endif /* HAVE_GL_GLUT_H */
static GLboolean HaveTexObj = GL_FALSE;
#if defined(GL_VERSION_1_1)
# define TEXTURE_OBJECT 1
#elif defined(GL_EXT_texture_object)
# define TEXTURE_OBJECT 1
# define glBindTexture(A,B) glBindTextureEXT(A,B)
# define glGenTextures(A,B) glGenTexturesEXT(A,B)
# define glDeleteTextures(A,B) glDeleteTexturesEXT(A,B)
#endif
void GLTexture_Init(){
/* check that renderer has the GL_EXT_texture_object extension
* or supports OpenGL 1.1
*/
#ifdef TEXTURE_OBJECT
char *exten = (char *) glGetString( GL_EXTENSIONS );
char *version = (char *) glGetString( GL_VERSION );
if ( strstr( exten, "GL_EXT_texture_object" )
|| strncmp( version, "1.1", 3 )==0 ) {
HaveTexObj = GL_TRUE;
}
#endif
}
/******************************************************************************
*
* Construct texture with given id
*
*****************************************************************************/
CGLTexture::CGLTexture(int textureId):CTexture(textureId){
}
/******************************************************************************
*
* Destruct texture
*
*****************************************************************************/
CGLTexture::~CGLTexture(){
#ifdef TEXTURE_OBJECT
if (loaded())
glDeleteTextures( 1, &texObj );
#endif
}
/******************************************************************************
*
* Set texturemap to use with texture
*
*****************************************************************************/
void CGLTexture::setTextureMap(CTextureMap * textureMap){
/* generate texture object IDs */
if (HaveTexObj) {
#ifdef TEXTURE_OBJECT
glGenTextures( 1, &texObj );
#endif
}
else {
texObj = glGenLists(1);
}
/* setup texture object */
if (HaveTexObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, texObj );
#endif
}
else {
glNewList( texObj, GL_COMPILE );
}
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
glTexImage2D( GL_TEXTURE_2D, 0, 4, textureMap->getWidth(),
textureMap->getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE,
textureMap->getData() );
if (!HaveTexObj) {
glEndList();
}
/* end of texture object */
CTexture::setTextureMap(textureMap);
}
/******************************************************************************
*
* Exec texture
*
*****************************************************************************/
int CGLTexture::exec(){
if (!loaded()) return FALSE;
if (HaveTexObj) {
#ifdef TEXTURE_OBJECT
glBindTexture( GL_TEXTURE_2D, texObj );
#endif
}
else {
glCallList( texObj );
}
return TRUE;
}

@ -0,0 +1,56 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GLTEXTURE_H
#define _GLTEXTURE_H
#include "mudtypes.h"
#include "texture.H"
#ifdef HAVE_GL_GL_H
#include <GL/glut.h>
typedef GLuint TexObj_t;
#else /* HAVE_GL_GL_H */
typedef unsigned int TexObj_t;
#endif /* HAVE_GL_GL_H */
#define TEX_STATE_LOADED 0x0001
void GLTexture_Init();
class CGLTexture : public CTexture {
TexObj_t texObj;
public:
CGLTexture();
CGLTexture(int id);
~CGLTexture();
virtual void setTextureMap(CTextureMap * textureMap);
virtual int exec();
};
#endif /* _GLTEXTURE_H */

@ -0,0 +1,65 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "pvvmud.H"
#include "renderer.H"
#include "pvvmudclient.H"
CRenderer::CRenderer(CPvvmudClient * c) {
m_client = c;
}
CRenderer::~CRenderer(){
}
CPvvmudClient * CRenderer::getClient() {
return m_client;
}
CConsole * CRenderer::getConsole() {
return m_console;
}
void CRenderer::setConsole(CConsole * console) {
m_console = console;
}
void CRenderer::prepareDraw(CWorldObject * object){
}
void CRenderer::transform(CPosition &pos, CDirection &dir){
}
void CRenderer::draw(){
}
void CRenderer::postDraw(){
}
void CRenderer::mousePick(int x, int y){
}
void CRenderer::reshape(int width, int height) {
}
void CRenderer::dumpScreen(char * texFileName){
}

@ -0,0 +1,45 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _RENDERER_H
#define _RENDERER_H
#include "worldobject.H"
#include "console.H"
class CPvvmudClient;
class CRenderer {
CPvvmudClient * m_client;
CConsole * m_console;
public:
CRenderer(CPvvmudClient * c);
virtual ~CRenderer();
CPvvmudClient * getClient();
CConsole * getConsole();
void setConsole(CConsole * console);
virtual void prepareDraw(CWorldObject * object);
virtual void transform(CPosition &pos, CDirection &dir);
virtual void draw();
virtual void postDraw();
virtual void mousePick(int x, int y);
virtual void reshape(int width, int height);
virtual void dumpScreen(char * texFileName);
};
#endif // _RENDERER_H

@ -0,0 +1,185 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <fstream>
#include <malloc.h>
#include "pvvmud.H"
#include "srvcliconsole.H"
#include "string.h"
const char * CSrvCliConsole::HISTORY_FILE = ".pvvmud_history";
CSrvCliConsole::CSrvCliConsole(CPvvmudClient * cli) : CConsole(cli) {
m_numMsgs = 0;
m_historyPos = 0;
m_consSize = getCols()-1;
loadHistory();
}
CSrvCliConsole::CSrvCliConsole(CPvvmudClient * cli, int cols, int rows) : CConsole(cli, cols, rows) {
m_numMsgs = 0;
m_historyPos = 0;
m_consSize = getCols()-1;
loadHistory();
}
void CSrvCliConsole::drawText() {
}
int CSrvCliConsole::getNumMsgs() {
return m_numMsgs;
}
void CSrvCliConsole::setNumMsgs(int num) {
m_numMsgs = num;
}
void CSrvCliConsole::addMsg(char * msg) {
string s = msg;
if (m_numMsgs >= m_consSize) {
m_messages.erase(m_messages.begin());
}
m_messages.push_back(msg);
m_numMsgs++;
printMsgs();
}
void CSrvCliConsole::printMsgs() {
const char * c;
clear();
for (int i=0;i<m_messages.size();i++) {
c = m_messages[i].c_str();
print((char *)c);
}
}
void CSrvCliConsole::loadHistory() {
ifstream * file = new ifstream(HISTORY_FILE);
if (!file) {
cout << "Error\n";
exit(0);
} // if
filebuf * fb = file->rdbuf();
char * buf = (char*)malloc(80);
char c = 0;
int i = 0;
while(file->get(c)) {
if (i >= 80 || c == '\n') {
string s = string(buf);
//cout << s;
m_history.push_back(s);
m_historyPos++;
i = 0;
memset(buf, 0, 80);
} // if
else {
buf[i++] = c;
} // else
} // while
file->close();
free(buf);
delete file;
}
void CSrvCliConsole::saveHistory() {
ofstream * file = new ofstream(HISTORY_FILE);
filebuf * fb = file->rdbuf();
for (int i=0;i<m_history.size();i++) {
fb->sputn(m_history[i].c_str(), m_history[i].size());
fb->sputc('\n');
} // for
file->close();
delete file;
}
void CSrvCliConsole::keyboardInput(char k) {
switch (k) {
case KEY_UP:
m_input_x = 0;
m_inputBuffer = "";
clear();
printMsgs();
if (m_historyPos > -1) {
m_historyPos--;
if (m_historyPos > -1) {
m_inputBuffer = m_history[m_historyPos];
if (getEcho()) {
char c;
int i = 0;
const char * cstr = m_inputBuffer.c_str();
while (c = cstr[i]) {
echoChar(c);
i++;
} // while
} // if
} // if
} // if
break;
case KEY_DOWN:
m_input_x = 0;
m_inputBuffer = "";
clear();
printMsgs();
if (m_historyPos == -1 || m_historyPos < m_history.size()) { // Stygt hack
m_historyPos++;
if (m_historyPos < m_history.size()) {
m_inputBuffer = m_history[m_historyPos];
if (getEcho()) {
char c;
int i = 0;
const char * cstr = m_inputBuffer.c_str();
while (c = cstr[i]) {
echoChar(c);
i++;
} // while
} // if
} // if
else {
m_inputBuffer = "";
m_input_x = 0;
} // else
}
break;
case '\r':
changeInputMode();
m_historyPos = m_history.size();
if (m_inputBuffer != "") {
setDataReady();
m_history.push_back(m_inputBuffer);
m_historyPos++;
}
break;
case '\b':
if (m_inputBuffer != "") {
m_inputBuffer.erase(m_inputBuffer.end()-1);
if (getEcho()) {
m_input_x--;
m_console[m_input_y * getRows() + m_input_x] = 0;
}
}
break;
default:
if (getEcho()) {
echoChar(k);
}
m_inputBuffer += k;
}
}

@ -0,0 +1,52 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef SRVCLICONSOLE_H
#define SRVCLICONSOLE_H
#include <vector>
#include <string>
#include "console.H"
// Subclass of CConsole for printing messages recieved from server and other clients
class CSrvCliConsole : public CConsole {
static const char * HISTORY_FILE;
int m_consSize;
int m_numMsgs;
typedef vector<string> msg_t;
msg_t m_messages;
msg_t m_history;
int m_historyPos;
public:
CSrvCliConsole(CPvvmudClient * cli);
CSrvCliConsole(CPvvmudClient * cli, int cols, int rows);
virtual void drawText();
virtual void addMsg(char * msg);
int getNumMsgs();
void setNumMsgs(int num);
void updateConsole();
void printMsgs();
void loadHistory();
void saveHistory();
virtual void keyboardInput(char k);
};
#endif // SRVCLICONSOLE_H

70
client/stdinput.C Normal file

@ -0,0 +1,70 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "stdinput.H"
#include <malloc.h>
#include <iostream.h>
// Setter standard bufferstørrelse
CStdInput::CStdInput() {
m_bufsize = m_BUFFERSIZE = 20; // Standard bufferstørrelse er 20 tegn
m_buffer = (char*)malloc(m_BUFFERSIZE);
m_sysbuffer = (char*)malloc(10);
//cin.rdbuf()->setbuf(m_sysbuffer, 10);
}
// Angir bufferstørrelse eksplisitt
CStdInput::CStdInput(int bufsize) {
m_bufsize = m_BUFFERSIZE = bufsize;
m_buffer = (char*)malloc(m_BUFFERSIZE);
m_sysbuffer = (char*)malloc(10);
//cin.rdbuf()->setbuf(m_sysbuffer, 10);
}
CStdInput::~CStdInput() {
if (m_buffer != NULL) {
free(m_buffer);
}
free (m_sysbuffer);
}
// Sjekker standard input
CStdInput::poll() {
}
CStdInput::addChar(char c) {
if (m_numchars < m_bufsize) {
// More room in buffer, add char
m_buffer[m_numchars++] = c;
}
else {
// Increase buffer size
m_buffer = (char*)realloc(m_buffer, m_bufsize+m_BUFFERSIZE);
m_buffer[m_numchars++] = c;
}
}
CStdInput::sendMsg() {
cout << m_buffer;
free(m_buffer);
m_buffer = (char*)malloc(m_BUFFERSIZE);
m_bufsize = m_BUFFERSIZE;
m_numchars = 0;
}

41
client/stdinput.H Normal file

@ -0,0 +1,41 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _STDINPUT_H_
#define _STDINPUT_H_
// Class to read from standard input (i.e. an xterm) and send the information
// to the server
class CStdInput {
int m_BUFFERSIZE; // initiell bufferstørrelse, og ant. bytest bufferet skal auke med kvar gong det blir fullt
char * m_buffer;
char * m_sysbuffer;
int m_bufsize;
int m_numchars;
public:
CStdInput(int bufsize);
CStdInput();
~CStdInput();
poll();
addChar(char c);
sendMsg();
};
#endif // _STDINPUT_H_

1
common/Makefile.am Normal file

@ -0,0 +1 @@
SUBDIRS=lib

284
common/Makefile.in Normal file

@ -0,0 +1,284 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
CXX = @CXX@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
LEX = @LEX@
MAKEINFO = @MAKEINFO@
NETLIBS = @NETLIBS@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
TIFF_CFLAGS = @TIFF_CFLAGS@
TIFF_LIBS = @TIFF_LIBS@
VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = lib
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign common/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = common
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign common/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-recursive
dvi-am:
dvi: dvi-recursive
check-am: all-am
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
install-exec-am:
install-exec: install-exec-recursive
install-data-am:
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am:
uninstall: uninstall-recursive
all-am: Makefile
all-redirect: all-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-tags distclean-generic clean-am
distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-recursive
.PHONY: install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all installdirs-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

45
common/include/action.H Normal file

@ -0,0 +1,45 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _ACTION_H
#define _ACTION_H
#include "object.H"
#include "objectlist.H"
class CAction;
class CActionList : public CObjectList {
int currId;
public:
CActionList();
CAction * getAction(int actionId);
void add(CAction * action);
};
class CAction : public CObject {
WORD id;
public:
CAction(char * name);
WORD getId(){ return id; }
void setId(WORD actionId){ id = actionId; }
virtual void execute();
};
#endif // _ACTION_H

46
common/include/bbox.H Normal file

@ -0,0 +1,46 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _BBOX_H
#define _BBOX_H
#include <iostream.h>
#include "object.H"
#include "position.H"
#include "vector.H"
class CBBox: public CObject {
CPosition p1,p2;
public:
CBBox();
CBBox(double x1,double y1, double z1, double x2, double y2, double z2);
const CPosition & getP1() const;
const CPosition & getP2() const;
void initialize(const CPosition & position);
void include(const CPosition & position);
int inside(const CPosition & position) const;
int insideXY(const CVector & position) const;
};
ostream& operator<<(ostream&s,const CBBox& b);
#endif // _BBOX_H

52
common/include/beam.H Normal file

@ -0,0 +1,52 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _BEAM_H
#define _BEAM_H
#include "object.H"
#include "vector.H"
#include "vertex.H"
#include "position.H"
#include "matrix.H"
#include "bbox.H"
class CBeam : public CObject {
CVector m_point;
CVector m_direction;
public:
CBeam();
CBeam(const CVector & point,const CVector & direction);
CBeam(const CVertex & point,const CVector & direction);
CBeam(const CPosition & point,const CVector & direction);
const CVector & getPoint() const;
const CVector & getDirection() const;
CBeam operator+ (const CPosition& position) const;
void transform(const CMatrix & transformation);
int intersect(const CBBox & bBox) const;
};
ostream& operator<<(ostream&s,const CBeam& b);
#endif // _BEAM_H

242
common/include/bf_locl.h Normal file

@ -0,0 +1,242 @@
/* crypto/bf/bf_locl.org */
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
* Always modify bf_locl.org since bf_locl.h is automatically generated from
* it during SSLeay configuration.
*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*/
/* Special defines which change the way the code is built depending on the
CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */
# define BF_PTR
#elif defined( __ultrix ) /* Older MIPS */
# define BF_PTR
#elif defined( __osf1__ ) /* Alpha */
/* None */
#elif defined ( _AIX ) /* RS6000 */
/* Unknown */
#elif defined( __hpux ) /* HP-PA */
/* None */
#elif defined( __aux ) /* 68K */
/* Unknown */
#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
/* Unknown */
#elif defined( __sgi ) /* Newer MIPS */
# define BF_PTR
#elif defined( i386 ) /* x86 boxes, should be gcc */
#elif defined( _MSC_VER ) /* x86 boxes, Visual C */
#endif /* Systems-specific speed defines */
#undef c2l
#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
l|=((unsigned long)(*((c)++)))<< 8L, \
l|=((unsigned long)(*((c)++)))<<16L, \
l|=((unsigned long)(*((c)++)))<<24L)
/* NOTE - c is not incremented as per c2l */
#undef c2ln
#define c2ln(c,l1,l2,n) { \
c+=n; \
l1=l2=0; \
switch (n) { \
case 8: l2 =((unsigned long)(*(--(c))))<<24L; \
case 7: l2|=((unsigned long)(*(--(c))))<<16L; \
case 6: l2|=((unsigned long)(*(--(c))))<< 8L; \
case 5: l2|=((unsigned long)(*(--(c)))); \
case 4: l1 =((unsigned long)(*(--(c))))<<24L; \
case 3: l1|=((unsigned long)(*(--(c))))<<16L; \
case 2: l1|=((unsigned long)(*(--(c))))<< 8L; \
case 1: l1|=((unsigned long)(*(--(c)))); \
} \
}
#undef l2c
#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
*((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>>24L)&0xff))
/* NOTE - c is not incremented as per l2c */
#undef l2cn
#define l2cn(l1,l2,c,n) { \
c+=n; \
switch (n) { \
case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
} \
}
/* NOTE - c is not incremented as per n2l */
#define n2ln(c,l1,l2,n) { \
c+=n; \
l1=l2=0; \
switch (n) { \
case 8: l2 =((unsigned long)(*(--(c)))) ; \
case 7: l2|=((unsigned long)(*(--(c))))<< 8; \
case 6: l2|=((unsigned long)(*(--(c))))<<16; \
case 5: l2|=((unsigned long)(*(--(c))))<<24; \
case 4: l1 =((unsigned long)(*(--(c)))) ; \
case 3: l1|=((unsigned long)(*(--(c))))<< 8; \
case 2: l1|=((unsigned long)(*(--(c))))<<16; \
case 1: l1|=((unsigned long)(*(--(c))))<<24; \
} \
}
/* NOTE - c is not incremented as per l2n */
#define l2nn(l1,l2,c,n) { \
c+=n; \
switch (n) { \
case 8: *(--(c))=(unsigned char)(((l2) )&0xff); \
case 7: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
case 6: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
case 5: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
case 4: *(--(c))=(unsigned char)(((l1) )&0xff); \
case 3: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
case 2: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
case 1: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
} \
}
#undef n2l
#define n2l(c,l) (l =((unsigned long)(*((c)++)))<<24L, \
l|=((unsigned long)(*((c)++)))<<16L, \
l|=((unsigned long)(*((c)++)))<< 8L, \
l|=((unsigned long)(*((c)++))))
#undef l2n
#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
*((c)++)=(unsigned char)(((l) )&0xff))
/* This is actually a big endian algorithm, the most significate byte
* is used to lookup array 0 */
/* use BF_PTR2 for intel boxes,
* BF_PTR for sparc and MIPS/SGI
* use nothing for Alpha and HP.
*/
#if !defined(BF_PTR) && !defined(BF_PTR2)
#define BF_PTR2
#endif
#define BF_M 0x3fc
#define BF_0 22L
#define BF_1 14L
#define BF_2 6L
#define BF_3 2L /* left shift */
#if defined(BF_PTR2)
/* This is basically a special pentium verson */
#define BF_ENC(LL,R,S,P) \
{ \
BF_LONG t,u,v; \
u=R>>BF_0; \
v=R>>BF_1; \
u&=BF_M; \
v&=BF_M; \
t= *(BF_LONG *)((unsigned char *)&(S[ 0])+u); \
u=R>>BF_2; \
t+= *(BF_LONG *)((unsigned char *)&(S[256])+v); \
v=R<<BF_3; \
u&=BF_M; \
v&=BF_M; \
t^= *(BF_LONG *)((unsigned char *)&(S[512])+u); \
LL^=P; \
t+= *(BF_LONG *)((unsigned char *)&(S[768])+v); \
LL^=t; \
}
#elif defined(BF_PTR)
/* This is normally very good */
#define BF_ENC(LL,R,S,P) \
LL^=P; \
LL^= (((*(BF_LONG *)((unsigned char *)&(S[ 0])+((R>>BF_0)&BF_M))+ \
*(BF_LONG *)((unsigned char *)&(S[256])+((R>>BF_1)&BF_M)))^ \
*(BF_LONG *)((unsigned char *)&(S[512])+((R>>BF_2)&BF_M)))+ \
*(BF_LONG *)((unsigned char *)&(S[768])+((R<<BF_3)&BF_M)));
#else
/* This will always work, even on 64 bit machines and strangly enough,
* on the Alpha it is faster than the pointer versions (both 32 and 64
* versions of BF_LONG) */
#define BF_ENC(LL,R,S,P) \
LL^=P; \
LL^=((( S[ (int)(R>>24L) ] + \
S[0x0100+((int)(R>>16L)&0xff)])^ \
S[0x0200+((int)(R>> 8L)&0xff)])+ \
S[0x0300+((int)(R )&0xff)])&0xffffffffL;
#endif

325
common/include/bf_pi.h Normal file

@ -0,0 +1,325 @@
/* crypto/bf/bf_pi.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
static BF_KEY bf_init= {
{
0x243f6a88L, 0x85a308d3L, 0x13198a2eL, 0x03707344L,
0xa4093822L, 0x299f31d0L, 0x082efa98L, 0xec4e6c89L,
0x452821e6L, 0x38d01377L, 0xbe5466cfL, 0x34e90c6cL,
0xc0ac29b7L, 0xc97c50ddL, 0x3f84d5b5L, 0xb5470917L,
0x9216d5d9L, 0x8979fb1b
},{
0xd1310ba6L, 0x98dfb5acL, 0x2ffd72dbL, 0xd01adfb7L,
0xb8e1afedL, 0x6a267e96L, 0xba7c9045L, 0xf12c7f99L,
0x24a19947L, 0xb3916cf7L, 0x0801f2e2L, 0x858efc16L,
0x636920d8L, 0x71574e69L, 0xa458fea3L, 0xf4933d7eL,
0x0d95748fL, 0x728eb658L, 0x718bcd58L, 0x82154aeeL,
0x7b54a41dL, 0xc25a59b5L, 0x9c30d539L, 0x2af26013L,
0xc5d1b023L, 0x286085f0L, 0xca417918L, 0xb8db38efL,
0x8e79dcb0L, 0x603a180eL, 0x6c9e0e8bL, 0xb01e8a3eL,
0xd71577c1L, 0xbd314b27L, 0x78af2fdaL, 0x55605c60L,
0xe65525f3L, 0xaa55ab94L, 0x57489862L, 0x63e81440L,
0x55ca396aL, 0x2aab10b6L, 0xb4cc5c34L, 0x1141e8ceL,
0xa15486afL, 0x7c72e993L, 0xb3ee1411L, 0x636fbc2aL,
0x2ba9c55dL, 0x741831f6L, 0xce5c3e16L, 0x9b87931eL,
0xafd6ba33L, 0x6c24cf5cL, 0x7a325381L, 0x28958677L,
0x3b8f4898L, 0x6b4bb9afL, 0xc4bfe81bL, 0x66282193L,
0x61d809ccL, 0xfb21a991L, 0x487cac60L, 0x5dec8032L,
0xef845d5dL, 0xe98575b1L, 0xdc262302L, 0xeb651b88L,
0x23893e81L, 0xd396acc5L, 0x0f6d6ff3L, 0x83f44239L,
0x2e0b4482L, 0xa4842004L, 0x69c8f04aL, 0x9e1f9b5eL,
0x21c66842L, 0xf6e96c9aL, 0x670c9c61L, 0xabd388f0L,
0x6a51a0d2L, 0xd8542f68L, 0x960fa728L, 0xab5133a3L,
0x6eef0b6cL, 0x137a3be4L, 0xba3bf050L, 0x7efb2a98L,
0xa1f1651dL, 0x39af0176L, 0x66ca593eL, 0x82430e88L,
0x8cee8619L, 0x456f9fb4L, 0x7d84a5c3L, 0x3b8b5ebeL,
0xe06f75d8L, 0x85c12073L, 0x401a449fL, 0x56c16aa6L,
0x4ed3aa62L, 0x363f7706L, 0x1bfedf72L, 0x429b023dL,
0x37d0d724L, 0xd00a1248L, 0xdb0fead3L, 0x49f1c09bL,
0x075372c9L, 0x80991b7bL, 0x25d479d8L, 0xf6e8def7L,
0xe3fe501aL, 0xb6794c3bL, 0x976ce0bdL, 0x04c006baL,
0xc1a94fb6L, 0x409f60c4L, 0x5e5c9ec2L, 0x196a2463L,
0x68fb6fafL, 0x3e6c53b5L, 0x1339b2ebL, 0x3b52ec6fL,
0x6dfc511fL, 0x9b30952cL, 0xcc814544L, 0xaf5ebd09L,
0xbee3d004L, 0xde334afdL, 0x660f2807L, 0x192e4bb3L,
0xc0cba857L, 0x45c8740fL, 0xd20b5f39L, 0xb9d3fbdbL,
0x5579c0bdL, 0x1a60320aL, 0xd6a100c6L, 0x402c7279L,
0x679f25feL, 0xfb1fa3ccL, 0x8ea5e9f8L, 0xdb3222f8L,
0x3c7516dfL, 0xfd616b15L, 0x2f501ec8L, 0xad0552abL,
0x323db5faL, 0xfd238760L, 0x53317b48L, 0x3e00df82L,
0x9e5c57bbL, 0xca6f8ca0L, 0x1a87562eL, 0xdf1769dbL,
0xd542a8f6L, 0x287effc3L, 0xac6732c6L, 0x8c4f5573L,
0x695b27b0L, 0xbbca58c8L, 0xe1ffa35dL, 0xb8f011a0L,
0x10fa3d98L, 0xfd2183b8L, 0x4afcb56cL, 0x2dd1d35bL,
0x9a53e479L, 0xb6f84565L, 0xd28e49bcL, 0x4bfb9790L,
0xe1ddf2daL, 0xa4cb7e33L, 0x62fb1341L, 0xcee4c6e8L,
0xef20cadaL, 0x36774c01L, 0xd07e9efeL, 0x2bf11fb4L,
0x95dbda4dL, 0xae909198L, 0xeaad8e71L, 0x6b93d5a0L,
0xd08ed1d0L, 0xafc725e0L, 0x8e3c5b2fL, 0x8e7594b7L,
0x8ff6e2fbL, 0xf2122b64L, 0x8888b812L, 0x900df01cL,
0x4fad5ea0L, 0x688fc31cL, 0xd1cff191L, 0xb3a8c1adL,
0x2f2f2218L, 0xbe0e1777L, 0xea752dfeL, 0x8b021fa1L,
0xe5a0cc0fL, 0xb56f74e8L, 0x18acf3d6L, 0xce89e299L,
0xb4a84fe0L, 0xfd13e0b7L, 0x7cc43b81L, 0xd2ada8d9L,
0x165fa266L, 0x80957705L, 0x93cc7314L, 0x211a1477L,
0xe6ad2065L, 0x77b5fa86L, 0xc75442f5L, 0xfb9d35cfL,
0xebcdaf0cL, 0x7b3e89a0L, 0xd6411bd3L, 0xae1e7e49L,
0x00250e2dL, 0x2071b35eL, 0x226800bbL, 0x57b8e0afL,
0x2464369bL, 0xf009b91eL, 0x5563911dL, 0x59dfa6aaL,
0x78c14389L, 0xd95a537fL, 0x207d5ba2L, 0x02e5b9c5L,
0x83260376L, 0x6295cfa9L, 0x11c81968L, 0x4e734a41L,
0xb3472dcaL, 0x7b14a94aL, 0x1b510052L, 0x9a532915L,
0xd60f573fL, 0xbc9bc6e4L, 0x2b60a476L, 0x81e67400L,
0x08ba6fb5L, 0x571be91fL, 0xf296ec6bL, 0x2a0dd915L,
0xb6636521L, 0xe7b9f9b6L, 0xff34052eL, 0xc5855664L,
0x53b02d5dL, 0xa99f8fa1L, 0x08ba4799L, 0x6e85076aL,
0x4b7a70e9L, 0xb5b32944L, 0xdb75092eL, 0xc4192623L,
0xad6ea6b0L, 0x49a7df7dL, 0x9cee60b8L, 0x8fedb266L,
0xecaa8c71L, 0x699a17ffL, 0x5664526cL, 0xc2b19ee1L,
0x193602a5L, 0x75094c29L, 0xa0591340L, 0xe4183a3eL,
0x3f54989aL, 0x5b429d65L, 0x6b8fe4d6L, 0x99f73fd6L,
0xa1d29c07L, 0xefe830f5L, 0x4d2d38e6L, 0xf0255dc1L,
0x4cdd2086L, 0x8470eb26L, 0x6382e9c6L, 0x021ecc5eL,
0x09686b3fL, 0x3ebaefc9L, 0x3c971814L, 0x6b6a70a1L,
0x687f3584L, 0x52a0e286L, 0xb79c5305L, 0xaa500737L,
0x3e07841cL, 0x7fdeae5cL, 0x8e7d44ecL, 0x5716f2b8L,
0xb03ada37L, 0xf0500c0dL, 0xf01c1f04L, 0x0200b3ffL,
0xae0cf51aL, 0x3cb574b2L, 0x25837a58L, 0xdc0921bdL,
0xd19113f9L, 0x7ca92ff6L, 0x94324773L, 0x22f54701L,
0x3ae5e581L, 0x37c2dadcL, 0xc8b57634L, 0x9af3dda7L,
0xa9446146L, 0x0fd0030eL, 0xecc8c73eL, 0xa4751e41L,
0xe238cd99L, 0x3bea0e2fL, 0x3280bba1L, 0x183eb331L,
0x4e548b38L, 0x4f6db908L, 0x6f420d03L, 0xf60a04bfL,
0x2cb81290L, 0x24977c79L, 0x5679b072L, 0xbcaf89afL,
0xde9a771fL, 0xd9930810L, 0xb38bae12L, 0xdccf3f2eL,
0x5512721fL, 0x2e6b7124L, 0x501adde6L, 0x9f84cd87L,
0x7a584718L, 0x7408da17L, 0xbc9f9abcL, 0xe94b7d8cL,
0xec7aec3aL, 0xdb851dfaL, 0x63094366L, 0xc464c3d2L,
0xef1c1847L, 0x3215d908L, 0xdd433b37L, 0x24c2ba16L,
0x12a14d43L, 0x2a65c451L, 0x50940002L, 0x133ae4ddL,
0x71dff89eL, 0x10314e55L, 0x81ac77d6L, 0x5f11199bL,
0x043556f1L, 0xd7a3c76bL, 0x3c11183bL, 0x5924a509L,
0xf28fe6edL, 0x97f1fbfaL, 0x9ebabf2cL, 0x1e153c6eL,
0x86e34570L, 0xeae96fb1L, 0x860e5e0aL, 0x5a3e2ab3L,
0x771fe71cL, 0x4e3d06faL, 0x2965dcb9L, 0x99e71d0fL,
0x803e89d6L, 0x5266c825L, 0x2e4cc978L, 0x9c10b36aL,
0xc6150ebaL, 0x94e2ea78L, 0xa5fc3c53L, 0x1e0a2df4L,
0xf2f74ea7L, 0x361d2b3dL, 0x1939260fL, 0x19c27960L,
0x5223a708L, 0xf71312b6L, 0xebadfe6eL, 0xeac31f66L,
0xe3bc4595L, 0xa67bc883L, 0xb17f37d1L, 0x018cff28L,
0xc332ddefL, 0xbe6c5aa5L, 0x65582185L, 0x68ab9802L,
0xeecea50fL, 0xdb2f953bL, 0x2aef7dadL, 0x5b6e2f84L,
0x1521b628L, 0x29076170L, 0xecdd4775L, 0x619f1510L,
0x13cca830L, 0xeb61bd96L, 0x0334fe1eL, 0xaa0363cfL,
0xb5735c90L, 0x4c70a239L, 0xd59e9e0bL, 0xcbaade14L,
0xeecc86bcL, 0x60622ca7L, 0x9cab5cabL, 0xb2f3846eL,
0x648b1eafL, 0x19bdf0caL, 0xa02369b9L, 0x655abb50L,
0x40685a32L, 0x3c2ab4b3L, 0x319ee9d5L, 0xc021b8f7L,
0x9b540b19L, 0x875fa099L, 0x95f7997eL, 0x623d7da8L,
0xf837889aL, 0x97e32d77L, 0x11ed935fL, 0x16681281L,
0x0e358829L, 0xc7e61fd6L, 0x96dedfa1L, 0x7858ba99L,
0x57f584a5L, 0x1b227263L, 0x9b83c3ffL, 0x1ac24696L,
0xcdb30aebL, 0x532e3054L, 0x8fd948e4L, 0x6dbc3128L,
0x58ebf2efL, 0x34c6ffeaL, 0xfe28ed61L, 0xee7c3c73L,
0x5d4a14d9L, 0xe864b7e3L, 0x42105d14L, 0x203e13e0L,
0x45eee2b6L, 0xa3aaabeaL, 0xdb6c4f15L, 0xfacb4fd0L,
0xc742f442L, 0xef6abbb5L, 0x654f3b1dL, 0x41cd2105L,
0xd81e799eL, 0x86854dc7L, 0xe44b476aL, 0x3d816250L,
0xcf62a1f2L, 0x5b8d2646L, 0xfc8883a0L, 0xc1c7b6a3L,
0x7f1524c3L, 0x69cb7492L, 0x47848a0bL, 0x5692b285L,
0x095bbf00L, 0xad19489dL, 0x1462b174L, 0x23820e00L,
0x58428d2aL, 0x0c55f5eaL, 0x1dadf43eL, 0x233f7061L,
0x3372f092L, 0x8d937e41L, 0xd65fecf1L, 0x6c223bdbL,
0x7cde3759L, 0xcbee7460L, 0x4085f2a7L, 0xce77326eL,
0xa6078084L, 0x19f8509eL, 0xe8efd855L, 0x61d99735L,
0xa969a7aaL, 0xc50c06c2L, 0x5a04abfcL, 0x800bcadcL,
0x9e447a2eL, 0xc3453484L, 0xfdd56705L, 0x0e1e9ec9L,
0xdb73dbd3L, 0x105588cdL, 0x675fda79L, 0xe3674340L,
0xc5c43465L, 0x713e38d8L, 0x3d28f89eL, 0xf16dff20L,
0x153e21e7L, 0x8fb03d4aL, 0xe6e39f2bL, 0xdb83adf7L,
0xe93d5a68L, 0x948140f7L, 0xf64c261cL, 0x94692934L,
0x411520f7L, 0x7602d4f7L, 0xbcf46b2eL, 0xd4a20068L,
0xd4082471L, 0x3320f46aL, 0x43b7d4b7L, 0x500061afL,
0x1e39f62eL, 0x97244546L, 0x14214f74L, 0xbf8b8840L,
0x4d95fc1dL, 0x96b591afL, 0x70f4ddd3L, 0x66a02f45L,
0xbfbc09ecL, 0x03bd9785L, 0x7fac6dd0L, 0x31cb8504L,
0x96eb27b3L, 0x55fd3941L, 0xda2547e6L, 0xabca0a9aL,
0x28507825L, 0x530429f4L, 0x0a2c86daL, 0xe9b66dfbL,
0x68dc1462L, 0xd7486900L, 0x680ec0a4L, 0x27a18deeL,
0x4f3ffea2L, 0xe887ad8cL, 0xb58ce006L, 0x7af4d6b6L,
0xaace1e7cL, 0xd3375fecL, 0xce78a399L, 0x406b2a42L,
0x20fe9e35L, 0xd9f385b9L, 0xee39d7abL, 0x3b124e8bL,
0x1dc9faf7L, 0x4b6d1856L, 0x26a36631L, 0xeae397b2L,
0x3a6efa74L, 0xdd5b4332L, 0x6841e7f7L, 0xca7820fbL,
0xfb0af54eL, 0xd8feb397L, 0x454056acL, 0xba489527L,
0x55533a3aL, 0x20838d87L, 0xfe6ba9b7L, 0xd096954bL,
0x55a867bcL, 0xa1159a58L, 0xcca92963L, 0x99e1db33L,
0xa62a4a56L, 0x3f3125f9L, 0x5ef47e1cL, 0x9029317cL,
0xfdf8e802L, 0x04272f70L, 0x80bb155cL, 0x05282ce3L,
0x95c11548L, 0xe4c66d22L, 0x48c1133fL, 0xc70f86dcL,
0x07f9c9eeL, 0x41041f0fL, 0x404779a4L, 0x5d886e17L,
0x325f51ebL, 0xd59bc0d1L, 0xf2bcc18fL, 0x41113564L,
0x257b7834L, 0x602a9c60L, 0xdff8e8a3L, 0x1f636c1bL,
0x0e12b4c2L, 0x02e1329eL, 0xaf664fd1L, 0xcad18115L,
0x6b2395e0L, 0x333e92e1L, 0x3b240b62L, 0xeebeb922L,
0x85b2a20eL, 0xe6ba0d99L, 0xde720c8cL, 0x2da2f728L,
0xd0127845L, 0x95b794fdL, 0x647d0862L, 0xe7ccf5f0L,
0x5449a36fL, 0x877d48faL, 0xc39dfd27L, 0xf33e8d1eL,
0x0a476341L, 0x992eff74L, 0x3a6f6eabL, 0xf4f8fd37L,
0xa812dc60L, 0xa1ebddf8L, 0x991be14cL, 0xdb6e6b0dL,
0xc67b5510L, 0x6d672c37L, 0x2765d43bL, 0xdcd0e804L,
0xf1290dc7L, 0xcc00ffa3L, 0xb5390f92L, 0x690fed0bL,
0x667b9ffbL, 0xcedb7d9cL, 0xa091cf0bL, 0xd9155ea3L,
0xbb132f88L, 0x515bad24L, 0x7b9479bfL, 0x763bd6ebL,
0x37392eb3L, 0xcc115979L, 0x8026e297L, 0xf42e312dL,
0x6842ada7L, 0xc66a2b3bL, 0x12754cccL, 0x782ef11cL,
0x6a124237L, 0xb79251e7L, 0x06a1bbe6L, 0x4bfb6350L,
0x1a6b1018L, 0x11caedfaL, 0x3d25bdd8L, 0xe2e1c3c9L,
0x44421659L, 0x0a121386L, 0xd90cec6eL, 0xd5abea2aL,
0x64af674eL, 0xda86a85fL, 0xbebfe988L, 0x64e4c3feL,
0x9dbc8057L, 0xf0f7c086L, 0x60787bf8L, 0x6003604dL,
0xd1fd8346L, 0xf6381fb0L, 0x7745ae04L, 0xd736fcccL,
0x83426b33L, 0xf01eab71L, 0xb0804187L, 0x3c005e5fL,
0x77a057beL, 0xbde8ae24L, 0x55464299L, 0xbf582e61L,
0x4e58f48fL, 0xf2ddfda2L, 0xf474ef38L, 0x8789bdc2L,
0x5366f9c3L, 0xc8b38e74L, 0xb475f255L, 0x46fcd9b9L,
0x7aeb2661L, 0x8b1ddf84L, 0x846a0e79L, 0x915f95e2L,
0x466e598eL, 0x20b45770L, 0x8cd55591L, 0xc902de4cL,
0xb90bace1L, 0xbb8205d0L, 0x11a86248L, 0x7574a99eL,
0xb77f19b6L, 0xe0a9dc09L, 0x662d09a1L, 0xc4324633L,
0xe85a1f02L, 0x09f0be8cL, 0x4a99a025L, 0x1d6efe10L,
0x1ab93d1dL, 0x0ba5a4dfL, 0xa186f20fL, 0x2868f169L,
0xdcb7da83L, 0x573906feL, 0xa1e2ce9bL, 0x4fcd7f52L,
0x50115e01L, 0xa70683faL, 0xa002b5c4L, 0x0de6d027L,
0x9af88c27L, 0x773f8641L, 0xc3604c06L, 0x61a806b5L,
0xf0177a28L, 0xc0f586e0L, 0x006058aaL, 0x30dc7d62L,
0x11e69ed7L, 0x2338ea63L, 0x53c2dd94L, 0xc2c21634L,
0xbbcbee56L, 0x90bcb6deL, 0xebfc7da1L, 0xce591d76L,
0x6f05e409L, 0x4b7c0188L, 0x39720a3dL, 0x7c927c24L,
0x86e3725fL, 0x724d9db9L, 0x1ac15bb4L, 0xd39eb8fcL,
0xed545578L, 0x08fca5b5L, 0xd83d7cd3L, 0x4dad0fc4L,
0x1e50ef5eL, 0xb161e6f8L, 0xa28514d9L, 0x6c51133cL,
0x6fd5c7e7L, 0x56e14ec4L, 0x362abfceL, 0xddc6c837L,
0xd79a3234L, 0x92638212L, 0x670efa8eL, 0x406000e0L,
0x3a39ce37L, 0xd3faf5cfL, 0xabc27737L, 0x5ac52d1bL,
0x5cb0679eL, 0x4fa33742L, 0xd3822740L, 0x99bc9bbeL,
0xd5118e9dL, 0xbf0f7315L, 0xd62d1c7eL, 0xc700c47bL,
0xb78c1b6bL, 0x21a19045L, 0xb26eb1beL, 0x6a366eb4L,
0x5748ab2fL, 0xbc946e79L, 0xc6a376d2L, 0x6549c2c8L,
0x530ff8eeL, 0x468dde7dL, 0xd5730a1dL, 0x4cd04dc6L,
0x2939bbdbL, 0xa9ba4650L, 0xac9526e8L, 0xbe5ee304L,
0xa1fad5f0L, 0x6a2d519aL, 0x63ef8ce2L, 0x9a86ee22L,
0xc089c2b8L, 0x43242ef6L, 0xa51e03aaL, 0x9cf2d0a4L,
0x83c061baL, 0x9be96a4dL, 0x8fe51550L, 0xba645bd6L,
0x2826a2f9L, 0xa73a3ae1L, 0x4ba99586L, 0xef5562e9L,
0xc72fefd3L, 0xf752f7daL, 0x3f046f69L, 0x77fa0a59L,
0x80e4a915L, 0x87b08601L, 0x9b09e6adL, 0x3b3ee593L,
0xe990fd5aL, 0x9e34d797L, 0x2cf0b7d9L, 0x022b8b51L,
0x96d5ac3aL, 0x017da67dL, 0xd1cf3ed6L, 0x7c7d2d28L,
0x1f9f25cfL, 0xadf2b89bL, 0x5ad6b472L, 0x5a88f54cL,
0xe029ac71L, 0xe019a5e6L, 0x47b0acfdL, 0xed93fa9bL,
0xe8d3c48dL, 0x283b57ccL, 0xf8d56629L, 0x79132e28L,
0x785f0191L, 0xed756055L, 0xf7960e44L, 0xe3d35e8cL,
0x15056dd4L, 0x88f46dbaL, 0x03a16125L, 0x0564f0bdL,
0xc3eb9e15L, 0x3c9057a2L, 0x97271aecL, 0xa93a072aL,
0x1b3f6d9bL, 0x1e6321f5L, 0xf59c66fbL, 0x26dcf319L,
0x7533d928L, 0xb155fdf5L, 0x03563482L, 0x8aba3cbbL,
0x28517711L, 0xc20ad9f8L, 0xabcc5167L, 0xccad925fL,
0x4de81751L, 0x3830dc8eL, 0x379d5862L, 0x9320f991L,
0xea7a90c2L, 0xfb3e7bceL, 0x5121ce64L, 0x774fbe32L,
0xa8b6e37eL, 0xc3293d46L, 0x48de5369L, 0x6413e680L,
0xa2ae0810L, 0xdd6db224L, 0x69852dfdL, 0x09072166L,
0xb39a460aL, 0x6445c0ddL, 0x586cdecfL, 0x1c20c8aeL,
0x5bbef7ddL, 0x1b588d40L, 0xccd2017fL, 0x6bb4e3bbL,
0xdda26a7eL, 0x3a59ff45L, 0x3e350a44L, 0xbcb4cdd5L,
0x72eacea8L, 0xfa6484bbL, 0x8d6612aeL, 0xbf3c6f47L,
0xd29be463L, 0x542f5d9eL, 0xaec2771bL, 0xf64e6370L,
0x740e0d8dL, 0xe75b1357L, 0xf8721671L, 0xaf537d5dL,
0x4040cb08L, 0x4eb4e2ccL, 0x34d2466aL, 0x0115af84L,
0xe1b00428L, 0x95983a1dL, 0x06b89fb4L, 0xce6ea048L,
0x6f3f3b82L, 0x3520ab82L, 0x011a1d4bL, 0x277227f8L,
0x611560b1L, 0xe7933fdcL, 0xbb3a792bL, 0x344525bdL,
0xa08839e1L, 0x51ce794bL, 0x2f32c9b7L, 0xa01fbac9L,
0xe01cc87eL, 0xbcc7d1f6L, 0xcf0111c3L, 0xa1e8aac7L,
0x1a908749L, 0xd44fbd9aL, 0xd0dadecbL, 0xd50ada38L,
0x0339c32aL, 0xc6913667L, 0x8df9317cL, 0xe0b12b4fL,
0xf79e59b7L, 0x43f5bb3aL, 0xf2d519ffL, 0x27d9459cL,
0xbf97222cL, 0x15e6fc2aL, 0x0f91fc71L, 0x9b941525L,
0xfae59361L, 0xceb69cebL, 0xc2a86459L, 0x12baa8d1L,
0xb6c1075eL, 0xe3056a0cL, 0x10d25065L, 0xcb03a442L,
0xe0ec6e0eL, 0x1698db3bL, 0x4c98a0beL, 0x3278e964L,
0x9f1f9532L, 0xe0d392dfL, 0xd3a0342bL, 0x8971f21eL,
0x1b0a7441L, 0x4ba3348cL, 0xc5be7120L, 0xc37632d8L,
0xdf359f8dL, 0x9b992f2eL, 0xe60b6f47L, 0x0fe3f11dL,
0xe54cda54L, 0x1edad891L, 0xce6279cfL, 0xcd3e7e6fL,
0x1618b166L, 0xfd2c1d05L, 0x848fd2c5L, 0xf6fb2299L,
0xf523f357L, 0xa6327623L, 0x93a83531L, 0x56cccd02L,
0xacf08162L, 0x5a75ebb5L, 0x6e163697L, 0x88d273ccL,
0xde966292L, 0x81b949d0L, 0x4c50901bL, 0x71c65614L,
0xe6c6c7bdL, 0x327a140aL, 0x45e1d006L, 0xc3f27b9aL,
0xc9aa53fdL, 0x62a80f00L, 0xbb25bfe2L, 0x35bdd2f6L,
0x71126905L, 0xb2040222L, 0xb6cbcf7cL, 0xcd769c2bL,
0x53113ec0L, 0x1640e3d3L, 0x38abbd60L, 0x2547adf0L,
0xba38209cL, 0xf746ce76L, 0x77afa1c5L, 0x20756060L,
0x85cbfe4eL, 0x8ae88dd8L, 0x7aaaf9b0L, 0x4cf9aa7eL,
0x1948c25cL, 0x02fb8a8cL, 0x01c36ae4L, 0xd6ebe1f9L,
0x90d4f869L, 0xa65cdea0L, 0x3f09252dL, 0xc208e69fL,
0xb74e6132L, 0xce77e25bL, 0x578fdfe3L, 0x3ac372e6L,
}
};

116
common/include/blowfish.h Normal file

@ -0,0 +1,116 @@
/* crypto/bf/blowfish.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_BLOWFISH_H
#define HEADER_BLOWFISH_H
#ifdef __cplusplus
extern "C" {
#endif
#define BF_ENCRYPT 1
#define BF_DECRYPT 0
/* If you make this 'unsigned int' the pointer variants will work on
* the Alpha, otherwise they will not. Strangly using the '8 byte'
* BF_LONG and the default 'non-pointer' inner loop is the best configuration
* for the Alpha */
#define BF_LONG unsigned long
#define BF_ROUNDS 16
#define BF_BLOCK 8
typedef struct bf_key_st
{
BF_LONG P[BF_ROUNDS+2];
BF_LONG S[4*256];
} BF_KEY;
#ifndef NOPROTO
void BF_set_key(BF_KEY *key, int len, unsigned char *data);
void BF_ecb_encrypt(unsigned char *in,unsigned char *out,BF_KEY *key,
int enc);
void BF_encrypt(BF_LONG *data,BF_KEY *key);
void BF_decrypt(BF_LONG *data,BF_KEY *key);
void BF_cbc_encrypt(unsigned char *in, unsigned char *out, long length,
BF_KEY *ks, unsigned char *iv, int enc);
void BF_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
BF_KEY *schedule, unsigned char *ivec, int *num, int enc);
void BF_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
BF_KEY *schedule, unsigned char *ivec, int *num);
char *BF_options(void);
#else
void BF_set_key();
void BF_ecb_encrypt();
void BF_encrypt();
void BF_decrypt();
void BF_cbc_encrypt();
void BF_cfb64_encrypt();
void BF_ofb64_encrypt();
char *BF_options();
#endif
#ifdef __cplusplus
}
#endif
#endif

28
common/include/bogfile.H Normal file

@ -0,0 +1,28 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _BOGFILE_H
#define _BOGFILE_H
typedef enum {PT_Polygon,PT_Triangles,PT_Quads,PT_Quad_strip,
PT_Triangle_strip,PT_Triangle_fan} PolyType_t;
#endif /* _BOGFILE_H */

50
common/include/bsdtree.H Normal file

@ -0,0 +1,50 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _BSDTREE_H
#define _BSDTREE_H
#include <stdio.h>
#include "object.H"
#include "position.H"
class CBSDTreeNode : public CObject {
double a,b,c,d;
CBSDTreeNode *inNode,*outNode;
public:
CBSDTreeNode(double a, double b, double c, double d);
void setInChild(CBSDTreeNode * inNode){ this->inNode = inNode; }
void setOutChild(CBSDTreeNode * outNode){ this->outNode = outNode; }
int inside(double x, double y, double z);
};
class CBSDTree: public CObject {
CBSDTreeNode * BSDTree;
public:
CBSDTree();
int load(char * fileName);
CBSDTreeNode * loadNode(FILE * bsdFile);
int inside(double x, double y, double z);
int inside(const CPosition & position);
};
#endif // _BSDTREE_H

46
common/include/cache.H Normal file

@ -0,0 +1,46 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CACHE_H
#define _CACHE_H
#include "objectlist.H"
class CCacheItem {
int m_id;
CObject * m_item;
public:
CCacheItem(int id,CObject * item) { m_id = id; m_item = item; }
int getId(){ return m_id; }
CObject * setItem(CObject * item){ CObject * old = m_item; m_item = item; return old;}
CObject * getItem() { return m_item; }
};
class CCache : public CObject {
CObjectList * cache;
public:
CCache();
virtual CObject * failFunc(int id);
CObject * add(int id, CObject * item);
CObject * get(int id);
void clear();
};
#endif /* _CACHE_H */

53
common/include/cellpvs.H Normal file

@ -0,0 +1,53 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CELLPVS_H
#define _CELLPVS_H
#include "objectlist.H"
#include "position.H"
class CWorldWorld;
class CWorldObject;
class CPVCell : public CObject {
DWORD m_cellId;
CPosition m_position;
public:
CPVCell(DWORD cellId, const CPosition & position);
DWORD getCellId();
CPosition getPosition();
};
class CCellPVS : private CObjectList {
CWorldWorld * m_world;
public:
CCellPVS(CWorldWorld * world);
CWorldWorld * getWorld();
CPVCell* addPVCell(DWORD cellId, const CPosition & position);
CObjectListItem * getFirstPVCell();
CPosition getPVCellPosition(CWorldObject * cell);
CWorldObject * findCell(CPosition * position);
};
#endif // _CELLPVS_H

@ -0,0 +1,61 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _COMMANDPARSER_H
#define _COMMANDPARSER_H
#include <vector>
#include <string>
class CCommandParser {
typedef vector<string> argv_t;
typedef void (CCommandParser::*CommandFunc_t)(argv_t & argv);
class CCommand {
string m_commandString;
CommandFunc_t m_commandFunc;
public:
CCommand(string & commandString,CommandFunc_t commandFunc);
string & getCommandString();
void executeCommand(argv_t & argv,CCommandParser * parser);
};
typedef vector<CCommand> CommandList_t;
CommandList_t m_commandList;
char m_commandPrefix;
public:
CCommandParser();
void parseCommand(const string & commandString);
void setCommandPrefix(char commandPrefix);
virtual void commandChat(const string & chatMessage);
virtual void commandUnknown(const string & commandString);
protected:
void addCommand(string commandString,CommandFunc_t commandFunc);
private:
void createArgv(string & argString, argv_t & argv);
};
#endif // _COMMANDPARSER_H

@ -0,0 +1,76 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _COMMUNICATE_H
#define _COMMUNICATE_H
#include "timekeeper.H"
#include "manager.H"
#include "stream.H"
#include "objectqueue.H"
#include "message.H"
#include "socket.H"
#include "messagelist.H"
class CBadProtocolException : public CException {
public:
CBadProtocolException();
};
class CCommunicate : public CTimeKeeperItem {
CManager * manager;
CStream * stream;
CSocket * m_socket;
CTimeKeeper * m_timeKeeper;
// Write message variables
CObjectQueue * msgWriteQueue;
CMessage *currWriteMsg;
int currWriteDelete;
// Read message variables
CMessageList * msgList;
CMessage *currReadMsg;
int readStat;
virtual int timeKeeperFD(int event);
public:
CCommunicate(CSocket * socket,CTimeKeeper * timeKeeper);
virtual ~CCommunicate();
CSocket * getSocket();
virtual void quit();
void readyToRead();
void readyToWrite();
void sendMessage(CMessage * message,int del);
void setManager(CManager * manager);
CManager * getManager();
void addMsg(MsgCreateFunc_t msgCreateFunc);
};
#endif // _COMMUNICATE_H

@ -0,0 +1,52 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CROSSINDEX_H
#define _CROSSINDEX_H
class CCrossIndexItem {
CCrossIndexItem * next;
int indexA,indexB;
public:
CCrossIndexItem(int indexA,int indexB);
virtual ~CCrossIndexItem() { if(next!=NULL) delete next; }
void setItem(int indexA,int indexB);
int getIndexA() {return indexA;}
int getIndexB() {return indexB;}
void setNext(CCrossIndexItem *next) {this->next=next;}
CCrossIndexItem * getNext() {return next;}
};
class CCrossIndex {
CCrossIndexItem * first;
public:
CCrossIndex() { first=NULL; }
virtual ~CCrossIndex() { if(first!=NULL) delete first; }
CCrossIndexItem * add(int indexA,int indexB);
int getB(int indexA);
int getA(int indexB);
};
#endif /* _CROSSINDEX_H */

63
common/include/crypto.H Normal file

@ -0,0 +1,63 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _CRYPTO_H
#define _CRYPTO_H
#include <unistd.h>
#include "pvvmud.H"
#include "blowfish.h"
class CCrypto {
// Common
BF_KEY *cryptKey;
// Reading Part of the code
unsigned char *cryptBuf_r,
cryptIV_r[8];
BYTE cryptState_r;
int cryptSize_r,
cryptPos_r,
cryptN_r,
cryptCnt_r;
// Writing Part of the code
unsigned char *cryptBuf_w,
*cryptTempBuf,
cryptIV_w[8];
BYTE cryptState_w;
int cryptSize_w,
cryptPos_w,
cryptN_w,
cryptCnt_w,
cryptTempSize,
cryptTempPos;
public:
CCrypto(void);
~CCrypto(void);
ssize_t write(int fd, void *buf, size_t count);
ssize_t read(int fd, char **buf, size_t count);
};
#endif _CRYPTO_H

@ -0,0 +1,57 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _DIRECTION_H
#define _DIRECTION_H
#include "object.H"
#include <iostream.h>
class CDirection: public CObject {
double direction[3];
public:
CDirection();
CDirection(double * direction);
CDirection(double h, double r, double p);
CDirection& operator= (const CDirection& direction);
CDirection& operator+= (const CDirection& direction);
CDirection operator+ (const CDirection& direction);
CDirection operator- () const;
CDirection operator* (double scale) const;
void normalize();
double * getVector();
double getValue(int ii) const ;
void setValue(int ii,double value);
double rotateHeading( double deltaHeading );
double rotateRoll( double deltaRoll );
double rotatePitch( double deltaPitch );
double getHeading() const { return direction[0]; }
double getRoll() const { return direction[1]; }
double getPitch() const { return direction[2]; }
};
ostream& operator<<(ostream&s,const CDirection& d);
#endif // _DIRECTION_H

@ -0,0 +1,43 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _DOUBLEARRAY_H
#define _DOUBLEARRAY_H
#include <iostream.h>
class CDoubleArray {
int m_size;
int m_num;
double * m_array;
public:
CDoubleArray();
virtual ~CDoubleArray();
int add( double num );
int add( CDoubleArray * doubleArray );
int insert( double num );
double get( int index ) const;
void deleteAll();
int getNumElements() const;
};
ostream& operator<<(ostream&s,const CDoubleArray& d);
#endif // _DOUBLEARRAY_H

@ -0,0 +1,34 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _EXCEPTION_H
#define _EXCEPTION_H
#include "object.H"
#include <iostream.h>
class CException : public CObject {
public:
CException();
CException(char * message);
};
ostream& operator<<(ostream&s,CException& e);
#endif // _EXCEPTION_H

254
common/include/geometry.H Normal file

@ -0,0 +1,254 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GEOMETRY_H
#define _GEOMETRY_H
#include "object.H"
#include "objectarray.H"
#include <stdio.h>
#include "cache.H"
#include "texture.H"
#include "material.H"
#include "intarray.H"
#include "doublearray.H"
#include "beam.H"
#include "vector.H"
#include "plane.H"
#include "vertex.H"
#include "bbox.H"
#ifdef HAVE_GL_GL_H
#include <GL/gl.h>
#define POLYGON_TRIANGLES GL_TRIANGLES
#define POLYGON_TRIANGLE_STRIP GL_TRIANGLE_STRIP
#define POLYGON_TRIANGLE_FAN GL_TRIANGLE_FAN
#define POLYGON_QUADS GL_QUADS
#define POLYGON_QUAD_STRIP GL_QUAD_STRIP
#define POLYGON_POLYGON GL_POLYGON
typedef GLdouble TexCoordCoord_t;
typedef GLdouble NormalVector_t;
#else /* HAVE_GL_GL_H */
#define POLYGON_TRIANGLES 0x0004
#define POLYGON_TRIANGLE_STRIP 0x0005
#define POLYGON_TRIANGLE_FAN 0x0006
#define POLYGON_QUADS 0x0007
#define POLYGON_QUAD_STRIP 0x0008
#define POLYGON_POLYGON 0x0009
typedef double TexCoordCoord_t;
typedef double NormalVector_t;
#endif /* HAVE_GL_GL_H */
class CGeometry;
class CTexCoord : public CObject{
TexCoordCoord_t m_coord[2];
public:
CTexCoord(double u, double v);
TexCoordCoord_t * getCoord();
void setCoord(double u, double v);
double getU();
double getV();
};
class CNormal : public CObject{
NormalVector_t m_vector[3];
public:
CNormal(double x, double y, double z);
NormalVector_t * getVector();
void setVector(double x, double y, double z);
double getX();
double getY();
double getZ();
};
class CVertexList : public CObjectArray {
public:
CVertexList(int size);
virtual ~CVertexList();
int add( double x, double y, double z );
void set( int index, double x, double y, double z );
void get( int index, double * x, double * y, double * z );
VertexCoord_t * get( int index );
CVertex * getVertex( int index );
int getSize();
};
class CNormalList : public CObjectArray {
public:
CNormalList(int size);
virtual ~CNormalList();
int add(double x, double y, double z);
void set( int index, double x, double y, double z );
void get(int index, double * x, double * y, double * z );
NormalVector_t * get( int index );
CNormal * getNormal( int index );
};
class CTexCoordList : public CObjectArray {
public:
CTexCoordList(int size);
virtual ~CTexCoordList();
int add( double u, double v);
void set( int index, double u, double v );
void get( int index, double * u, double * v );
TexCoordCoord_t * get( int index );
CTexCoord * getTexCoord( int index );
};
class CPolygon;
class CPolygonList : public CObjectArray {
CGeometry * m_geometry;
public:
CPolygonList(CGeometry * geometry,int size);
virtual ~CPolygonList();
int add( CPolygon * polygon );
void set( int index, CPolygon * polygon );
CPolygon * get(int index );
};
class CPolygon : public CObject{
int m_materialId;
int m_type; /* POLYGON_QUADS , POLYGON_POLYGON , etc */
CIntArray * m_vertexIndexList;
CIntArray * m_normalIndexList;
CIntArray * m_texCoordIndexList;
CGeometry * m_geometry;
public:
CPolygon(int type, int materialId, int numVertices,
int numNormals, int numTexCoords);
virtual ~CPolygon();
void setGeometry(CGeometry * geometry);
void get( int * type,
int * materialId, int * numVertices,
int * numNormals, int * numTexCoords );
int getType();
void setMaterial( int materialId );
int getMaterial();
int addVertexIndex( int vertexIndex );
void setVertexIndex( int index, int vertexIndex );
int getVertexIndex( int index );
CVertex * getVertex( int index );
int addNormalIndex( int normalIndex );
void setNormalIndex( int index, int normalIndex );
int getNormalIndex( int index );
CNormal * getNormal( int index );
int addTexCoordIndex( int texCoordIndex );
void setTexCoordIndex( int index, int texCoordIndex );
int getTexCoordIndex( int index );
CTexCoord * getTexCoord( int index );
CIntArray * getVertexIList();
int getNumVertices();
CIntArray * getNormalIList();
CIntArray * getTexCoordIList();
void distances(CDoubleArray & distArray, const CBeam & beam);
CDoubleArray* distances(const CBeam & beam);
};
class CGeometry : public CObject{
protected:
int id,subid;
CGeometry * next;
CVertexList * vertexList;
CNormalList * normalList;
CTexCoordList * texCoordList;
CPolygonList * polygonList;
public:
CGeometry(int objectGeometryId);
CGeometry(int objectGeometryId, int numVertices,
int numNormals, int numTexCoords, int numPolygons);
virtual ~CGeometry();
virtual CGeometry * newGeometry(int geometryId);
void setSize(int numVertices, int numNormals,
int numTexCoords, int numPolygons);
int getId();
void setId(int id);
void setSubId( int subid );
int getSubId();
int getNumSubobjects();
void setNext( CGeometry * next );
CGeometry * getNext();
int addVertex( double x, double y, double z );
void getVertex( int index, double * x,
double * y, double * z );
CVertex * getVertex( int index );
void setVertex( int index, double x,
double y, double z );
int addNormal( double x, double y, double z );
void setNormal( int index, double x, double y, double z );
void getNormal( int index, double * x,
double * y, double * z );
CNormal * getNormal( int index );
int addTexCoord( double u, double v );
void setTexCoord( int index, double u, double v );
void getTexCoord( int index, double * u,
double * v );
CTexCoord * getTexCoord( int index );
virtual int draw( CMaterialCache * matCache, CTextureCache * texCache );
int addPolygon( CPolygon * polygon );
void setPolygon( int index, CPolygon * polygon );
CPolygon * getPolygon(int index );
int getNumVertices();
int getNumNormals();
int getNumTexCoords();
int getNumPolygons();
int scale( double scale );
// int ReadBOG(int objId, FILE * bog);
void distances(CDoubleArray & distArray, const CBeam & beam, double min, double max);
CDoubleArray * distances(const CBeam & beam, double min, double max);
CBBox calculateBBox();
void load(char * name);
void save(char * name);
void readBOG(FILE * bog);
int writeBOG(FILE * bog);
private:
int readBOGCore(FILE * bog, int numV, int numN, int numTC, int numP);
};
class CGeometryCache : public CCache {
public:
CGeometryCache();
virtual ~CGeometryCache();
CGeometry * add( CGeometry * objGeo );
CGeometry * get( int id );
};
#endif /* _GEOMETRY_H */

53
common/include/gos.H Normal file

@ -0,0 +1,53 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GOS_H
#define _GOS_H
#include "manager.H"
#include "socket.H"
#include "geometry.H"
#include "material.H"
#include "texture.H"
#include "timekeeper.H"
#include "inetaddress.H"
class CGOS : public CManager {
CClientSocket * socket;
public:
CGOS(CTimeKeeper * timeKeeper, CInetAddress *addr);
virtual void quit();
void request(int requestType,int requestId);
virtual void error();
virtual void geometry(CGeometry * geometry);
virtual void material(CMaterial * material);
virtual void texture(CTexture * texture);
virtual CGeometry * newGeometry(int geometryId, int numVertices,
int numNormals, int numTexCoords, int numPolygons);
virtual CMaterial * newMaterial(int materialId);
virtual CTexture * newTexture(int textureId);
};
#endif // _GOS_H

@ -0,0 +1,57 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GETGOSMESSAGE_H
#define _GETGOSMESSAGE_H
#include "msggos.H"
class CMsgGOSErrorGetGOS: public CMsgGOSError{
public:
CMsgGOSErrorGetGOS();
static CMsgGOSErrorGetGOS * createMsg();
virtual int executeMsg();
};
class CMsgGeometryGetGOS: public CMsgGeometry {
public:
CMsgGeometryGetGOS();
static CMsgGeometryGetGOS * createMsg();
virtual int executeMsg();
virtual CGeometry * newGeometry(int geometryId, int numVertices,
int numNormals, int numTexCoords, int numPolygons);
};
class CMsgMaterialGetGOS: public CMsgMaterial {
public:
CMsgMaterialGetGOS();
static CMsgMaterialGetGOS * createMsg();
virtual int executeMsg();
virtual CMaterial * newMaterial(int materialId);
};
class CMsgTextureGetGOS: public CMsgTexture {
public:
CMsgTextureGetGOS();
static CMsgTextureGetGOS * createMsg();
virtual int executeMsg();
virtual CTexture * newTexture(int textureId);
};
#endif // _GETGOSMESSAGE_H

@ -0,0 +1,35 @@
/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* 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
*
*/
#ifndef _GOSPROTOCOL_H
#define _GOSPROTOCOL_H
#include "communicate.H"
#include "socket.H"
class CGOSProtocol: public CCommunicate {
public:
CGOSProtocol(CSocket * socket,CTimeKeeper * timeKeeper);
virtual void quit();
};
#endif // _GOSPROTOCOL_H

40
common/include/hash_map Normal file

@ -0,0 +1,40 @@
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
*
* 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. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* 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. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
#ifndef __SGI_STL_HASH_MAP
#define __SGI_STL_HASH_MAP
#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
#include <stl_hashtable.h>
#endif
#include <stl_hash_map.h>
#endif /* __SGI_STL_HASH_MAP */
// Local Variables:
// mode:C++
// End:

Some files were not shown because too many files have changed in this diff Show More