wm: glendy

Download patch

ref: 0aa6224ba8a9e82b3d11a517eb29a619e845f32e
parent: 95a5ff12c1ee46e1705e3e455ab2ae6152eaac07
author: mkf <mkf@cloud9p.org>
date: Fri May 24 06:52:10 EDT 2024

srv4: clean up and more details in logs

--- a/srv4.c
+++ b/srv4.c
@@ -175,8 +175,9 @@
 			fprint(sockfd[1], "WON\n");
 		}
 		cleanup(id);
+		return;
 	}
-	dprint("TURN is %d\n", turn);
+	dprint("Game %d, Turn is %d, min = %d\n", id, turn, findmin(findglenda()));
 	fprint(playersock, "TURN\n");
 	fprint(sockfd[!(turn % 2)], "WAIT\n");
 }
@@ -278,7 +279,6 @@
 	/* early return paths */
 	if(*s == '\0' || *s == 'q')
 	{
-		/* should we end the game at this point? XXX important */
 		fprint(sockfd[player], "DIE disconnected\n");
 		fprint(sockfd[!player], "DIE other client have been disconnected\n");
 		
@@ -444,7 +444,7 @@
 				error("srv(): failed to accept connection");
 	
 			fprint(clientfd[conns], "CONN %d\n", conns);
-			dprint("srv(): client %d connected\n", conns);
+			dprint("game %d: srv(): client %d connected\n", gcount, conns);
 	
 			if(conns == 0)
 				fprint(clientfd[conns], "WAIT\n");