aboutsummaryrefslogtreecommitdiff
path: root/plugins/dfnet
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dfnet')
-rw-r--r--plugins/dfnet/Makefile.am21
-rw-r--r--plugins/dfnet/Makefile.in592
-rw-r--r--plugins/dfnet/cfg.c37
-rw-r--r--plugins/dfnet/dfnet.c274
-rw-r--r--plugins/dfnet/dfnet.glade2265
-rw-r--r--plugins/dfnet/dfnet.h80
-rw-r--r--plugins/dfnet/gui.c233
-rw-r--r--plugins/dfnet/unix.c125
8 files changed, 1627 insertions, 0 deletions
diff --git a/plugins/dfnet/Makefile.am b/plugins/dfnet/Makefile.am
new file mode 100644
index 0000000..36f9768
--- /dev/null
+++ b/plugins/dfnet/Makefile.am
@@ -0,0 +1,21 @@
+bindir = @libdir@/games/psemu/
+libdir = @libdir@/games/psemu/
+
+lib_LTLIBRARIES = libDFNet.la
+
+libDFNet_la_SOURCES = dfnet.c unix.c cfg.c
+libDFNet_la_LDFLAGS = -module -avoid-version
+
+INCLUDES = -DPIXMAPDIR=\"${datadir}/pixmaps/\" \
+ -DLOCALE_DIR=\"${datadir}/locale/\" \
+ -DDATADIR=\"${datadir}/psemu/\" \
+ $(GTK2_CFLAGS) $(GLADE2_CFLAGS) \
+ -I../../libpcsxcore -I../../include
+
+bin_PROGRAMS = cfgDFNet
+cfgDFNet_SOURCES = gui.c
+cfgDFNet_LDADD = $(GTK2_LIBS) $(GLADE2_LIBS)
+
+glade_DATA = dfnet.glade2
+gladedir = $(datadir)/psemu/
+EXTRA_DIST = $(glade_DATA)
diff --git a/plugins/dfnet/Makefile.in b/plugins/dfnet/Makefile.in
new file mode 100644
index 0000000..9de71c8
--- /dev/null
+++ b/plugins/dfnet/Makefile.in
@@ -0,0 +1,592 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+bin_PROGRAMS = cfgDFNet$(EXEEXT)
+subdir = plugins/dfnet
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(gladedir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libDFNet_la_LIBADD =
+am_libDFNet_la_OBJECTS = dfnet.lo unix.lo cfg.lo
+libDFNet_la_OBJECTS = $(am_libDFNet_la_OBJECTS)
+libDFNet_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libDFNet_la_LDFLAGS) $(LDFLAGS) -o $@
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_cfgDFNet_OBJECTS = gui.$(OBJEXT)
+cfgDFNet_OBJECTS = $(am_cfgDFNet_OBJECTS)
+am__DEPENDENCIES_1 =
+cfgDFNet_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libDFNet_la_SOURCES) $(cfgDFNet_SOURCES)
+DIST_SOURCES = $(libDFNet_la_SOURCES) $(cfgDFNet_SOURCES)
+gladeDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(glade_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSA_CFLAGS = @ALSA_CFLAGS@
+ALSA_LIBS = @ALSA_LIBS@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLADE2_CFLAGS = @GLADE2_CFLAGS@
+GLADE2_LIBS = @GLADE2_LIBS@
+GLIB2_CFLAGS = @GLIB2_CFLAGS@
+GLIB2_LIBS = @GLIB2_LIBS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+GTK2_CFLAGS = @GTK2_CFLAGS@
+GTK2_LIBS = @GTK2_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCDIO_CFLAGS = @LIBCDIO_CFLAGS@
+LIBCDIO_LIBS = @LIBCDIO_LIBS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NASM = @NASM@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PEOPSXGL = @PEOPSXGL@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+PULSEAUDIO_CFLAGS = @PULSEAUDIO_CFLAGS@
+PULSEAUDIO_LIBS = @PULSEAUDIO_LIBS@
+RANLIB = @RANLIB@
+SDL_CFLAGS = @SDL_CFLAGS@
+SDL_CONFIG = @SDL_CONFIG@
+SDL_LIBS = @SDL_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+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@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @libdir@/games/psemu/
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@/games/psemu/
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+lib_LTLIBRARIES = libDFNet.la
+libDFNet_la_SOURCES = dfnet.c unix.c cfg.c
+libDFNet_la_LDFLAGS = -module -avoid-version
+INCLUDES = -DPIXMAPDIR=\"${datadir}/pixmaps/\" \
+ -DLOCALE_DIR=\"${datadir}/locale/\" \
+ -DDATADIR=\"${datadir}/psemu/\" \
+ $(GTK2_CFLAGS) $(GLADE2_CFLAGS) \
+ -I../../libpcsxcore -I../../include
+
+cfgDFNet_SOURCES = gui.c
+cfgDFNet_LDADD = $(GTK2_LIBS) $(GLADE2_LIBS)
+glade_DATA = dfnet.glade2
+gladedir = $(datadir)/psemu/
+EXTRA_DIST = $(glade_DATA)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/dfnet/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu plugins/dfnet/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libDFNet.la: $(libDFNet_la_OBJECTS) $(libDFNet_la_DEPENDENCIES)
+ $(libDFNet_la_LINK) -rpath $(libdir) $(libDFNet_la_OBJECTS) $(libDFNet_la_LIBADD) $(LIBS)
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+cfgDFNet$(EXEEXT): $(cfgDFNet_OBJECTS) $(cfgDFNet_DEPENDENCIES)
+ @rm -f cfgDFNet$(EXEEXT)
+ $(LINK) $(cfgDFNet_OBJECTS) $(cfgDFNet_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfnet.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix.Plo@am__quote@
+
+.c.o:
+@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@ $(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) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-gladeDATA: $(glade_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(gladedir)" || $(MKDIR_P) "$(DESTDIR)$(gladedir)"
+ @list='$(glade_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(gladeDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(gladedir)/$$f'"; \
+ $(gladeDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gladedir)/$$f"; \
+ done
+
+uninstall-gladeDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(glade_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(gladedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(gladedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(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; 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) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ 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; 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
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @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; \
+ 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; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA)
+install-binPROGRAMS: install-libLTLIBRARIES
+
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gladedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+ clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-gladeDATA
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
+
+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
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-gladeDATA \
+ uninstall-libLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libLTLIBRARIES clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-gladeDATA install-html \
+ install-html-am install-info install-info-am \
+ install-libLTLIBRARIES 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-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-gladeDATA uninstall-libLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/plugins/dfnet/cfg.c b/plugins/dfnet/cfg.c
new file mode 100644
index 0000000..a63b074
--- /dev/null
+++ b/plugins/dfnet/cfg.c
@@ -0,0 +1,37 @@
+//
+// DF Netplay Plugin
+//
+// Based on netSock 0.2 by linuzappz.
+// The Plugin is free source code.
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "dfnet.h"
+
+#define CFG_FILENAME "dfnet.cfg"
+
+void SaveConf() {
+ FILE *f;
+
+ f = fopen(CFG_FILENAME, "w");
+ if (f == NULL) return;
+ fwrite(&conf, 1, sizeof(conf), f);
+ fclose(f);
+}
+
+void LoadConf() {
+ FILE *f;
+
+ f = fopen(CFG_FILENAME, "r");
+ if (f == NULL) {
+ conf.PlayerNum = 1;
+ conf.PortNum = 33306;
+ strcpy(conf.ipAddress, "127.0.0.1");
+ return;
+ }
+
+ fread(&conf, 1, sizeof(conf), f);
+ fclose(f);
+}
diff --git a/plugins/dfnet/dfnet.c b/plugins/dfnet/dfnet.c
new file mode 100644
index 0000000..d76a757
--- /dev/null
+++ b/plugins/dfnet/dfnet.c
@@ -0,0 +1,274 @@
+//
+// DF Netplay Plugin
+//
+// Based on netSock 0.2 by linuzappz.
+// The Plugin is free source code.
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+extern int errno;
+
+#include "dfnet.h"
+
+const unsigned char version = 2; // NET library v2
+const unsigned char revision = 0;
+const unsigned char build = 3; // increase that with each version
+
+static char *libraryName = N_("Socket Driver");
+
+unsigned long CALLBACK PSEgetLibType() {
+ return PSE_LT_NET;
+}
+
+char* CALLBACK PSEgetLibName() {
+ return _(libraryName);
+}
+
+unsigned long CALLBACK PSEgetLibVersion() {
+ return version << 16 | revision << 8 | build;
+}
+
+long CALLBACK NETinit() {
+ return sockInit();
+}
+
+int SEND(const void *buf, int Size, int Mode) {
+ int bytes;
+ int count = 0;
+ const char *pData = (const char *)buf;
+
+ if (Mode & PSE_NET_NONBLOCKING) { // NONBLOCKING
+ int ret;
+
+ FD_ZERO(&wset);
+ FD_SET(sock, &wset);
+
+ ret = select(sock + 1, NULL, &wset, NULL, &tm);
+ if (ret == -1) return -1;
+
+ if (FD_ISSET(sock, &wset)) {
+ return send(sock, pData, Size, 0);
+ } else {
+ return 0;
+ }
+ } else { // BLOCKING
+ while (Size > 0) {
+ bytes = send(sock, pData, Size, 0);
+ if (bytes < 0) return -1;
+ pData += bytes; Size -= bytes;
+ count += bytes;
+ }
+ }
+
+ return count;
+}
+
+int RECV(void *buf, int Size, int Mode) {
+ int bytes;
+ int count = 0;
+ char *pData = (char *)buf;
+
+ if (Mode & PSE_NET_NONBLOCKING) { // NONBLOCKING
+ int ret;
+
+ FD_ZERO(&rset);
+ FD_SET(sock, &rset);
+
+ ret = select(sock, &rset, NULL, NULL, &tm);
+
+ if (FD_ISSET(sock, &rset)) {
+ return recv(sock, pData, Size, 0);
+ } else {
+ return 0;
+ }
+ } else { // BLOCKING
+ while (Size > 0) {
+ bytes = recv(sock, pData, Size, 0);
+ if (bytes == -1) return -1;
+ pData+= bytes; Size-= bytes;
+ count+= bytes;
+ }
+ }
+
+ return count;
+}
+
+long CALLBACK NETopen(unsigned long *gpuDisp) {
+ int ret = sockOpen();
+
+ struct sockaddr_in address;
+
+ if (ret == -1) return -1;
+
+ if (conf.PlayerNum == 1) {
+ int listen_sock, reuse_addr = 1;
+ int ret;
+
+ memset((char *)&address, 0, sizeof (address));
+
+ address.sin_family = AF_INET;
+ address.sin_port = htons(conf.PortNum);
+ address.sin_addr.s_addr = INADDR_ANY;
+
+ listen_sock = socket(AF_INET, SOCK_STREAM, 0);
+ if (listen_sock == -1)
+ return -1;
+
+ setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&reuse_addr, sizeof(reuse_addr));
+
+ if (bind(listen_sock,(struct sockaddr *) &address, sizeof(address)) == -1)
+ return -1;
+
+ if (listen(listen_sock, 1) != 0)
+ return -1;
+
+ sock = -1;
+
+ WaitCancel = 0;
+ sockCreateWaitDlg();
+
+ while (sock < 0) {
+ FD_ZERO(&rset);
+ FD_SET(listen_sock, &rset);
+
+ ret = select(listen_sock + 1, &rset, NULL, NULL, &tm);
+ if (FD_ISSET(listen_sock, &rset)) {
+ sock = accept(listen_sock, NULL, NULL);
+ }
+
+ if (WaitCancel) break;
+ sockDlgUpdate();
+ }
+ close(listen_sock);
+
+ sockDestroyWaitDlg();
+ if (WaitCancel == 1) return -1;
+ } else {
+ memset((char *)&address, 0, sizeof(address));
+ address.sin_family = AF_INET;
+ address.sin_port = htons(conf.PortNum);
+ address.sin_addr.s_addr = inet_addr(conf.ipAddress);
+
+ sock = socket(AF_INET, SOCK_STREAM, 0);
+
+ if (connect(sock, (struct sockaddr *)&address, sizeof(address))!=0) {
+ SysMessage(_("error connecting to %s: %s\n"), conf.ipAddress, strerror(errno));
+ return -1;
+ }
+ }
+
+ PadInit = 0;
+ PadCount = 0;
+ PadSize[0] = -1;
+ PadSize[1] = -1;
+ PadRecvSize = -1;
+ PadSendSize = -1;
+ Ping = sockPing();
+ Ping = (sockPing() + Ping) / 2;
+ Ping = (sockPing() + Ping) / 2;
+
+ if (conf.PlayerNum == 1) {
+ PadCountMax = (int)(((double)Ping / 1000.0) * 60.0);
+ if (PadCountMax <= 0) PadCountMax = 1;
+ SEND(&PadCountMax, 4, PSE_NET_BLOCKING);
+ } else {
+ RECV(&PadCountMax, 4, PSE_NET_BLOCKING);
+ }
+
+ PadSendData = (char *)malloc(PadCountMax * 128);
+ if (PadSendData == NULL) {
+ SysMessage(_("Error allocating memory!\n")); return -1;
+ }
+ memset(PadSendData, 0xff, PadCountMax);
+
+ return ret;
+}
+
+long CALLBACK NETclose() {
+ close(sock);
+
+ return 0;
+}
+
+long CALLBACK NETshutdown() {
+ return sockShutdown();
+}
+
+void CALLBACK NETpause() {
+/* unsigned char Code = 0x80;
+
+ SEND(&Code, 1, PSE_NET_BLOCKING);*/
+}
+
+void CALLBACK NETresume() {
+/* unsigned char Code = 0x80;
+
+ SEND(&Code, 1, PSE_NET_BLOCKING);*/
+}
+
+long CALLBACK NETsendData(void *pData, int Size, int Mode) {
+ return SEND(pData, Size, Mode);
+}
+
+long CALLBACK NETrecvData(void *pData, int Size, int Mode) {
+ return RECV(pData, Size, Mode);
+}
+
+long CALLBACK NETsendPadData(void *pData, int Size) {
+ if (PadSendSize == -1) {
+ PadSendSize = Size;
+
+ if (SEND(&PadSendSize, 1, PSE_NET_BLOCKING) == -1)
+ return -1;
+
+ if (RECV(&PadRecvSize, 1, PSE_NET_BLOCKING) == -1)
+ return -1;
+ }
+
+ memcpy(&PadSendData[PadCount], pData, Size);
+ if (SEND(pData, PadSendSize, PSE_NET_BLOCKING) == -1)
+ return -1;
+
+ return 0;
+}
+
+long CALLBACK NETrecvPadData(void *pData, int Pad) {
+ if (PadInit == 0) {
+ if (conf.PlayerNum == Pad) {
+ memset(pData, 0xff, PadSendSize);
+ } else {
+ memset(pData, 0xff, PadRecvSize);
+ }
+ } else {
+ if (conf.PlayerNum == Pad) {
+ memcpy(pData, &PadSendData[PadCount == 0 ? PadCountMax-1 : PadCount-1], PadSendSize);
+ } else {
+ if (RECV(pData, PadRecvSize, PSE_NET_BLOCKING) == -1)
+ return -1;
+ }
+ }
+
+ if (Pad == 2) {
+ PadCount++;
+ if (PadCount == PadCountMax) {
+ PadCount = 0;
+ PadInit = 1;
+ }
+ }
+
+ return 0;
+}
+
+long CALLBACK NETqueryPlayer() {
+ return conf.PlayerNum;
+}
+
+long CALLBACK NETtest() {
+ return 0;
+}
diff --git a/plugins/dfnet/dfnet.glade2 b/plugins/dfnet/dfnet.glade2
new file mode 100644
index 0000000..36c9b4b
--- /dev/null
+++ b/plugins/dfnet/dfnet.glade2
@@ -0,0 +1,265 @@
+<?xml version="1.0"?>
+<glade-interface>
+ <!-- interface-requires gtk+ 2.8 -->
+ <!-- interface-naming-policy project-wide -->
+ <widget class="GtkDialog" id="dlgStart">
+ <property name="border_width">5</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="window_position">center</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Select here if you'll be Server (Player1) or Client (Player2).
+
+If you select Server you must Copy your IP address to the Clipboard and paste if (Ctrl+V) wherever the Client can see it.
+
+If you selected Client please enter the IP address the Server gave to you in the IP Address Control.</property>
+ <property name="wrap">True</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">8</property>
+ <property name="row_spacing">12</property>
+ <child>
+ <widget class="GtkButton" id="btnCopyIP">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-copy</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Copy PC IP to Clipboard</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="tbServerIP">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="max_length">15</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <signal name="activate" handler="on_tbServerIP_activate"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="rbServer">
+ <property name="label" translatable="yes">Server (Player1)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="rbClient">
+ <property name="label" translatable="yes">Client (Player2)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">rbServer</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">2</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Do not change if not necessary (remember it must be changed on both sides).</property>
+ <property name="wrap">True</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Port Number</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="tbPort">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="max_length">5</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <widget class="GtkButton" id="btnStart">
+ <property name="response_id">-5</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="stock">gtk-network</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Start Game</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="btnOffline">
+ <property name="response_id">-6</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="stock">gtk-no</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Play Offline</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
diff --git a/plugins/dfnet/dfnet.h b/plugins/dfnet/dfnet.h
new file mode 100644
index 0000000..62f3842
--- /dev/null
+++ b/plugins/dfnet/dfnet.h
@@ -0,0 +1,80 @@
+//
+// DF Netplay Plugin
+//
+// Based on netSock 0.2 by linuzappz.
+// The Plugin is free source code.
+//
+
+#ifndef __DFNET_H__
+#define __DFNET_H__
+
+#include "config.h"
+
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <unistd.h>
+
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <locale.h>
+#define _(x) gettext(x)
+#define N_(x) (x)
+#else
+#define _(x) (x)
+#define N_(x) (x)
+#endif
+
+typedef void* HWND;
+
+struct timeval tm;
+
+#define CALLBACK
+
+long timeGetTime();
+
+#include "psemu_plugin_defs.h"
+
+typedef struct {
+ int PlayerNum;
+ unsigned short PortNum;
+ char ipAddress[32];
+} Config;
+
+Config conf;
+
+void LoadConf();
+void SaveConf();
+
+long sock;
+char *PadSendData;
+char *PadRecvData;
+char PadSendSize;
+char PadRecvSize;
+char PadSize[2];
+int PadCount;
+int PadCountMax;
+int PadInit;
+int Ping;
+volatile int WaitCancel;
+fd_set rset;
+fd_set wset;
+
+long sockInit();
+long sockShutdown();
+long sockOpen();
+void sockCreateWaitDlg();
+void sockDlgUpdate();
+void sockDestroyWaitDlg();
+int sockPing();
+
+int ShowPauseDlg();
+void SysMessage(const char *fmt, ...);
+
+int SEND(const void *pData, int Size, int Mode);
+int RECV(void *pData, int Size, int Mode);
+
+#endif
diff --git a/plugins/dfnet/gui.c b/plugins/dfnet/gui.c
new file mode 100644
index 0000000..60e165a
--- /dev/null
+++ b/plugins/dfnet/gui.c
@@ -0,0 +1,233 @@
+//
+// DF Netplay Plugin
+//
+// Based on netSock 0.2 by linuzappz.
+// The Plugin is free source code.
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <signal.h>
+
+#include "cfg.c"
+
+void cfgSysMessage(const char *fmt, ...) {
+ GtkWidget *MsgDlg;
+ va_list list;
+ char msg[512];
+
+ va_start(list, fmt);
+ vsprintf(msg, fmt, list);
+ va_end(list);
+
+ if (msg[strlen(msg) - 1] == '\n') msg[strlen(msg) - 1] = 0;
+
+ MsgDlg = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("NetPlay"));
+ gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(MsgDlg), "%s", msg);
+
+ gtk_dialog_run(GTK_DIALOG(MsgDlg));
+ gtk_widget_destroy(MsgDlg);
+}
+
+void CFGconfigure() {
+ cfgSysMessage(_("Nothing to configure"));
+}
+
+#ifdef __linux__
+
+#include <sys/ioctl.h>
+#include <linux/if.h>
+
+#define MAXINTERFACES 16
+
+void sockGetIP(char *IPAddress) {
+ int fd, intrface;
+ struct ifreq buf[MAXINTERFACES];
+ struct ifconf ifc;
+ struct sockaddr_in addr;
+
+ strcpy(IPAddress, "127.0.0.1");
+
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) >= 0) {
+ ifc.ifc_len = sizeof(buf);
+ ifc.ifc_buf = (caddr_t)buf;
+ if (!ioctl(fd, SIOCGIFCONF, (char *)&ifc)) {
+ intrface = ifc.ifc_len / sizeof(struct ifreq);
+ while (intrface-- > 0) {
+ if (!(ioctl(fd, SIOCGIFADDR, (char *)&buf[intrface]))) {
+ memcpy(&addr, &(buf[intrface].ifr_addr), sizeof(addr));
+ strcpy(IPAddress, inet_ntoa(addr.sin_addr));
+ break;
+ }
+ }
+ }
+ close(fd);
+ }
+}
+
+#else
+
+void sockGetIP(char *IPAddress) {
+ struct hostent *host;
+ char str[256];
+
+ gethostname(str, 256);
+ host = gethostbyname(str);
+
+ if (host != NULL)
+ strcpy(IPAddress, inet_ntoa(*((struct in_addr *)host->h_addr_list[0])));
+ else strcpy(IPAddress, "127.0.0.1");
+}
+
+#endif
+
+void OnCopyIP(GtkWidget *widget, gpointer user_data) {
+ char str[256];
+
+ sockGetIP(str);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), str, strlen(str));
+ cfgSysMessage(_("IP %s"), str);
+}
+
+long CFGopen() {
+ GladeXML *xml;
+ GtkWidget *widget, *MainWindow;
+ char buf[256];
+
+ LoadConf();
+
+ xml = glade_xml_new(DATADIR "dfnet.glade2", "dlgStart", NULL);
+ if (xml == NULL) {
+ g_warning("We could not load the interface!");
+ return 0;
+ }
+
+ MainWindow = glade_xml_get_widget(xml, "dlgStart");
+ gtk_window_set_title(GTK_WINDOW(MainWindow), _("NetPlay"));
+
+ widget = glade_xml_get_widget(xml, "btnCopyIP");
+ g_signal_connect_data(GTK_OBJECT(widget), "clicked",
+ GTK_SIGNAL_FUNC(OnCopyIP), NULL, NULL, G_CONNECT_AFTER);
+
+ widget = glade_xml_get_widget(xml, "tbServerIP");
+ gtk_entry_set_text(GTK_ENTRY(widget), conf.ipAddress);
+
+ widget = glade_xml_get_widget(xml, "tbPort");
+ sprintf(buf, "%d", conf.PortNum);
+ gtk_entry_set_text(GTK_ENTRY(widget), buf);
+
+ if (conf.PlayerNum == 1) {
+ widget = glade_xml_get_widget(xml, "rbServer");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
+ } else {
+ widget = glade_xml_get_widget(xml, "rbClient");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
+ }
+
+ if (gtk_dialog_run(GTK_DIALOG(MainWindow)) == GTK_RESPONSE_OK) {
+ widget = glade_xml_get_widget(xml, "tbServerIP");
+ strcpy(conf.ipAddress, gtk_entry_get_text(GTK_ENTRY(widget)));
+
+ widget = glade_xml_get_widget(xml, "tbPort");
+ conf.PortNum = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
+
+ widget = glade_xml_get_widget(xml, "rbServer");
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
+ conf.PlayerNum = 1;
+ } else {
+ conf.PlayerNum = 2;
+ }
+
+ SaveConf();
+ gtk_widget_destroy(MainWindow);
+ return 1;
+ }
+
+ gtk_widget_destroy(MainWindow);
+
+ return 0;
+}
+
+void OnWaitDialog_Abort() {
+ kill(getppid(), SIGUSR2);
+}
+
+void CFGwait() {
+ GtkWidget *WaitDlg;
+
+ WaitDlg = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CANCEL, _("Waiting for connection..."));
+
+ gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(WaitDlg),
+ _("The Client should now Start a Connection, waiting..."));
+
+ gtk_dialog_run(GTK_DIALOG(WaitDlg));
+ gtk_widget_destroy(WaitDlg);
+
+ OnWaitDialog_Abort();
+}
+
+long CFGpause() {
+ return 0;
+}
+
+void CFGabout() {
+ const char *authors[]= {"linuzappz <linuzappz@hotmail.com>", "Wei Mingzhi <whistler_wmz@users.sf.net>", NULL};
+ GtkWidget *widget;
+
+ widget = gtk_about_dialog_new();
+ gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(widget), "Socket NetPlay Driver");
+ gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(widget), "0.21");
+ gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(widget), authors);
+ gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(widget), "http://www.codeplex.com/pcsxr/");
+
+ gtk_dialog_run(GTK_DIALOG(widget));
+ gtk_widget_destroy(widget);
+}
+
+long CFGmessage(char *args[], int num) {
+ char msg[512];
+
+ memset(msg, 0, sizeof(msg));
+ while (num) {
+ strcat(msg, *args); strcat(msg, " ");
+ num--; args++;
+ }
+ cfgSysMessage(msg);
+
+ return 0;
+}
+
+int main(int argc, char *argv[]) {
+#ifdef ENABLE_NLS
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+ textdomain(GETTEXT_PACKAGE);
+#endif
+
+ gtk_set_locale();
+ gtk_init(&argc, &argv);
+
+ if (!strcmp(argv[1], "configure")) {
+ CFGconfigure();
+ } else if (!strcmp(argv[1], "open")) {
+ return CFGopen();
+ } else if (!strcmp(argv[1], "wait")) {
+ CFGwait();
+ } else if (!strcmp(argv[1], "pause")) {
+ return CFGpause();
+ } else if (!strcmp(argv[1], "about")) {
+ CFGabout();
+ } else if (!strcmp(argv[1], "message")) {
+ CFGmessage(&argv[2], argc - 2);
+ }
+
+ return 0;
+}
diff --git a/plugins/dfnet/unix.c b/plugins/dfnet/unix.c
new file mode 100644
index 0000000..390a5fc
--- /dev/null
+++ b/plugins/dfnet/unix.c
@@ -0,0 +1,125 @@
+//
+// DF Netplay Plugin
+//
+// Based on netSock 0.2 by linuzappz.
+// The Plugin is free source code.
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/wait.h>
+extern int errno;
+
+#include "dfnet.h"
+
+int ExecCfg(const char *arg, int f) {
+ char cfg[512];
+
+ strcpy(cfg, "cfg/cfgDFNet");
+ strcat(cfg, " ");
+ strcat(cfg, arg);
+
+ if (f) {
+ if (fork() == 0) { system(cfg); exit(0); }
+ return 0;
+ }
+
+ return system(cfg);
+}
+
+void SysMessage(const char *fmt, ...) {
+ va_list list;
+ char msg[512];
+ char cmd[512];
+
+ va_start(list, fmt);
+ vsprintf(msg, fmt, list);
+ va_end(list);
+
+ sprintf(cmd, "message %s\n", msg);
+ ExecCfg(cmd, 1);
+}
+
+long sockInit() {
+ conf.PlayerNum = 0;
+ tm.tv_sec = 0;
+ tm.tv_usec = 0;
+
+ return 0;
+}
+
+long sockShutdown() {
+ return 0;
+}
+
+long sockOpen() {
+ if (ExecCfg("open", 0) == 0) return -1;
+
+ LoadConf();
+
+ return 0;
+}
+
+int sockPing() {
+ char data[32];
+ struct timeval tv, tvn;
+
+ memset(data, 0, sizeof(data));
+
+ gettimeofday(&tv, NULL);
+ SEND(data, 32, PSE_NET_BLOCKING);
+ RECV(data, 32, PSE_NET_BLOCKING);
+ gettimeofday(&tvn, NULL);
+
+ return (tvn.tv_sec - tv.tv_sec) * 1000 +
+ (tvn.tv_usec - tv.tv_usec) / 1000;
+}
+
+void CALLBACK NETconfigure() {
+ ExecCfg("configure", 1);
+}
+
+void CALLBACK NETabout() {
+ ExecCfg("about", 1);
+}
+
+pid_t cfgpid = 0;
+
+void OnWaitDlg_Abort(int num) {
+ WaitCancel = 1;
+ cfgpid = 0;
+}
+
+void sockCreateWaitDlg() {
+ signal(SIGUSR2, OnWaitDlg_Abort);
+ if ((cfgpid = fork()) == 0) {
+ execl("cfg/cfgDFNet", "cfgDFNet", "wait", NULL);
+ exit(0);
+ }
+ usleep(100000);
+}
+
+void sockDlgUpdate() {
+ usleep(100000);
+}
+
+void sockDestroyWaitDlg() {
+ if (cfgpid > 0) {
+ kill(cfgpid, SIGKILL);
+ cfgpid = 0;
+ }
+}
+
+long timeGetTime() {
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ return (tv.tv_sec) * 1000 + (tv.tv_usec) / 1000;
+}