diff --git a/config/menus_multiplayer.cfg b/config/menus_multiplayer.cfg index 7e71e92a..410303d7 100644 --- a/config/menus_multiplayer.cfg +++ b/config/menus_multiplayer.cfg @@ -1,7 +1,7 @@ newmenu multiplayer -menuitem "Join a server" "updatefrommaster; showmenu server" -menuitem "Join a LAN server" "updatefromlanmasters; showmenu server" +menuitem "Join a server" "searchlan 1; showallservers 1; updatefrommaster; showmenu server" +menuitem "Join a LAN server" "searchlan 2; showallservers 0; showmenu server" menuitem "Disconnect" "disconnect" menuitem "Server voting..." [ showmenu "Server voting" ] menuitem "Chat" "saycommand" diff --git a/source/enet/Makefile.in b/source/enet/Makefile.in index 0ba2d8f0..b6beb009 100755 --- a/source/enet/Makefile.in +++ b/source/enet/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 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. @@ -14,15 +14,11 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -43,7 +39,7 @@ am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno + configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -63,7 +59,7 @@ am_libenet_a_OBJECTS = host.$(OBJEXT) list.$(OBJEXT) \ callbacks.$(OBJEXT) packet.$(OBJEXT) peer.$(OBJEXT) \ protocol.$(OBJEXT) unix.$(OBJEXT) win32.$(OBJEXT) libenet_a_OBJECTS = $(am_libenet_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) +DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -74,10 +70,13 @@ SOURCES = $(libenet_a_SOURCES) DIST_SOURCES = $(libenet_a_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -93,8 +92,6 @@ GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -114,6 +111,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -123,6 +121,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -136,9 +135,11 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -146,6 +147,7 @@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -169,8 +171,11 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ lib_LIBRARIES = libenet.a libenet_a_SOURCES = host.c list.c callbacks.c packet.c peer.c protocol.c unix.c win32.c INCLUDES = -Iinclude/ @@ -214,7 +219,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ @@ -262,19 +267,18 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -307,8 +311,7 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: +$(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -352,8 +355,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -378,8 +381,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -389,13 +392,12 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -410,23 +412,22 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) - mkdir $(distdir) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -440,7 +441,7 @@ distdir: $(DISTFILES) list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ @@ -448,6 +449,8 @@ distdir: $(DISTFILES) $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ @@ -455,7 +458,7 @@ distdir: $(DISTFILES) -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz @@ -465,6 +468,10 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -491,6 +498,8 @@ distcheck: dist GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -530,7 +539,7 @@ distcheck: dist $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -555,7 +564,7 @@ all-am: Makefile $(LIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive @@ -604,12 +613,20 @@ info-am: install-data-am: +install-dvi: install-dvi-recursive + install-exec-am: install-libLIBRARIES +install-html: install-html-recursive + install-info: install-info-recursive install-man: +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -631,24 +648,26 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-info-am uninstall-libLIBRARIES +uninstall-am: uninstall-libLIBRARIES -uninstall-info: uninstall-info-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-libLIBRARIES \ - clean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-compile distclean-generic distclean-recursive \ +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libLIBRARIES ctags ctags-recursive dist dist-all \ + dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-zip \ + distcheck distclean distclean-compile distclean-generic \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLIBRARIES install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-libLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/source/enet/aclocal.m4 b/source/enet/aclocal.m4 index aef181a6..eb3b99a2 100755 --- a/source/enet/aclocal.m4 +++ b/source/enet/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file 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. @@ -11,7 +11,15 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,14 +29,31 @@ # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -85,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file 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. -# serial 7 +# serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -101,8 +126,10 @@ AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -116,15 +143,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file 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. -# serial 8 +# serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -152,6 +178,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) @@ -217,6 +244,7 @@ AC_CACHE_CHECK([dependency style of $depcc], depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -269,7 +297,8 @@ if test "x$enable_dependency_tracking" != xno; then AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -294,8 +323,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -342,14 +372,14 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. # # This file 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. -# serial 12 +# serial 13 # 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. @@ -366,16 +396,20 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl +[AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])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]) +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi fi # test whether we have cygpath @@ -395,6 +429,9 @@ m4_ifval([$2], AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl @@ -430,6 +467,10 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) @@ -443,16 +484,17 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -465,7 +507,7 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -543,14 +585,14 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. -# serial 4 +# serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -566,6 +608,7 @@ AC_SUBST($1)]) # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then @@ -576,7 +619,7 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -584,60 +627,23 @@ fi # AM_PROG_MKDIR_P # --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) +# Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) # Helper functions for option handling. -*- Autoconf -*- @@ -749,9 +755,21 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. diff --git a/source/enet/configure b/source/enet/configure index 908b6ad3..275154d9 100755 --- a/source/enet/configure +++ b/source/enet/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for libenet 10-12-2007. +# Generated by GNU Autoconf 2.61 for libenet 9-15-2008. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -572,8 +572,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='libenet' PACKAGE_TARNAME='libenet' -PACKAGE_VERSION='10-12-2007' -PACKAGE_STRING='libenet 10-12-2007' +PACKAGE_VERSION='9-15-2008' +PACKAGE_STRING='libenet 9-15-2008' PACKAGE_BUGREPORT='' ac_subst_vars='SHELL @@ -616,6 +616,7 @@ target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA +am__isrc CYGPATH_W PACKAGE VERSION @@ -1168,7 +1169,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libenet 10-12-2007 to adapt to many kinds of systems. +\`configure' configures libenet 9-15-2008 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1234,7 +1235,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libenet 10-12-2007:";; + short | recursive ) echo "Configuration of libenet 9-15-2008:";; esac cat <<\_ACEOF @@ -1318,7 +1319,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libenet configure 10-12-2007 +libenet configure 9-15-2008 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1332,7 +1333,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libenet $as_me 10-12-2007, which was +It was created by libenet $as_me 9-15-2008, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1685,7 +1686,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version="1.9" +am__api_version='1.10' + ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -1868,38 +1870,53 @@ else echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" else - mkdir_p='$(install_sh) -d' + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" fi fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac for ac_prog in gawk mawk nawk awk do @@ -1982,12 +1999,16 @@ else fi rmdir .tst 2>/dev/null -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } + fi fi # test whether we have cygpath @@ -2002,7 +2023,7 @@ fi # Define the identity of the package. PACKAGE=libenet.a - VERSION=10-12-2007 + VERSION=9-15-2008 cat >>confdefs.h <<_ACEOF @@ -2030,7 +2051,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right @@ -2134,7 +2155,7 @@ else fi fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -3120,9 +3141,7 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi - - -if test "x$enable_dependency_tracking" != xno; then + if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else @@ -3132,7 +3151,6 @@ fi - depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 @@ -3200,6 +3218,7 @@ else depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -3229,9 +3248,7 @@ fi echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= @@ -4929,7 +4946,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libenet $as_me 10-12-2007, which was +This file was extended by libenet $as_me 9-15-2008, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4976,7 +4993,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -libenet config.status 10-12-2007 +libenet config.status 9-15-2008 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -4987,6 +5004,7 @@ gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -5185,6 +5203,7 @@ target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim @@ -5227,7 +5246,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 80; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -5454,6 +5473,11 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -5507,6 +5531,7 @@ s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out @@ -5541,8 +5566,9 @@ echo "$as_me: executing $ac_file commands" >&6;} # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ diff --git a/source/enet/configure.in b/source/enet/configure.in index 178a623e..f0fd703d 100755 --- a/source/enet/configure.in +++ b/source/enet/configure.in @@ -1,5 +1,5 @@ -AC_INIT(libenet, 10-12-2007) -AM_INIT_AUTOMAKE(libenet.a, 10-12-2007) +AC_INIT(libenet, 9-15-2008) +AM_INIT_AUTOMAKE(libenet.a, 9-15-2008) AC_PROG_CC AC_PROG_RANLIB diff --git a/source/enet/host.c b/source/enet/host.c index 9bab1a8c..30eaded9 100755 --- a/source/enet/host.c +++ b/source/enet/host.c @@ -36,9 +36,12 @@ enet_host_create (const ENetAddress * address, size_t peerCount, enet_uint32 inc host -> peers = (ENetPeer *) enet_malloc (peerCount * sizeof (ENetPeer)); memset (host -> peers, 0, peerCount * sizeof (ENetPeer)); - host -> socket = enet_socket_create (ENET_SOCKET_TYPE_DATAGRAM, address); - if (host -> socket == ENET_SOCKET_NULL) + host -> socket = enet_socket_create (ENET_SOCKET_TYPE_DATAGRAM); + if (host -> socket == ENET_SOCKET_NULL || (address != NULL && enet_socket_bind (host -> socket, address) < 0)) { + if (host -> socket != ENET_SOCKET_NULL) + enet_socket_destroy (host -> socket); + enet_free (host -> peers); enet_free (host); diff --git a/source/enet/include/Makefile.in b/source/enet/include/Makefile.in index 3e260432..7f44577d 100755 --- a/source/enet/include/Makefile.in +++ b/source/enet/include/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 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. @@ -13,15 +13,11 @@ # PARTICULAR PURPOSE. @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -45,17 +41,18 @@ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -75,6 +72,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -84,6 +82,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -97,9 +96,11 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -107,6 +108,7 @@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -130,8 +132,11 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ SUBDIRS = enet all: all-recursive @@ -165,7 +170,6 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -198,8 +202,7 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: +$(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -243,8 +246,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -269,8 +272,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -280,13 +283,12 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -300,22 +302,21 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -329,7 +330,7 @@ distdir: $(DISTFILES) list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ @@ -337,6 +338,8 @@ distdir: $(DISTFILES) $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ @@ -390,12 +393,20 @@ info-am: install-data-am: +install-dvi: install-dvi-recursive + install-exec-am: +install-html: install-html-recursive + install-info: install-info-recursive install-man: +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -414,21 +425,23 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-info-am +uninstall-am: -uninstall-info: uninstall-info-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-recursive ctags ctags-recursive \ - distclean distclean-generic distclean-recursive distclean-tags \ +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + tags-recursive uninstall uninstall-am # 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. diff --git a/source/enet/include/enet/Makefile.in b/source/enet/include/enet/Makefile.in index bbec556b..df381a91 100755 --- a/source/enet/include/enet/Makefile.in +++ b/source/enet/include/enet/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 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. @@ -14,15 +14,11 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -58,8 +54,6 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -79,6 +73,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -88,6 +83,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -101,9 +97,11 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -111,6 +109,7 @@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -134,8 +133,11 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ libenetincludedir = $(includedir)/enet libenetinclude_HEADERS = \ types.h \ @@ -180,10 +182,9 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -uninstall-info-am: install-libenetincludeHEADERS: $(libenetinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libenetincludedir)" || $(mkdir_p) "$(DESTDIR)$(libenetincludedir)" + test -z "$(libenetincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libenetincludedir)" @list='$(libenetinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ @@ -204,8 +205,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -217,8 +218,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -228,13 +229,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -248,22 +248,21 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -279,7 +278,7 @@ check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libenetincludedir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -325,12 +324,20 @@ info-am: install-data-am: install-libenetincludeHEADERS +install-dvi: install-dvi-am + install-exec-am: +install-html: install-html-am + install-info: install-info-am install-man: +install-pdf: install-pdf-am + +install-ps: install-ps-am + installcheck-am: maintainer-clean: maintainer-clean-am @@ -349,18 +356,21 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-libenetincludeHEADERS +uninstall-am: uninstall-libenetincludeHEADERS + +.MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ ctags distclean distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libenetincludeHEADERS \ - install-man install-strip installcheck installcheck-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ - uninstall uninstall-am uninstall-info-am \ - uninstall-libenetincludeHEADERS + uninstall uninstall-am uninstall-libenetincludeHEADERS # 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. diff --git a/source/enet/include/enet/enet.h b/source/enet/include/enet/enet.h index 14106aa5..cf7b2d07 100755 --- a/source/enet/include/enet/enet.h +++ b/source/enet/include/enet/enet.h @@ -46,7 +46,8 @@ typedef enum ENET_SOCKOPT_NONBLOCK = 1, ENET_SOCKOPT_BROADCAST = 2, ENET_SOCKOPT_RCVBUF = 3, - ENET_SOCKOPT_SNDBUF = 4 + ENET_SOCKOPT_SNDBUF = 4, + ENET_SOCKOPT_REUSEADDR = 5 } ENetSocketOption; enum @@ -403,7 +404,9 @@ ENET_API void enet_time_set (enet_uint32); /** @defgroup socket ENet socket functions @{ */ -ENET_API ENetSocket enet_socket_create (ENetSocketType, const ENetAddress *); +ENET_API ENetSocket enet_socket_create (ENetSocketType); +ENET_API int enet_socket_bind (ENetSocket, const ENetAddress *); +ENET_API int enet_socket_listen (ENetSocket, int); ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress *); ENET_API int enet_socket_connect (ENetSocket, const ENetAddress *); ENET_API int enet_socket_send (ENetSocket, const ENetAddress *, const ENetBuffer *, size_t); @@ -411,6 +414,7 @@ ENET_API int enet_socket_receive (ENetSocket, ENetAddress *, ENetBuffer * ENET_API int enet_socket_wait (ENetSocket, enet_uint32 *, enet_uint32); ENET_API int enet_socket_set_option (ENetSocket, ENetSocketOption, int); ENET_API void enet_socket_destroy (ENetSocket); +ENET_API int enet_socketset_select (ENetSocket, ENetSocketSet *, ENetSocketSet *, enet_uint32); /** @} */ diff --git a/source/enet/include/enet/unix.h b/source/enet/include/enet/unix.h index b20fecd4..087015e5 100755 --- a/source/enet/include/enet/unix.h +++ b/source/enet/include/enet/unix.h @@ -6,8 +6,10 @@ #define __ENET_UNIX_H__ #include +#include #include #include +#include typedef int ENetSocket; @@ -32,5 +34,12 @@ typedef struct #define ENET_API extern +typedef fd_set ENetSocketSet; + +#define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset)) +#define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset)) +#define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLEAR (socket, & (sockset)) +#define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) + #endif /* __ENET_UNIX_H__ */ diff --git a/source/enet/include/enet/win32.h b/source/enet/include/enet/win32.h index 310ecd53..0e1cf0c5 100755 --- a/source/enet/include/enet/win32.h +++ b/source/enet/include/enet/win32.h @@ -46,6 +46,13 @@ typedef struct #define ENET_API extern #endif /* ENET_DLL */ +typedef fd_set ENetSocketSet; + +#define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset)) +#define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset)) +#define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLEAR (socket, & (sockset)) +#define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) + #endif /* __ENET_WIN32_H__ */ diff --git a/source/enet/unix.c b/source/enet/unix.c index 132ca1a2..0bf794f8 100755 --- a/source/enet/unix.c +++ b/source/enet/unix.c @@ -152,37 +152,39 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng return 0; } -ENetSocket -enet_socket_create (ENetSocketType type, const ENetAddress * address) +int +enet_socket_bind (ENetSocket socket, const ENetAddress * address) { - ENetSocket newSocket = socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0); struct sockaddr_in sin; - if (newSocket == ENET_SOCKET_NULL) - return ENET_SOCKET_NULL; - - if (address == NULL) - return newSocket; - memset (& sin, 0, sizeof (struct sockaddr_in)); - sin.sin_family = AF_INET; - sin.sin_port = ENET_HOST_TO_NET_16 (address -> port); - sin.sin_addr.s_addr = address -> host; - - if (bind (newSocket, - (struct sockaddr *) & sin, - sizeof (struct sockaddr_in)) == -1 || - (type == ENET_SOCKET_TYPE_STREAM && - address -> port != ENET_PORT_ANY && - listen (newSocket, SOMAXCONN) == -1)) + if (address != NULL) { - close (newSocket); - - return ENET_SOCKET_NULL; + sin.sin_port = ENET_HOST_TO_NET_16 (address -> port); + sin.sin_addr.s_addr = address -> host; + } + else + { + sin.sin_port = 0; + sin.sin_addr.s_addr = INADDR_ANY; } - return newSocket; + return bind (socket, + (struct sockaddr *) & sin, + sizeof (struct sockaddr_in)); +} + +int +enet_socket_listen (ENetSocket socket, int backlog) +{ + return listen (socket, backlog < 0 ? SOMAXCONN : backlog); +} + +ENetSocket +enet_socket_create (ENetSocketType type) +{ + return socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0); } int @@ -203,6 +205,10 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value) result = setsockopt (socket, SOL_SOCKET, SO_BROADCAST, (char *) & value, sizeof (int)); break; + case ENET_SOCKOPT_REUSEADDR: + result = setsockopt (socket, SOL_SOCKET, SO_REUSEADDR, (char *) & value, sizeof (int)); + break; + case ENET_SOCKOPT_RCVBUF: result = setsockopt (socket, SOL_SOCKET, SO_RCVBUF, (char *) & value, sizeof (int)); break; @@ -345,6 +351,17 @@ enet_socket_receive (ENetSocket socket, return recvLength; } +int +enet_socketset_select (ENetSocket maxSocket, ENetSocketSet * readSet, ENetSocketSet * writeSet, enet_uint32 timeout) +{ + struct timeval timeVal; + + timeVal.tv_sec = timeout / 1000; + timeVal.tv_usec = (timeout % 1000) * 1000; + + return select (maxSocket + 1, readSet, writeSet, NULL, & timeVal); +} + int enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint32 timeout) { diff --git a/source/enet/win32.c b/source/enet/win32.c index b8b2aa72..e1fae233 100755 --- a/source/enet/win32.c +++ b/source/enet/win32.c @@ -100,19 +100,15 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng return 0; } -ENetSocket -enet_socket_create (ENetSocketType type, const ENetAddress * address) +int +enet_socket_bind (ENetSocket socket, const ENetAddress * address) { - ENetSocket newSocket = socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0); struct sockaddr_in sin; - if (newSocket == ENET_SOCKET_NULL) - return ENET_SOCKET_NULL; - memset (& sin, 0, sizeof (struct sockaddr_in)); sin.sin_family = AF_INET; - + if (address != NULL) { sin.sin_port = ENET_HOST_TO_NET_16 (address -> port); @@ -124,20 +120,21 @@ enet_socket_create (ENetSocketType type, const ENetAddress * address) sin.sin_addr.s_addr = INADDR_ANY; } - if (bind (newSocket, - (struct sockaddr *) & sin, - sizeof (struct sockaddr_in)) == SOCKET_ERROR || - (type == ENET_SOCKET_TYPE_STREAM && - address != NULL && - address -> port != ENET_PORT_ANY && - listen (newSocket, SOMAXCONN) == SOCKET_ERROR)) - { - closesocket (newSocket); + return bind (socket, + (struct sockaddr *) & sin, + sizeof (struct sockaddr_in)) == SOCKET_ERROR ? -1 : 0; +} - return ENET_SOCKET_NULL; - } +int +enet_socket_listen (ENetSocket socket, int backlog) +{ + return listen (socket, backlog < 0 ? SOMAXCONN : backlog) == SOCKET_ERROR ? -1 : 0; +} - return newSocket; +ENetSocket +enet_socket_create (ENetSocketType type) +{ + return socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0); } int @@ -157,6 +154,10 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value) result = setsockopt (socket, SOL_SOCKET, SO_BROADCAST, (char *) & value, sizeof (int)); break; + case ENET_SOCKOPT_REUSEADDR: + result = setsockopt (socket, SOL_SOCKET, SO_REUSEADDR, (char *) & value, sizeof (int)); + break; + case ENET_SOCKOPT_RCVBUF: result = setsockopt (socket, SOL_SOCKET, SO_RCVBUF, (char *) & value, sizeof (int)); break; @@ -182,7 +183,7 @@ enet_socket_connect (ENetSocket socket, const ENetAddress * address) sin.sin_port = ENET_HOST_TO_NET_16 (address -> port); sin.sin_addr.s_addr = address -> host; - return connect (socket, (struct sockaddr *) & sin, sizeof (struct sockaddr_in)); + return connect (socket, (struct sockaddr *) & sin, sizeof (struct sockaddr_in)) == SOCKET_ERROR ? -1 : 0; } ENetSocket @@ -294,6 +295,17 @@ enet_socket_receive (ENetSocket socket, return (int) recvLength; } +int +enet_socketset_select (ENetSocket maxSocket, ENetSocketSet * readSet, ENetSocketSet * writeSet, enet_uint32 timeout) +{ + struct timeval timeVal; + + timeVal.tv_sec = timeout / 1000; + timeVal.tv_usec = (timeout % 1000) * 1000; + + return select (maxSocket + 1, readSet, writeSet, NULL, & timeVal); +} + int enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint32 timeout) { diff --git a/source/src/Makefile b/source/src/Makefile index bf317265..7615a326 100644 --- a/source/src/Makefile +++ b/source/src/Makefile @@ -29,7 +29,6 @@ CLIENT_OBJS= \ server.o \ serverbrowser.o \ serverms.o \ - localserverms.o \ shadow.o \ sound.o \ texture.o \ @@ -54,7 +53,6 @@ SERVER_LIBS=-L../enet -lenet -lz SERVER_FILES= \ log.cpp \ serverms.cpp \ - localserverms.cpp \ server.cpp \ protocol.cpp \ tools.cpp diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index f3f077ce..c193fe18 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -954,14 +954,14 @@ void *kickmenu = NULL, *banmenu = NULL, *forceteammenu = NULL, *giveadminmenu = void refreshsopmenu(void *menu, bool init) { - int item = 0; + menureset(menu); mlines.setsize(0); loopv(players) if(players[i]) { mline &m = mlines.add(); s_strcpy(m.name, colorname(players[i])); s_sprintf(m.cmd)("%s %d", menu==kickmenu ? "kick" : (menu==banmenu ? "ban" : (menu==forceteammenu ? "forceteam" : "giveadmin")), i); - menumanual(menu, item++, m.name, m.cmd); + menumanual(menu, m.name, m.cmd); } } diff --git a/source/src/docs.cpp b/source/src/docs.cpp index f5af9865..503c69bd 100644 --- a/source/src/docs.cpp +++ b/source/src/docs.cpp @@ -487,7 +487,8 @@ void renderdocsection(void *menu, bool init) s_sprintf(s.cmd)("saycommand [/%s ]", id.name); } msections.sort(msectionsort); - loopv(msections) { menumanual(menu, i, msections[i].name, msections[i].cmd); } + menureset(menu); + loopv(msections) { menumanual(menu, msections[i].name, msections[i].cmd); } return; } } @@ -498,11 +499,11 @@ void renderdocmenu(void *menu, bool init) { static vector actions; actions.setsize(0); - + menureset(menu); loopv(sections) { maction &a = actions.add(); s_sprintf(a.cmd)("showmenu [%s]", sections[i].name); - menumanual(menu, i, sections[i].name, a.cmd); + menumanual(menu, sections[i].name, a.cmd); } } diff --git a/source/src/localserverms.cpp b/source/src/localserverms.cpp deleted file mode 100644 index 1f20ba39..00000000 --- a/source/src/localserverms.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// local master server used for LAN server-searching - -#include "pch.h" -#include "cube.h" - -extern int servmillis; -extern struct log *logger; - -masterserver::masterserver() : created(false), lastpurge(0) -{ - socket = ENET_SOCKET_NULL; -} - -bool masterserver::addserver(ENetAddress &addr) -{ - // update server if existing - loopv(servers) - { - server &s = servers[i]; - if(s.addr.host==addr.host && s.addr.port==addr.port) - { - s.addmillis = servmillis; - logger->writeline(log::info, "local LAN masterserver: updated local server (port %d)", s.addr.port); - return true; - } - } - - // add new entry - server s = { addr, servmillis }; - servers.add(s); - logger->writeline(log::info, "local LAN masterserver: added local server (port %d) to the list", s.addr.port); - - return true; -} - -char *masterserver::getserverlist() -{ - // construct cube-script serverlist - char *buf = newstring("// local servers\n", _MAXDEFSTR); - - loopv(servers) - { - server &s = servers[i]; - string host; - enet_address_get_host(&s.addr, host, _MAXDEFSTR); - s_sprintfd(serverline)("addserver %s %d;\n", host, s.addr.port); - s_strcat(buf, serverline); - } - - return buf; -} - -void masterserver::processrequests() -{ - ENetAddress remoteaddr; - ENetBuffer requestbuf; - uchar data[MAXTRANS] = { 0 }; - requestbuf.data = data; - int len; - enet_uint32 events = ENET_SOCKET_WAIT_RECEIVE; - - while(enet_socket_wait(socket, &events, 0) >= 0 && events) - { - requestbuf.dataLength = sizeof(data); - len = enet_socket_receive(socket, &remoteaddr, &requestbuf, 1); - - // block all non-local connections - /*enet_uint32 loopback = 16777343; - if(address.host!=remoteaddr.host && !(address.host==ENET_HOST_ANY && remoteaddr.host==loopback)) - { - enet_socket_destroy(datasocket); - datasocket = socket; - continue; - }*/ - - char *request = ((char *)requestbuf.data); - - // split request string - hashtable args; - const char *argseparators = "?&"; - char *t = strpbrk(request, argseparators); - while(t) - { - char *namebegin = t+1; - char *nameend = strchr(namebegin, '='); - char *valuebegin = nameend+1; - char *valueend = strpbrk(valuebegin, "& "); - - if(namebegin < nameend && nameend < valuebegin && valuebegin < valueend) - { - char *name = newstring(namebegin, nameend-namebegin); - char *str = (char*)args[name]; - s_strncpy(str, valuebegin, valueend-valuebegin+1); - } - - t = strpbrk(t+1, argseparators); - } - - // response buf - const string error400 = "HTTP/1.0 400 Bad Request\nContent-Type: text/plain\n\nBAD REQUEST\n\n"; - const string error500 = "HTTP/1.0 500 Internal Server Error\nContent-Type: text/plain\n\nINTERNAL SERVER ERROR\n\n"; - ENetBuffer responsebuf; - string response = { 0 }; - responsebuf.data = response; - - // process requests - char *action = (char *)args.access("action"); - char *port = (char *)args.access("port"); - char *item = (char *)args.access("item"); - if(action) - { - if(!strcmp(action, "add") && port) // add requests - { - ENetAddress srvaddr = { remoteaddr.host, atoi(port) }; - if(addserver(srvaddr)) - { - //s_strcpy(response, "HTTP/1.0 200 OK\nContent-Type: text/plain\n\nServer was successfully added to the local LAN masterserver.\n\n"); - } - else - { - s_strcpy(response, error500); - } - } - else - { - s_strcpy(response, error400); - } - } - else if(item) - { - if(!strcmp(item, "list")) // list requests - { - s_strcpy(response, "HTTP/1.0 200 OK\nContent-Type: text/plain\n\n"); - char *servers = getserverlist(); - s_strcat(response, servers); - s_strcat(response, "\n\n"); - delete[] servers; - } - } - else - { - s_strcpy(response, error400); - } - - size_t resplen = strlen(response); - if(resplen > 0) - { - responsebuf.dataLength = resplen; - enet_socket_send(socket, &remoteaddr, &responsebuf, 1); - } - - args.clear(); - } -} - -void masterserver::purgeserverlist() -{ - const int PURGEINTERVALMILLIS = 60*1000; - const int MAXAGEMILLIS = 60*60*1000; - - if(!lastpurge || servmillis-lastpurge > PURGEINTERVALMILLIS) - { - loopv(servers) - { - server &s = servers[i]; - int age = servmillis-s.addmillis; - if(age > MAXAGEMILLIS) - { - logger->writeline(log::info, "local LAN masterserver: removed local server (port %d) from list", s.addr.port); - servers.remove(i--); - } - } - - lastpurge = servmillis; - } -} - -void masterserver::update() -{ - if(!created) return; - - processrequests(); - purgeserverlist(); -} - -void masterserver::create(ENetAddress &addr) -{ - if(created) return; - - socket = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM, &addr); - if(socket == ENET_SOCKET_NULL) - { - logger->writeline(log::info, "local LAN masterserver: could not create masterserver instance, another server probably does the job already"); - } - else - { - enet_socket_set_option(socket, ENET_SOCKOPT_NONBLOCK, 1); - address = addr; - created = true; - logger->writeline(log::info, "local LAN masterserver: created masterserver instance"); - } -} - diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 4e8039aa..dd86afd6 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -478,10 +478,15 @@ void newmenu(char *name, char *hotkeys, char *forwardkeys) addmenu(name, NULL, true, NULL, atoi(hotkeys) > 0, atoi(forwardkeys) > 0); } -void menumanual(void *menu, int n, char *text, char *action, color *bgcolor, const char *desc) +void menureset(void *menu) +{ + gmenu &m = *(gmenu *)menu; + m.items.deletecontentsp(); +} + +void menumanual(void *menu, char *text, char *action, color *bgcolor, const char *desc) { gmenu &m = *(gmenu *)menu; - if(!n) m.items.deletecontentsp(); m.items.add(new mitemmanual(&m, text, action, NULL, bgcolor, desc)); } diff --git a/source/src/protocol.h b/source/src/protocol.h index 4599afa9..fe1f060e 100644 --- a/source/src/protocol.h +++ b/source/src/protocol.h @@ -4,6 +4,7 @@ #define CUBE_DEFAULT_SERVER_PORT 28763 #define CUBE_SERVINFO_PORT_LAN 28762 #define CUBE_SERVINFO_PORT(serverport) (serverport+1) +#define CUBE_SERVINFO_TO_SERV_PORT(servinfoport) (servinfoport-1) #define PROTOCOL_VERSION 1126 // bump when protocol changes #define DEMO_VERSION 1 // bump when demo format changes #define DEMO_MAGIC "ASSAULTCUBE_DEMO" diff --git a/source/src/protos.h b/source/src/protos.h index 2e8e4c4c..4653187e 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -94,7 +94,8 @@ extern bool bindc(int code, const char *action); // menus extern void rendermenu(); extern bool menuvisible(); -extern void menumanual(void *menu, int n, char *text, char *action = NULL, color *bgcolor = NULL, const char *desc = NULL); +extern void menureset(void *menu); +extern void menumanual(void *menu, char *text, char *action = NULL, color *bgcolor = NULL, const char *desc = NULL); extern void menuheader(void *menu, char *header = NULL, char *footer = NULL); extern bool menukey(int code, bool isdown, int unicode); extern void *addmenu(const char *name, const char *title = NULL, bool allowinput = true, void (__cdecl *refreshfunc)(void *, bool) = NULL, bool hotkeys = false, bool forwardkeys = false); @@ -187,11 +188,11 @@ struct serverinfo string map; string sdesc; string cmd; - int mode, numplayers, maxclients, ping, protocol, minremain, resolved, port; + int mode, numplayers, maxclients, ping, protocol, minremain, resolved, port, lastpingmillis; ENetAddress address; serverinfo() - : mode(0), numplayers(0), maxclients(0), ping(9999), protocol(0), minremain(0), resolved(UNRESOLVED), port(-1) + : mode(0), numplayers(0), maxclients(0), ping(9999), protocol(0), minremain(0), resolved(UNRESOLVED), port(-1), lastpingmillis(0) { name[0] = full[0] = map[0] = sdesc[0] = '\0'; } @@ -610,9 +611,9 @@ extern void getstring(char *t, ucharbuf &p, int len = MAXTRANS); extern void filtertext(char *dst, const char *src, bool whitespace = true, int len = sizeof(string)-1); extern void startintermission(); extern void restoreserverstate(vector &ents); -extern uchar *retrieveservers(uchar *buf, int buflen, ENetAddress &masterserver, const char *lmasterpath); +extern uchar *retrieveservers(uchar *buf, int buflen); +extern void serverms(int mode, int numplayers, int minremain, char *smapname, int millis, const ENetAddress &localaddr); extern char msgsizelookup(int msg); -extern void serverms(int mode, int numplayers, int minremain, char *smapname, int millis, ENetAddress &localaddr); extern void servermsdesc(const char *sdesc); extern void servermsinit(const char *master, const char *ip, int serverport, const char *sdesc, bool listen); extern bool serverpickup(int i, int sender); @@ -622,33 +623,6 @@ extern void extinfo_statsbuf(ucharbuf &p, int pid, int bpos, ENetSocket &pongsoc extern void extinfo_teamscorebuf(ucharbuf &p); extern char *votestring(int type, char *arg1, char *arg2); -// local masterserver -struct masterserver -{ - ENetAddress address; - ENetSocket socket; - bool created; - int lastpurge; - - struct server - { - ENetAddress addr; - int addmillis; - }; - vector servers; - - masterserver(); - void update(); - - void processrequests(); - void purgeserverlist(); - char *getserverlist(); - void create(ENetAddress &addr); - bool addserver(ENetAddress &addr); -}; - -extern masterserver localmasterserver; - // demo #define DHDR_DESCCHARS 80 struct demoheader diff --git a/source/src/scoreboard.cpp b/source/src/scoreboard.cpp index df41bfb0..d114ac6b 100644 --- a/source/src/scoreboard.cpp +++ b/source/src/scoreboard.cpp @@ -179,7 +179,8 @@ void renderscores(void *menu, bool init) loopv(scores) renderscore(menu, scores[i]); } - loopv(scorelines) menumanual(menu, i, scorelines[i].s, NULL, scorelines[i].bgcolor); + menureset(menu); + loopv(scorelines) menumanual(menu, scorelines[i].s, NULL, scorelines[i].bgcolor); menuheader(menu, modeline, serverline); // update server stats diff --git a/source/src/server.cpp b/source/src/server.cpp index 5f9fc1cf..7dbcbb5f 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -484,7 +484,6 @@ static string servdesc_full, servdesc_pre, servdesc_suf; bool isdedicated; ENetHost *serverhost = NULL; -masterserver localmasterserver; void process(ENetPacket *packet, int sender, int chan); void welcomepacket(ucharbuf &p, int n); @@ -2976,7 +2975,6 @@ void serverslice(uint timeout) // main server update, called from cube main lo if(!isdedicated) return; // below is network only serverms(smode, numclients(), minremain, smapname, servmillis, serverhost->address); - localmasterserver.update(); if(autoteam && m_teammode && !m_arena && !interm && servmillis - lastfillup > 5000 && refillteams()) lastfillup = servmillis; diff --git a/source/src/serverbrowser.cpp b/source/src/serverbrowser.cpp index 1bdb43ab..bf9b4f89 100644 --- a/source/src/serverbrowser.cpp +++ b/source/src/serverbrowser.cpp @@ -44,7 +44,7 @@ int resolverloop(void * data) SDL_LockMutex(resolvermutex); while(resolverqueries.empty()) SDL_CondWait(querycond, resolvermutex); rt->query = resolverqueries.pop(); - rt->starttime = lastmillis; + rt->starttime = totalmillis; SDL_UnlockMutex(resolvermutex); ENetAddress address = { ENET_HOST_ANY, ENET_PORT_ANY }; @@ -136,7 +136,7 @@ bool resolvercheck(const char **name, ENetAddress *address) else loopv(resolverthreads) { resolverthread &rt = resolverthreads[i]; - if(rt.query && lastmillis - rt.starttime > RESOLVERLIMIT) + if(rt.query && totalmillis - rt.starttime > RESOLVERLIMIT) { resolverstop(rt); *name = rt.query; @@ -333,11 +333,15 @@ void addserver(char *servername, char *serverport) newserver(servername, ENET_HOST_ANY, port); } +VARP(servpingrate, 1000, 5000, 60000); +VARP(maxservpings, 0, 0, 1000); +VAR(searchlan, 0, 1, 2); + void pingservers() { if(pingsock == ENET_SOCKET_NULL) { - pingsock = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM, NULL); + pingsock = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM); if(pingsock == ENET_SOCKET_NULL) { lastinfo = totalmillis; @@ -350,13 +354,28 @@ void pingservers() uchar ping[MAXTRANS]; ucharbuf p(ping, sizeof(ping)); putint(p, totalmillis); - loopv(servers) + if(searchlan < 2) { - serverinfo &si = *servers[i]; - if(si.address.host == ENET_HOST_ANY) continue; + static int lastping = 0; + if(lastping >= servers.length()) lastping = 0; + loopi(maxservpings ? min(servers.length(), maxservpings) : servers.length()) + { + serverinfo &si = *servers[lastping]; + if(++lastping >= servers.length()) lastping = 0; + if(si.address.host == ENET_HOST_ANY) continue; + buf.data = ping; + buf.dataLength = p.length(); + enet_socket_send(pingsock, &si.address, &buf, 1); + } + } + if(searchlan) + { + ENetAddress address; + address.host = ENET_HOST_BROADCAST; + address.port = CUBE_SERVINFO_PORT_LAN; buf.data = ping; buf.dataLength = p.length(); - enet_socket_send(pingsock, &si.address, &buf, 1); + enet_socket_send(pingsock, &address, &buf, 1); } lastinfo = totalmillis; } @@ -414,10 +433,12 @@ void checkpings() si = servers[i]; break; } + if(!si && searchlan) si = newserver(NULL, addr.host, CUBE_SERVINFO_TO_SERV_PORT(addr.port)); if(!si) continue; ucharbuf p(ping, len); - si->ping = lastmillis - getint(p); + si->lastpingmillis = totalmillis; + si->ping = totalmillis - getint(p); si->protocol = getint(p); if(si->protocol!=PROTOCOL_VERSION) si->ping = 9998; si->mode = getint(p); @@ -448,24 +469,31 @@ int sicompare(serverinfo **ap, serverinfo **bp) void *servmenu = NULL; +VAR(showallservers, 0, 1, 1); + void refreshservers(void *menu, bool init) { + static int servermenumillis; + if(init) { if(resolverthreads.empty()) resolverinit(); else resolverclear(); loopv(servers) resolverquery(servers[i]->name); + servermenumillis = totalmillis; } checkresolver(); checkpings(); - if(totalmillis - lastinfo >= 5000) pingservers(); + if(totalmillis - lastinfo >= servpingrate/(maxservpings ? (servers.length() + maxservpings - 1) / maxservpings : 1)) pingservers(); servers.sort(sicompare); if(menu) { + menureset(menu); loopv(servers) { serverinfo &si = *servers[i]; + if(!showallservers && si.lastpingmillis < servermenumillis) continue; if(si.address.host != ENET_HOST_ANY && si.ping != 9999) { if(si.protocol!=PROTOCOL_VERSION) s_sprintf(si.full)("%s:%d [%s protocol]", si.name, si.port, si.protocol") || strstr((char *)reply, "")) conoutf("master server not replying"); else { @@ -513,23 +541,9 @@ void getserversfrommaster(ENetAddress &masterserver, const char *masterpath) } } -void updatefrommaster() -{ - extern string masterpath; - extern ENetAddress masterserver; - getserversfrommaster(masterserver, masterpath); -} - -void updatefromlanmasters() -{ - ENetAddress bcast = { ENET_HOST_BROADCAST, CUBE_SERVINFO_PORT_LAN }; - getserversfrommaster(bcast, "/"); -} - COMMAND(addserver, ARG_2STR); COMMAND(clearservers, ARG_NONE); COMMAND(updatefrommaster, ARG_NONE); -COMMAND(updatefromlanmasters, ARG_NONE); void writeservercfg() { diff --git a/source/src/serverms.cpp b/source/src/serverms.cpp index bede0663..b1d42087 100644 --- a/source/src/serverms.cpp +++ b/source/src/serverms.cpp @@ -17,14 +17,7 @@ int connectwithtimeout(ENetSocket sock, const char *hostname, ENetAddress &remot } #endif -char *httpgetrequest(const char *hostname, const char *uripart, const char *ref, const char *agent) -{ - char *s = newstring(_MAXDEFSTR); - s_sprintf(s)("GET %s HTTP/1.0\nHost: %s\nReferer: %s\nUser-Agent: %s\n\n", uripart, hostname, ref, agent); - return s; -} - -ENetSocket httpgetsend(ENetAddress &remoteaddress, const char *hostname, char *request, ENetAddress *localaddress = NULL, ENetSocketType sockettype = ENET_SOCKET_TYPE_STREAM) +ENetSocket httpgetsend(ENetAddress &remoteaddress, const char *hostname, const char *req, const char *ref, const char *agent, ENetAddress *localaddress = NULL) { if(remoteaddress.host==ENET_HOST_ANY) { @@ -33,22 +26,27 @@ ENetSocket httpgetsend(ENetAddress &remoteaddress, const char *hostname, char *r #endif if(!resolverwait(hostname, &remoteaddress)) return ENET_SOCKET_NULL; } - ENetSocket sock = enet_socket_create(sockettype, localaddress); - if(sock==ENET_SOCKET_NULL || (sockettype==ENET_SOCKET_TYPE_STREAM && connectwithtimeout(sock, hostname, remoteaddress)<0)) + ENetSocket sock = enet_socket_create(ENET_SOCKET_TYPE_STREAM); + if(sock!=ENET_SOCKET_NULL && localaddress && enet_socket_bind(sock, localaddress) < 0) + { + enet_socket_destroy(sock); + sock = ENET_SOCKET_NULL; + } + if(sock==ENET_SOCKET_NULL || connectwithtimeout(sock, hostname, remoteaddress)<0) { #ifdef STANDALONE printf(sock==ENET_SOCKET_NULL ? "could not open socket\n" : "could not connect\n"); #endif return ENET_SOCKET_NULL; } - enet_socket_set_option(sock, ENET_SOCKOPT_BROADCAST, 1); ENetBuffer buf; - buf.data = request; + s_sprintfd(httpget)("GET %s HTTP/1.0\nHost: %s\nReferer: %s\nUser-Agent: %s\n\n", req, hostname, ref, agent); + buf.data = httpget; buf.dataLength = strlen((char *)buf.data); #ifdef STANDALONE printf("sending request to %s...\n", hostname); #endif - enet_socket_send(sock, sockettype==ENET_SOCKET_TYPE_STREAM ? NULL : &remoteaddress, &buf, 1); + enet_socket_send(sock, NULL, &buf, 1); return sock; } @@ -79,45 +77,24 @@ uchar *stripheader(uchar *b) } ENetSocket mssock = ENET_SOCKET_NULL; -ENetAddress masterserver = { ENET_HOST_ANY, 80 }; ENetAddress msaddress = { ENET_HOST_ANY, ENET_PORT_ANY }; -ENetAddress machinemasterserver = { ENET_HOST_ANY, CUBE_SERVINFO_PORT_LAN }; +ENetAddress masterserver = { ENET_HOST_ANY, 80 }; int lastupdatemaster = 0; string masterbase; string masterpath; uchar masterrep[MAXTRANS]; ENetBuffer masterb; -void updatemasterserver(int millis, ENetAddress &localaddr) +void updatemasterserver(int millis, const ENetAddress &localaddr) { if(millis/(60*60*1000)!=lastupdatemaster) // send alive signal to masterserver every hour of uptime { - char *request; s_sprintfd(path)("%sregister.do?action=add&port=%d", masterpath, localaddr.port); s_sprintfd(agent)("AssaultCube Server %d", AC_VERSION); - s_sprintfd(ref)("assaultcubeserver"); - - // register on public masterserver - request = httpgetrequest(masterbase, path, ref, agent); - mssock = httpgetsend(masterserver, masterbase, request, &msaddress); - delete[] request; + mssock = httpgetsend(masterserver, masterbase, path, "assaultcubeserver", agent, &msaddress); masterrep[0] = 0; masterb.data = masterrep; masterb.dataLength = MAXTRANS-1; - - // register on local machine masterserver - localmasterserver.create(machinemasterserver); // try creating an instance, maybe we are the first or the only local server - string localhost; - if(machinemasterserver.host==ENET_HOST_ANY) - { - s_strcpy(localhost, "localhost"); - } - else enet_address_get_host_ip(&machinemasterserver, localhost, _MAXDEFSTR); - request = httpgetrequest(localhost, path, ref, agent); - ENetSocket lansock = httpgetsend(machinemasterserver, localhost, request, &msaddress, ENET_SOCKET_TYPE_DATAGRAM); - delete[] request; - enet_socket_destroy(lansock); - lastupdatemaster = millis/(60*60*1000); } } @@ -134,127 +111,77 @@ void checkmasterreply() #ifndef STANDALONE #define RETRIEVELIMIT 20000 -#define BROADCASTLIMIT 5000 -uchar *retrieveservers(uchar *buf, int buflen, ENetAddress &masterserver, const char *lmasterpath) +uchar *retrieveservers(uchar *buf, int buflen) { - bool lansearch = (masterserver.host==ENET_HOST_BROADCAST); buf[0] = '\0'; - s_sprintfd(path)("%sretrieve.do?item=list", lmasterpath); + s_sprintfd(path)("%sretrieve.do?item=list", masterpath); s_sprintfd(agent)("AssaultCube Client %d", AC_VERSION); ENetAddress address = masterserver; - ENetSocket sock = ENET_SOCKET_NULL; - - if(lansearch) - { - char *request = httpgetrequest("", path, "assaultcubeclient", agent); - sock = httpgetsend(masterserver, "localhost", request, NULL, ENET_SOCKET_TYPE_DATAGRAM); - } - else - { - char *request = httpgetrequest(masterbase, path, "assaultcubeclient", agent); - sock = httpgetsend(address, masterbase, request); - } - + ENetSocket sock = httpgetsend(address, masterbase, path, "assaultcubeclient", agent); if(sock==ENET_SOCKET_NULL) return buf; - // only cache this if connection succeeds + /* only cache this if connection succeeds */ masterserver = address; + s_sprintfd(text)("retrieving servers from %s... (esc to abort)", masterbase); + show_out_of_renderloop_progress(0, text); + ENetBuffer eb; eb.data = buf; eb.dataLength = buflen-1; + int starttime = SDL_GetTicks(), timeout = 0; - - if(lansearch) // broadcast lan + while(httpgetreceive(sock, eb, 250)) { - s_sprintfd(text)("searching servers in your LAN... (esc to abort)"); - - while(timeout < BROADCASTLIMIT) + timeout = SDL_GetTicks() - starttime; + show_out_of_renderloop_progress(min(float(timeout)/RETRIEVELIMIT, 1.0f), text); + SDL_Event event; + while(SDL_PollEvent(&event)) { - timeout = SDL_GetTicks() - starttime; - show_out_of_renderloop_progress(min(float(timeout)/RETRIEVELIMIT, 1.0f), text); - SDL_Event event; - while(SDL_PollEvent(&event)) - { - if(event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE) timeout = RETRIEVELIMIT + 1; - } - - // collect responses - enet_uint32 events = ENET_SOCKET_WAIT_RECEIVE; - uchar lanbuf[32000] = { 0 }; - ENetBuffer laneb; - laneb.data = lanbuf; - laneb.dataLength = sizeof(lanbuf); - - if(enet_socket_wait(sock, &events, 250) >= 0 && events) - { - // strip response - int len = enet_socket_receive(sock, NULL, &laneb, 1); - if(len<=0) continue; - uchar *bodybegin = stripheader(lanbuf); - size_t headersize = bodybegin-lanbuf; - - // collect responses into a single buffer - memcpy(eb.data, lanbuf+headersize, len-headersize); - eb.data = ((char *)eb.data)+len-headersize; - ((char*)eb.data)[0] = 0; - eb.dataLength -= len-headersize; - } + if(event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE) timeout = RETRIEVELIMIT + 1; } - - enet_socket_destroy(sock); - return buf; - } - else // contact public masterserver - { - s_sprintfd(text)("retrieving servers from %s... (esc to abort)", masterbase); - show_out_of_renderloop_progress(0, text); - - // reconstruct multipacket reponse - while(httpgetreceive(sock, eb, 250)) + if(timeout > RETRIEVELIMIT) { - timeout = SDL_GetTicks() - starttime; - show_out_of_renderloop_progress(min(float(timeout)/RETRIEVELIMIT, 1.0f), text); - SDL_Event event; - while(SDL_PollEvent(&event)) - { - if(event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE) timeout = RETRIEVELIMIT + 1; - } - if(timeout > RETRIEVELIMIT) - { - buf[0] = '\0'; - enet_socket_destroy(sock); - return buf; - } + buf[0] = '\0'; + enet_socket_destroy(sock); + return buf; } - - enet_socket_destroy(sock); - return stripheader(buf); } + + return stripheader(buf); } #endif -ENetSocket pongsock = ENET_SOCKET_NULL; +ENetSocket pongsock = ENET_SOCKET_NULL, lansock = ENET_SOCKET_NULL; string serverdesc; -void serverms(int mode, int numplayers, int minremain, char *smapname, int millis, ENetAddress &localaddr) +void serverms(int mode, int numplayers, int minremain, char *smapname, int millis, const ENetAddress &localaddr) { checkmasterreply(); updatemasterserver(millis, localaddr); - // reply all server info requests - ENetBuffer buf; + static ENetSocketSet sockset; + ENET_SOCKETSET_EMPTY(sockset); + ENET_SOCKETSET_ADD(sockset, pongsock); + ENET_SOCKETSET_ADD(sockset, lansock); + if(enet_socketset_select(max(pongsock, lansock), &sockset, NULL, 0) <= 0) return; + + // reply all server info requests + ENetBuffer buf; ENetAddress addr; uchar data[MAXTRANS]; buf.data = data; int len; - enet_uint32 events = ENET_SOCKET_WAIT_RECEIVE; - while(enet_socket_wait(pongsock, &events, 0) >= 0 && events) + + loopi(2) { + ENetSocket sock = i ? lansock : pongsock; + if(!ENET_SOCKETSET_CHECK(sockset, sock)) continue; + buf.dataLength = sizeof(data); - len = enet_socket_receive(pongsock, &addr, &buf, 1); - if(len < 0) return; + len = enet_socket_receive(sock, &addr, &buf, 1); + if(len < 0) continue; // ping & pong buf ucharbuf pi(data, sizeof(data)); @@ -331,12 +258,28 @@ void servermsinit(const char *master, const char *ip, int infoport, const char * if(listen) { ENetAddress address = { ENET_HOST_ANY, infoport }; - if(*ip && enet_address_set_host(&address, ip)<0) printf("WARNING: server ip not resolved"); - if(*ip && enet_address_set_host(&msaddress, ip)<0) printf("WARNING: server ip not resolved"); - if(*ip && enet_address_set_host(&machinemasterserver, ip)<0) printf("WARNING: server ip not resolved"); - pongsock = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM, &address); + if(*ip) + { + if(enet_address_set_host(&address, ip)<0) printf("WARNING: server ip not resolved"); + else msaddress.host = address.host; + } + pongsock = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM); + if(pongsock != ENET_SOCKET_NULL && enet_socket_bind(pongsock, &address) < 0) + { + enet_socket_destroy(pongsock); + pongsock = ENET_SOCKET_NULL; + } if(pongsock == ENET_SOCKET_NULL) fatal("could not create server info socket\n"); else enet_socket_set_option(pongsock, ENET_SOCKOPT_NONBLOCK, 1); + address.port = CUBE_SERVINFO_PORT_LAN; + lansock = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM); + if(lansock != ENET_SOCKET_NULL && (enet_socket_set_option(lansock, ENET_SOCKOPT_REUSEADDR, 1) < 0 || enet_socket_bind(lansock, &address) < 0)) + { + enet_socket_destroy(lansock); + lansock = ENET_SOCKET_NULL; + } + if(lansock == ENET_SOCKET_NULL) fatal("could not create LAN server info socket\n"); + else enet_socket_set_option(lansock, ENET_SOCKOPT_NONBLOCK, 1); } }