pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/games/tetrinetx Imported tetrinetx from pkgsrc-wip.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0f2e074b17e2
branches:  trunk
changeset: 508083:0f2e074b17e2
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Feb 14 17:03:54 2006 +0000

description:
Imported tetrinetx from pkgsrc-wip.

TetriNET is an addictive 6 player tetr*s game

What this program does is set up a TetriNET server that ordinary
TetriNET clients can connect to. It attempts to fix some of the
"glaring" holes in the TetriNET protocol that I discovered, and which
I'm sure some people use as cheats, but I now see why it is nearly
impossible to fix ;), without a modification to the client.
I've kept the server as close to the same as the original TetriNET
server, but I've added some extras that I've often wanted, such as
the "/kick" and "/ban" keywords.
Please note this server in no way encompasses the whole game. The clients
are the ones that do most of the work, with the server just passing suitable
packets between each client, and of course adding some of its own.

Author: Brendan Grieve (brg%cheerful.com@localhost)

Packaged by David Ferlier.

diffstat:

 games/tetrinetx/DEINSTALL        |  27 +++++++++++++++++++++++++++
 games/tetrinetx/DESCR            |  15 +++++++++++++++
 games/tetrinetx/MESSAGE          |  11 +++++++++++
 games/tetrinetx/Makefile         |  40 ++++++++++++++++++++++++++++++++++++++++
 games/tetrinetx/PLIST            |   8 ++++++++
 games/tetrinetx/distinfo         |   7 +++++++
 games/tetrinetx/files/tetrinetx  |  15 +++++++++++++++
 games/tetrinetx/patches/patch-aa |  32 ++++++++++++++++++++++++++++++++
 games/tetrinetx/patches/patch-ab |  37 +++++++++++++++++++++++++++++++++++++
 9 files changed, 192 insertions(+), 0 deletions(-)

diffs (228 lines):

diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/DEINSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/DEINSTALL Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,27 @@
+#!/bin/sh
+# $NetBSD: DEINSTALL,v 1.1.1.1 2006/02/14 17:03:54 rillig Exp $
+
+PKGNAME=$1
+STAGE=$2
+LIST="${PKG_PREFIX}/share/tetrinetx/game.log"
+
+case ${STAGE} in
+       DEINSTALL)
+               for to_trash in ${LIST}; do
+                       if [ -d "${to_trash}" ]; then
+                               rm -rf ${to_trash}/*
+                       elif [ -f "${to_trash}" ]; then
+                               rm ${to_trash}
+                       fi
+               done
+               ;;
+
+       POST-DEINSTALL)
+               ;;
+
+       *)
+               echo "Unexpected argument: ${STAGE}"
+               exit 1
+               ;;
+esac
+exit 0
diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/DESCR     Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,15 @@
+TetriNET is an addictive 6 player tetr*s game
+
+What this program does is set up a TetriNET server that ordinary
+TetriNET clients can connect to. It attempts to fix some of the
+"glaring" holes in the TetriNET protocol that I discovered, and which
+I'm sure some people use as cheats, but I now see why it is nearly
+impossible to fix ;), without a modification to the client.
+I've kept the server as close to the same as the original TetriNET
+server, but I've added some extras that I've often wanted, such as
+the "/kick" and "/ban" keywords.
+Please note this server in no way encompasses the whole game. The clients
+are the ones that do most of the work, with the server just passing suitable
+packets between each client, and of course adding some of its own.
+
+Author: Brendan Grieve (brg%cheerful.com@localhost)
diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/MESSAGE   Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,11 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2006/02/14 17:03:54 rillig Exp $
+
+It is recommended to tune tetrinetx configuration and motd files. They are
+located in ${PREFIX}/share/tetrinetx
+
+A rc.d script is provided: if you want tetrinetx to be launched at system
+startup, copy it from ${PREFIX}/share/examples/rc.d into /etc/rc.d
+and add tetrinetx=YES in /etc/rc.conf.
+
+===========================================================================
diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/Makefile  Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,40 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/02/14 17:03:54 rillig Exp $
+
+DISTNAME=      tetrinetx-1.13.16+qirc-1.40c
+PKGNAME=       tetrinetx-1.13.16
+CATEGORIES=    games
+MASTER_SITES=  http://tetrinetx.sourceforge.net/
+
+MAINTAINER=    david%netbsd-fr.org@localhost
+HOMEPAGE=      ${MASTER_SITES}
+COMMENT=       Server for an addictive 6 player tetris game
+
+WRKSRC=                ${WRKDIR}/${DISTNAME}
+SHAREDIR=      ${PREFIX}/share/tetrinetx
+BINARY=                tetrix.netbsd
+RCD_SCRIPTS=   tetrinetx
+
+LIBS.SunOS+=   -lsocket -lnsl -lresolv
+
+do-build:
+       cd ${WRKSRC:Q}/src && \
+       ${CC} \
+               ${CPPFLAGS} -I${LOCALBASE:Q}/include                    \
+               -DSHAREDIR=\"${SHAREDIR:Q}\" -DPREFIX=\"${PREFIX:Q}\"   \
+               ${CFLAGS} -fno-strength-reduce -Wall                    \
+               ${LDFLAGS} -L${LOCALBASE:Q}/lib -ladns ${LIBS}          \
+               -o ../bin/${BINARY:Q} -Wl,-R${LOCALBASE:Q}/lib          \
+               main.c
+
+do-install:
+       ${INSTALL_DATA_DIR} ${SHAREDIR}
+       ${INSTALL_DATA_DIR} ${PREFIX:Q}/share/examples/rc.d
+       ${INSTALL_PROGRAM} ${WRKSRC:Q}/bin/${BINARY:Q} ${PREFIX:Q}/bin/tetrix
+       ${INSTALL_DATA} ${WRKSRC:Q}/bin/game.conf ${SHAREDIR:Q}
+       ${INSTALL_DATA} ${WRKSRC:Q}/bin/game.secure ${SHAREDIR:Q}
+       ${INSTALL_DATA} ${WRKSRC:Q}/bin/game.motd ${SHAREDIR:Q}
+       ${INSTALL_DATA} ${WRKSRC:Q}/bin/game.pmotd ${SHAREDIR:Q}
+       ${INSTALL_SCRIPT} ${FILESDIR:Q}/tetrinetx ${PREFIX:Q}/share/examples/rc.d/
+
+.include "../../net/adns/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/PLIST     Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/02/14 17:03:54 rillig Exp $
+bin/tetrix
+share/examples/rc.d/tetrinetx
+share/tetrinetx/game.conf
+share/tetrinetx/game.motd
+share/tetrinetx/game.pmotd
+share/tetrinetx/game.secure
+@dirrm share/tetrinetx
diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/distinfo  Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1.1.1 2006/02/14 17:03:54 rillig Exp $
+
+SHA1 (tetrinetx-1.13.16+qirc-1.40c.tar.gz) = 3bc0a8ce53bef3ef68b028834689d6fe85c8150a
+RMD160 (tetrinetx-1.13.16+qirc-1.40c.tar.gz) = 447c1d239919f2390748c8808cd1c026d0236afc
+Size (tetrinetx-1.13.16+qirc-1.40c.tar.gz) = 81447 bytes
+SHA1 (patch-aa) = c89202b583e2c3ebac9f566b451a61fece517bc6
+SHA1 (patch-ab) = 10136812d7d20e6c961463c3fa6973d2b23d195e
diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/files/tetrinetx
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/files/tetrinetx   Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# PROVIDE: tetrinetx
+# REQUIRE: DAEMON LOGIN network
+
+. /etc/rc.subr
+
+name="tetrinetx"
+rcvar=$name
+command="/usr/pkg/bin/tetrix"
+pidfile="/var/run/${name}.pid"
+required_files="/usr/pkg/share/tetrinetx/game.conf"
+
+load_rc_config $name
+run_rc_command "$1"
diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/patches/patch-aa  Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,32 @@
+$NetBSD: patch-aa,v 1.1.1.1 2006/02/14 17:03:54 rillig Exp $
+--- src/config.h.orig  2001-04-24 04:31:29.000000000 +0200
++++ src/config.h       2004-01-23 02:55:51.745142400 +0100
+@@ -7,16 +7,16 @@
+ */
+ 
+ /* Location of the various external files */
+-#define FILE_MOTD    "game.motd"      /* Message of the Day File */
+-#define FILE_PMOTD    "game.pmotd"    /* Playback motd */
+-#define FILE_CONF    "game.conf"      /* Game configuration File */
+-#define FILE_WINLIST "game.winlist"   /* Winlist storage file */
+-#define FILE_WINLIST2 "game.winlist2" /* Winlist storage file */
+-#define FILE_WINLIST3 "game.winlist3" /* Winlist storage file */
++#define FILE_MOTD     SHAREDIR "/game.motd"   /* Message of the Day File */
++#define FILE_PMOTD    SHAREDIR "/game.pmotd"  /* Playback motd */
++#define FILE_CONF     SHAREDIR "/game.conf"   /* Game configuration File */
++#define FILE_WINLIST  SHAREDIR "/game.winlist"        /* Winlist storage file */
++#define FILE_WINLIST2 SHAREDIR "/game.winlist2"       /* Winlist storage file */
++#define FILE_WINLIST3 SHAREDIR "/game.winlist3"       /* Winlist storage file */
+ 
+-#define FILE_BAN     "game.ban"               /* List of Banned IP's */
+-#define FILE_BAN_COMPROMISE     "game.ban.compromise" /* List of Banned IP's */
+-#define FILE_ALLOW   "game.allow"     /* List of allow IP's */
+-#define FILE_LOG     "game.log"               /* Logfile */
+-#define FILE_PID     "game.pid"               /* Default PID */
+-#define FILE_SECURE  "game.secure"    /* Security file */
++#define FILE_BAN     SHAREDIR "/game.ban"             /* List of Banned IP's */
++#define FILE_BAN_COMPROMISE     SHAREDIR "/game.ban.compromise"       /* List of Banned IP's */
++#define FILE_ALLOW   SHAREDIR "/game.allow"   /* List of allow IP's */
++#define FILE_LOG     SHAREDIR "/game.log"             /* Logfile */
++#define FILE_PID     PREFIX "/tetrinetx.pid"                  /* Default PID */
++#define FILE_SECURE  SHAREDIR "/game.secure"  /* Security file */
diff -r 0f48683a1658 -r 0f2e074b17e2 games/tetrinetx/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/tetrinetx/patches/patch-ab  Tue Feb 14 17:03:54 2006 +0000
@@ -0,0 +1,37 @@
+$NetBSD: patch-ab,v 1.1.1.1 2006/02/14 17:03:54 rillig Exp $
+
+--- src/main.c.orig    Tue Jul  9 05:53:49 2002
++++ src/main.c Sun Jan 26 18:12:54 2003
+@@ -109,12 +109,12 @@
+ }
+                       
+ 
+-/* writepid() - Writes the current pid to game.pidfile */
++/* writepid() - Writes the current pid to FILE_PID */
+ void writepid(void)
+   {
+     FILE *file_out;
+     
+-    file_out = fopen(game.pidfile,"w");
++    file_out = fopen(FILE_PID,"w");
+     if (file_out == NULL)
+       {
+         // lvprintf(0,"ERROR: Could not write to PID file %s\n", game.pidfile);
+@@ -129,7 +129,7 @@
+ /* delpid() - Delete the pid file */
+ void delpid(void)
+   {
+-    remove(game.pidfile);
++    remove(FILE_PID);
+   }
+ 
+ /* int numallplayers(chan) - Returns ANY player that is connected in a channel */
+@@ -4695,7 +4695,7 @@
+   {
+     struct sigaction sv;
+     
+-    lvprintf(0,"\nTetriNET for Linux V%s.%s\n---------------------------------\n", TETVERSION, SERVERBUILD);
++    lvprintf(0,"\nTetriNET for NetBSD V%s.%s\n---------------------------------\n", TETVERSION, SERVERBUILD);
+     
+ 
+     gnet=NULL;



Home | Main Index | Thread Index | Old Index