[Commit]
rrserver dispatch.5c,1.26,1.27 games.5c,1.24,1.25 main.5c,1.3,1.4
protocol,1.29,1.30
Keith Packard
commit at keithp.com
Thu Jun 26 03:07:15 PDT 2003
- Previous message: [Commit] nickle/builtin file.c,1.11,1.12
- Next message: [Commit]
rrserver clients.5c,1.4,1.5 dispatch.5c,1.27,1.28 main.5c,1.4,1.5
net.5c,1.2,1.3 server.5c,1.14,1.15
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: keithp
Update of /local/src/CVS/rrserver
In directory home.keithp.com:/tmp/cvs-serv4846
Modified Files:
dispatch.5c games.5c main.5c protocol
Log Message:
Send board on new game. Add --logfile option
Index: dispatch.5c
===================================================================
RCS file: /local/src/CVS/rrserver/dispatch.5c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- dispatch.5c 14 Jun 2003 09:17:07 -0000 1.26
+++ dispatch.5c 26 Jun 2003 09:07:12 -0000 1.27
@@ -360,7 +360,7 @@
"|R.. ... .gs\n"+
"\n"+
" byc|... .RT|\n"+
- " === ===\"\n"+
+ " === === \"\n"+
"\n"+
"R.. = Red robot (goal robot)\n"+
".gs = Green square target\n"+
Index: games.5c
===================================================================
RCS file: /local/src/CVS/rrserver/games.5c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- games.5c 14 Jun 2003 07:21:54 -0000 1.24
+++ games.5c 26 Jun 2003 09:07:12 -0000 1.25
@@ -155,6 +155,16 @@
Track::report (report_position, &loc);
}
+ void game_send_board (&Game g, string fmt, poly args...) {
+ void board_client (&Client c) {
+ Clients::client_send (&c, fmt, args);
+ File::fprintf (c.f, " \"\n");
+ Show::show (c.f, &g.board);
+ File::fprintf (c.f, "\"\n");
+ }
+ iterate_client (&g, board_client, true, true);
+ }
+
/* does the given game exist? */
bool exists (string name) {
exception found (&Game g);
@@ -385,6 +395,7 @@
g.active = ClientRef.none;
g.timer_serial = 0;
g.done_robots = (ObjectLoc[0]) {};
+ game_send_board (&g, "NOTICE BOARD");
next_target (&g);
}
Index: main.5c
===================================================================
RCS file: /local/src/CVS/rrserver/main.5c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- main.5c 30 May 2003 06:47:05 -0000 1.3
+++ main.5c 26 Jun 2003 09:07:12 -0000 1.4
@@ -30,8 +30,14 @@
public namespace Main {
public void main () {
PRNG::dev_srandom (32);
+ for (int i = 0; i < dim (argv); i++)
+ switch (argv[i]) {
+ case "--logfile":
+ File::reopen (argv[i+1], "a", stdout);
+ break;
+ }
file f = Net::create (RR::Port);
- File::fprintf (stderr, "RR server started on port %d.\n", RR::Port);
+ printf ("RR server started on port %d.\n", RR::Port);
Net::listen (Dispatch::client, f);
}
}
Index: protocol
===================================================================
RCS file: /local/src/CVS/rrserver/protocol,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- protocol 14 Jun 2003 17:33:29 -0000 1.29
+++ protocol 26 Jun 2003 09:07:12 -0000 1.30
@@ -551,7 +551,7 @@
NOTICE ACTIVATE <bid>
Sent to the player which has just become active
-
+
3. Errors
The following error codes may be returned.
- Previous message: [Commit] nickle/builtin file.c,1.11,1.12
- Next message: [Commit]
rrserver clients.5c,1.4,1.5 dispatch.5c,1.27,1.28 main.5c,1.4,1.5
net.5c,1.2,1.3 server.5c,1.14,1.15
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commit
mailing list