This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fixed: remaining problems in the xconq network code


First of all, thanks for all the work you've been putting in.

> 1. Fix the -join/-host command line code.

Short answer: I need feedback from people who want to use -join and
-host: how should it work?  Details follow.

Using -host (as things are now), the game is already underway and the
joiner doesn't know how to cope with that situation.  The enclosed
patch lets -join/-host get a bit farther, but the joiner then gets a
"bad ttype 0".  Obviously, we don't have the code to download all the
state we need (I'm not even sure it exists, at least I didn't see a
routine sitting around to individually send the vSTART/vOK/aSTART/aOK,
much less whatever else is needed).

Furthermore, there would seem to be a similar case to restore of a
networked game.  That is, should the joiner be the Columbians or the
Irish?

Should we just codify the status quo and cause an error if the hosting
xconq has already got beyond the first dialog or two?  (This means
-host as it exists now more or less goes away, although -host -x could
be made to work or -host could imply -x).

Bringing the subject back to being able to set up a server which sets
up games for people, what is the requirement?  How would this server
cause the hosting and joining xconq's to be run (e.g. on which
machines)?

Index: kernel/tp.c
===================================================================
RCS file: /cvs/xconq/xconq/kernel/tp.c,v
retrieving revision 1.51
diff -u -r1.51 tp.c
--- tp.c	2002/03/06 21:03:57	1.51
+++ tp.c	2002/03/06 23:46:28
@@ -247,6 +247,36 @@
     }
     remote_player_specs[rid] = copy_string(name);
     add_remote_locally(rid, name);
+
+    /* Inform our new program what stage we are in. */
+    switch (current_stage) {
+      case initial_stage:
+	break;
+      case game_load_stage:
+	sprintf(spbuf, "s");
+	send_packet(rid, spbuf);
+	break;
+      case variant_setup_stage:
+	sprintf(spbuf, "vSTART");
+	send_packet(rid, spbuf);
+	break;
+      case player_pre_setup_stage:
+	send_randstate(rid);
+	sprintf(spbuf, "vOK");
+	send_packet(rid, spbuf);
+	break;
+      case player_setup_stage:
+	send_randstate(rid);
+	sprintf(spbuf, "aSTART");
+	send_packet(rid, spbuf);
+	break;
+      case game_ready_stage:
+	send_randstate(rid);
+	sprintf(spbuf, "aOK");
+	send_packet(rid, spbuf);
+	break;
+    }
+
     /* Now broadcast info about the new program to everybody. */
     sprintf(spbuf, "p%d %s", rid, name);
     broadcast_packet(spbuf);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]