[pkg-ggz-commits] r340 - trunk/ggz-server/debian trunk/ggz-server/debian/patches upstream

petere at alioth.debian.org petere at alioth.debian.org
Sun Mar 16 08:33:45 UTC 2008


Author: petere
Date: 2008-03-16 08:33:45 +0000 (Sun, 16 Mar 2008)
New Revision: 340

Added:
   upstream/ggz-server_0.0.14.1.orig.tar.gz
Removed:
   trunk/ggz-server/debian/patches/ggzd-statedir.diff
   trunk/ggz-server/debian/patches/ggzd-timetype.diff
   trunk/ggz-server/debian/patches/misc.diff
Modified:
   trunk/ggz-server/debian/changelog
Log:
Imported ggz-server 0.0.14.1


Modified: trunk/ggz-server/debian/changelog
===================================================================
--- trunk/ggz-server/debian/changelog	2008-03-15 12:53:51 UTC (rev 339)
+++ trunk/ggz-server/debian/changelog	2008-03-16 08:33:45 UTC (rev 340)
@@ -1,3 +1,10 @@
+ggz-server (0.0.14.1-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    - Obsoletes ggzd-statedir.diff, ggzd-timetype.diff, misc.diff
+
+ -- Peter Eisentraut <petere at debian.org>  Sun, 16 Mar 2008 09:16:43 +0100
+
 ggz-server (0.0.14-4) unstable; urgency=low
 
   * Changed build dependency libdb4.4-dev to libdb-dev (closes: #464358)

Deleted: trunk/ggz-server/debian/patches/ggzd-statedir.diff
===================================================================
--- trunk/ggz-server/debian/patches/ggzd-statedir.diff	2008-03-15 12:53:51 UTC (rev 339)
+++ trunk/ggz-server/debian/patches/ggzd-statedir.diff	2008-03-16 08:33:45 UTC (rev 340)
@@ -1,68 +0,0 @@
-Index: ggzd/ggzd/ggzduedit.c
-===================================================================
---- ggzd/ggzd/ggzduedit.c	(Revision 9154)
-+++ ggzd/ggzd/ggzduedit.c	(Arbeitskopie)
-@@ -515,7 +515,7 @@
- 
- 	if(!conn.datadir) {
- 		if(!conn.database) {
--			conn.datadir = GGZDDATADIR;
-+			conn.datadir = GGZDSTATEDIR;
- 		}
- 	}
- 
-Index: ggzd/ggzd/Makefile.am
-===================================================================
---- ggzd/ggzd/Makefile.am	(Revision 9154)
-+++ ggzd/ggzd/Makefile.am	(Arbeitskopie)
-@@ -64,6 +64,7 @@
- 	$(HOWL_INCLUDES) \
- 	$(AVAHI_INCLUDES) \
- 	-DGGZDCONFDIR=\"$(ggzdconfdir)\" \
-+	-DGGZDSTATEDIR=\"$(ggzdstatedir)\" \
- 	-DGGZDEXECMODDIR=\"$(ggzdexecmoddir)\"
- 
- ggzd_LDFLAGS = $(LIBGGZ_LDFLAGS)
-@@ -87,6 +88,7 @@
- 	-I$(top_srcdir)/ggzd/database \
- 	-I$(top_srcdir)/ggzdmod \
- 	-DGGZDCONFDIR=\"$(ggzdconfdir)\" \
-+	-DGGZDSTATEDIR=\"$(ggzdstatedir)\" \
- 	$(LIBGGZ_INCLUDES)
- 
- ggzduedit_LDFLAGS = $(LIBGGZ_LDFLAGS)
-Index: ggzd/ggzd/parse_opt.c
-===================================================================
---- ggzd/ggzd/parse_opt.c	(Revision 9154)
-+++ ggzd/ggzd/parse_opt.c	(Arbeitskopie)
-@@ -310,9 +310,9 @@
- 	if(!opt.conf_dir)
- 		opt.conf_dir = ggz_strdup(GGZDCONFDIR);
- 
--	/* If no data_dir, default it to DATADIR */
-+	/* If no data_dir, default it to STATEDIR */
- 	if(!opt.data_dir)
--		opt.data_dir = ggz_strdup(GGZDDATADIR);
-+		opt.data_dir = ggz_strdup(GGZDSTATEDIR);
- 
- 	/* If no main_port, default it to 5688 (or whatever) */
- 	if(!opt.main_port)
-diff -Nur ggzd.orig/ggzd/Makefile.in ggzd/ggzd/Makefile.in
---- ggzd.orig/ggzd/Makefile.in	2007-07-20 21:20:38.000000000 +0200
-+++ ggzd/ggzd/Makefile.in	2007-07-20 21:09:39.000000000 +0200
-@@ -327,6 +327,7 @@
- 	$(HOWL_INCLUDES) \
- 	$(AVAHI_INCLUDES) \
- 	-DGGZDCONFDIR=\"$(ggzdconfdir)\" \
-+	-DGGZDSTATEDIR=\"$(ggzdstatedir)\" \
- 	-DGGZDEXECMODDIR=\"$(ggzdexecmoddir)\"
- 
- ggzd_LDFLAGS = $(LIBGGZ_LDFLAGS)
-@@ -350,6 +351,7 @@
- 	-I$(top_srcdir)/ggzd/database \
- 	-I$(top_srcdir)/ggzdmod \
- 	-DGGZDCONFDIR=\"$(ggzdconfdir)\" \
-+	-DGGZDSTATEDIR=\"$(ggzdstatedir)\" \
- 	$(LIBGGZ_INCLUDES)
- 
- ggzduedit_LDFLAGS = $(LIBGGZ_LDFLAGS)

Deleted: trunk/ggz-server/debian/patches/ggzd-timetype.diff
===================================================================
--- trunk/ggz-server/debian/patches/ggzd-timetype.diff	2008-03-15 12:53:51 UTC (rev 339)
+++ trunk/ggz-server/debian/patches/ggzd-timetype.diff	2008-03-16 08:33:45 UTC (rev 340)
@@ -1,143 +0,0 @@
-Index: ggzd/ggzd/err_func.c
-===================================================================
---- ggzd/ggzd/err_func.c	(.../tags/ggz-0-0-14/ggzd)	(revision 9355)
-+++ ggzd/ggzd/err_func.c	(.../branches/ggz-0-0-14/ggzd)	(revision 9355)
-@@ -68,8 +68,8 @@
- static struct {
- 	pthread_mutex_t mut;
- 	int update_interval;
--	time_t start_time;
--	time_t next_update;
-+	ggztime_t start_time;
-+	ggztime_t next_update;
- 	int anon_users;
- 	int regd_users;
- 	int num_logins;
-@@ -261,8 +261,8 @@
- 	}
- 
- 	pthread_mutex_init(&update_info.mut, NULL);
--	update_info.next_update = time(NULL) + update_info.update_interval;
--	update_info.start_time = time(NULL);
-+	update_info.next_update = get_current_time();
-+	update_info.start_time = get_current_time();
- 	update_info.anon_users = 0;
- 	update_info.regd_users = 0;
- 	update_info.num_logins = 0;
-@@ -324,27 +324,35 @@
- 
- 
- /* Return number of seconds until next update log entry */
--int log_next_update_sec(void)
-+ggztime_t log_next_update_sec(void)
- {
--	int max_select_wait;
-+	ggztime_t max_select_wait;
- 
--	if((max_select_wait = update_info.next_update - time(NULL)) < 1)
--		max_select_wait = 0;
-+	if (update_info.update_interval <= 0) {
-+		return 10000.0;
-+	}
- 
--	return max_select_wait;
-+	max_select_wait = update_info.next_update - get_current_time();
-+
-+	return MAX(max_select_wait, 0.0);
- }
- 
- 
- /* Generate an update log entry */
- void log_generate_update(void)
- {
--	int uptime;
-+	ggztime_t uptime;
- 	int anon, regd, login, logout;
- 	int tables, tables_created, tables_closed;
- 
-+	if (update_info.update_interval <= 0
-+	    || update_info.next_update > get_current_time()) {
-+		return;
-+	}
-+
- 	/* Not in critical section (only our thread uses these) */
--	uptime = time(NULL) - update_info.start_time;
--	update_info.next_update = time(NULL) + update_info.update_interval;
-+	uptime = get_current_time() - update_info.start_time;
-+	update_info.next_update = get_current_time() + update_info.update_interval;
- 
- 	pthread_mutex_lock(&update_info.mut);
- 
-@@ -371,7 +379,7 @@
- 
- #ifdef DEBUG
- 	if(log_info.verbose_updates) {
--		log_msg(GGZ_LOG_UPDATE, "UPDATE Uptime=%d sec", uptime);
-+		log_msg(GGZ_LOG_UPDATE, "UPDATE Uptime=%d sec", (int)uptime);
- 		log_msg(GGZ_LOG_UPDATE, "UPDATE There are %d anonymous users and %d registered users online", anon, regd);
- 		log_msg(GGZ_LOG_UPDATE, "UPDATE Since the last update, %d users have logged in, %d logged out", login, logout);
- 		log_msg(GGZ_LOG_UPDATE, "UPDATE There are %d tables open", tables);
-@@ -380,7 +388,7 @@
- 	} else
- #endif
- 		log_msg(GGZ_LOG_UPDATE, "UPDATE %d %d %d %d %d %d %d %d",
--			uptime, anon, regd, login, logout, tables, tables_created, tables_closed);
-+			(int)uptime, anon, regd, login, logout, tables, tables_created, tables_closed);
- }
- 
- 
-Index: ggzd/ggzd/err_func.h
-===================================================================
---- ggzd/ggzd/err_func.h	(.../tags/ggz-0-0-14/ggzd)	(revision 9355)
-+++ ggzd/ggzd/err_func.h	(.../branches/ggz-0-0-14/ggzd)	(revision 9355)
-@@ -99,10 +99,11 @@
- void logfile_initialize(void);
- 
- /* Log a normal message */
--void log_msg(const unsigned, const char *, ...);
-+void log_msg(const unsigned, const char *, ...)
-+             ggz__attribute((format(printf, 2, 3)));
- 
- /* Update log handlers */
--int log_next_update_sec(void);
-+ggztime_t log_next_update_sec(void);
- void log_generate_update(void);
- void log_login_anon(void);
- void log_login_regd(void);
-Index: ggzd/ggzd/control.c
-===================================================================
---- ggzd/ggzd/control.c	(.../tags/ggz-0-0-14/ggzd)	(revision 9355)
-+++ ggzd/ggzd/control.c	(.../branches/ggz-0-0-14/ggzd)	(revision 9355)
-@@ -559,7 +559,6 @@
- 	struct sockaddr_in addr;
- 	fd_set active_fd_set, read_fd_set;
- 	struct timeval tv, *tvp;
--	int seconds;
- 
- 	logfile_preinitialize();
- 
-@@ -671,17 +670,13 @@
- 		}
- 
- 		read_fd_set = active_fd_set;
--		seconds = log_next_update_sec();
--		if(seconds == 0)
--		{
--			tvp = NULL;
--		}
--		else
--		{
--			tv.tv_sec = seconds;
--			tv.tv_usec = 0;
--			tvp = &tv;
--		}
-+
-+		/* May be 0 seconds if the update interval has passed -
-+		   in this case the select will likely terminate immediately
-+		   and the update will be done. */
-+		tv = ggztime_to_timeval(log_next_update_sec());
-+		tvp = &tv;
-+
- 		status = select((select_max + 1), &read_fd_set, NULL, NULL, tvp);
- 
- 		if (status < 0) {

Deleted: trunk/ggz-server/debian/patches/misc.diff
===================================================================
--- trunk/ggz-server/debian/patches/misc.diff	2008-03-15 12:53:51 UTC (rev 339)
+++ trunk/ggz-server/debian/patches/misc.diff	2008-03-16 08:33:45 UTC (rev 340)
@@ -1,108 +0,0 @@
-Index: ggzd/game_servers/ggzcards/deck.c
-===================================================================
---- ggzd/game_servers/ggzcards/deck.c	(.../tags/ggz-0-0-14/ggzd)	(revision 9355)
-+++ ggzd/game_servers/ggzcards/deck.c	(.../branches/ggz-0-0-14/ggzd)	(revision 9355)
-@@ -155,6 +155,21 @@
- 	return deck->size;
- }
- 
-+/* Returns a random number in the range 0..size-1. */
-+static unsigned int myrand(unsigned int size)
-+{
-+	const unsigned int divisor = RAND_MAX / size;
-+	const unsigned int max = size * divisor - 1;
-+	unsigned int new_rand;
-+
-+	/* Avoid bias. */
-+	do {
-+		new_rand = random();
-+	} while (new_rand > max);
-+
-+	return new_rand / divisor;
-+}
-+
- /* shuffle the deck */
- void shuffle_deck(deck_t * deck)
- {
-@@ -163,12 +178,11 @@
- 
- 	ggz_debug(DBG_MISC, "Shuffling deck.");
- 
--	/* Now we can randomize the deck order */
--	/* Go through the deck, card by card */
-+	/* "Knuth shuffle" */
- 	for (i = 0; i < deck->size; i++) {
- 		/* Pick any position */
--		j = random() % deck->size;
--		
-+		j = i + myrand(deck->size - i);
-+
- 		/* And swap positions */
- 		temp = deck->cards[i];
- 		deck->cards[i] = deck->cards[j];
-Index: ggzd/game_servers/ggzcards/net.c
-===================================================================
---- ggzd/game_servers/ggzcards/net.c	(.../tags/ggz-0-0-14/ggzd)	(revision 9355)
-+++ ggzd/game_servers/ggzcards/net.c	(.../branches/ggz-0-0-14/ggzd)	(revision 9355)
-@@ -536,8 +536,9 @@
- static void net_send_newhand(player_t p)
- {
- 	GGZDataIO *dio = get_player_dio(p);
--	seat_t dlr =
--	    game.dealer >= 0 ? game.players[game.dealer].seat : -1;
-+	seat_t dlr = (game.dealer >= 0
-+		      ? CONVERT_SEAT(game.players[game.dealer].seat, p)
-+		      : -1);
- 
- 	ggz_dio_packet_start(dio);
- 	write_opcode(dio, MSG_NEWHAND);
-Index: ggzd/ggzd/err_func.c
-===================================================================
---- ggzd/ggzd/err_func.c	(.../tags/ggz-0-0-14/ggzd)	(revision 9355)
-+++ ggzd/ggzd/err_func.c	(.../branches/ggz-0-0-14/ggzd)	(revision 9355)
-@@ -309,9 +309,9 @@
- 	char pidname[strlen(fname) + 9];
- 
- 	if(!strcmp("stderr", fname)) {
--			return stderr;
-+		return opt.foreground ? stderr : NULL;
- 	} else if(!strcmp("stdout", fname)) {
--			return stdout;
-+		return opt.foreground ? stdout : NULL;
- 	}
- 
- 	if(log_info.options & GGZ_LOGOPT_THREAD_LOGS) {
-Index: ggzd/ggzd/net.c
-===================================================================
---- ggzd/ggzd/net.c	(.../tags/ggz-0-0-14/ggzd)	(revision 9355)
-+++ ggzd/ggzd/net.c	(.../branches/ggz-0-0-14/ggzd)	(revision 9355)
-@@ -236,7 +236,7 @@
- 	}
- 	
- 	if (strcmp(filename, "stderr") == 0)
--		net->dump_file = STDERR_FILENO;
-+		net->dump_file = opt.foreground ? STDERR_FILENO : -1;
- 	else
- 		net->dump_file = open(filename,
- 				      O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU);
-@@ -1062,7 +1062,7 @@
- 			return GGZ_REQ_OK;
- 		}
- 
--		dbg_msg(GGZ_DBG_CONNECTION, "Network error reading data");
-+		dbg_msg(GGZ_DBG_CONNECTION, "Network error reading data (%d)", errno);
- 		return GGZ_REQ_DISCONNECT;
- 	}
- 
-Index: ggzd/ggzd/ggzduedit.c
-===================================================================
---- ggzd/ggzd/ggzduedit.c	(.../tags/ggz-0-0-14/ggzd)	(revision 9355)
-+++ ggzd/ggzd/ggzduedit.c	(.../branches/ggz-0-0-14/ggzd)	(revision 9355)
-@@ -471,6 +471,7 @@
- 					fgets(password, sizeof(password), stdin);
- 					echomode(1);
- 					printf("\n");
-+					password[strlen(password) - 1] = '\0';
- 					optarg = password;
- 				}
- 				conn.password = optarg;

Added: upstream/ggz-server_0.0.14.1.orig.tar.gz
===================================================================
(Binary files differ)


Property changes on: upstream/ggz-server_0.0.14.1.orig.tar.gz
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the pkg-ggz-commits mailing list