Commit graph

151 commits

Author SHA1 Message Date
Andy2
7ab8c6eca4 re-factor sending code so essentially same message (without cookieID
that implies a connection) is sent and received by no-conn code.  Use
flags to determine if comms can support no-conn sending without making
up the message only to have it fail to send.
2011-08-16 19:36:23 -07:00
Andy2
e88af19e0a toward the ability to send replies to messages received in background
without user having to open the game, which will e.g. allow a host to
assign tiles, or a robot to move, without the phone's owner noticing
there's a message.  This is on a branch because it may never work.
2011-08-10 18:28:34 -07:00
Eric House
cbfdf992bd add compile-time option to allow passing game seed from commandline.
This should allow testing relay changes to deal better with duplicate
seeds.
2011-07-31 22:23:46 -07:00
Andy2
f3ab40519d add new error message to DEBUG-only printing code. 2011-07-06 06:47:56 -07:00
Andy2
0eec455119 change one return type; improve logging 2011-07-04 12:46:48 -07:00
Andy2
a96dfb57f6 drop-packet test got an assert because we assumed the effects of a
dropped packet.  Instead, now treat the connection as broken and
restart.
2011-06-27 18:30:52 -07:00
Andy2
e886a1aefe lots more changes -- another snapshot, this, rather than stuff
carefully polished and reviewed.  Shows progress, though, in getting
through tests.
2011-06-23 07:12:50 -07:00
Andy2
4c5c435fb5 add new parameter so client always gets notified on connection
including how many players are still missing.
2011-05-19 05:51:00 -07:00
Andy2
4b8e462b8b check for null ptrs to allow creating loading games that won't draw or
communicate with users.
2011-01-23 21:45:41 -08:00
Andy2
4a12f7a96f Revert "in attempt to work around non-random rand() in jni world, call back"
This reverts commit 99c92e779d.

Conflicts:

	xwords4/android/XWords4/jni/utilwrapper.c
2010-12-07 18:43:53 -08:00
Andy2
99c92e779d in attempt to work around non-random rand() in jni world, call back
into the java world by making it a util_ctxt function.  Do same on
linux to test.  We'll see how it is -- and can back this commit out if
there's no improvement.
2010-12-02 19:02:36 -08:00
Eric House
7a2d279308 add logging so script can better track what state relay game is in 2010-11-18 22:27:06 -08:00
Andy2
b0a4790ce0 respond to new game-gone message by passing to utils. 2010-11-11 06:41:24 -08:00
Andy2
22f7a42c1d make comms_getChannelSeed non-static so jni can call it 2010-11-08 17:22:38 -08:00
Andy2
cfd4345287 remove too-frequent logging 2010-11-07 13:31:43 -08:00
Andy2
9e05e6c2b3 add lastMsgRcd to status printout 2010-11-03 18:28:54 -07:00
Andy2
804070efc7 base comms_canChat() on whether connID's been assigned. It's possible
to send a message from a client immediately after its initial message
but init-message dupe-detection in comms will drop that because only
one channel-0 message is expected -- the initial connection message.
So don't encourage platform code to enable the feature before common
code can deliver the message.
2010-11-01 06:57:41 -07:00
Andy2
0d7f2c4f23 add devOrder (= hostID) to params passed on connect. Should make for
better explanatory message.
2010-10-29 06:31:33 -07:00
Andy2
4cd15a9c6a Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy
Conflicts:
	xwords4/common/comms.c
2010-10-29 05:27:07 -07:00
Andy2
41fc05106b add room name to callback used when device connects 2010-10-28 18:45:55 -07:00
Eric House
eba5b77494 add comms_isConnected; public room variables default to false 2010-10-27 20:50:11 -07:00
Andy2
e909e4b343 remove redundant message; advance state to ALLCONNECTED on receipt of
RECONN or CONN that lists the game as full.  This means we get the
all-green icon (or the A in the gtk case) when in a consummated game
rather than only when all devices are actually connected.
2010-10-23 20:29:24 -07:00
Eric House
85d29cf560 if can't send allcond to a device because it's not connected queue the
message to be sent next time it does.  And since the cookieID will
change and should be there already anyway, remove it.  (Should remove
the hostID too for the same reason.)
2010-10-22 19:02:52 -07:00
Andy2
99dbbb443c add comms_canChat, which knows better than java code what state a
connected game is in, and call it to determine whether to show the
chat icon.
2010-10-21 19:14:10 -07:00
Andy2
b9e3ca212b turn off glib-dependant checksuming for non-linux builds 2010-10-18 22:08:04 -07:00
Eric House
3648c22bd4 fix long-standing bug where initial messages were not getting deleted
and multiplying; log md5 sums of messages in debug build.
2010-10-18 20:17:44 -07:00
Eric House
f246178b8f Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy 2010-10-12 19:18:21 -07:00
Eric House
0cf94dda8b fix frequent assertion failure that dates from when no messages passed
outside of ALLCOND state.  With this fix the test script is running
all games to completion if given enough time.
2010-10-12 19:16:46 -07:00
Andy2
e637a64d96 Change param signage to fix compiler warning 2010-10-11 06:20:30 -07:00
Eric House
a89520a377 use __func__ 2010-09-28 18:04:31 -07:00
Eric House
047f41b516 send cookieid as part of [RE]CONNECT_RESPONSE in addition to ALL_COND (where it's now redundant). 2010-09-20 22:06:35 -07:00
Andy2
6d6ad96cde don't clear seed when changing roles from guest to host. 2010-09-20 04:56:19 -07:00
Andy2
821e4d9c39 add ACK to protocol, returned by device after gets connName on initial
connection.  Space is held for device on assumption ack will come
back, then given up if it fails.
2010-09-14 13:54:52 -07:00
Andy2
bd71a15ddc turn off heartbeats on client side 2010-09-11 01:23:13 -07:00
Andy2
2ee9031fdc langcode belongs in connect, not reconnect, message 2010-09-10 01:56:58 -07:00
Andy2
20312144dd tons of changes, still rough, snapshoted here: a gtk device vs device
game works to completion with both signing up as guests (no -s) with
one local and one remote player (identical commandlines.)  Not yet
tested: if any signs up as a host, reconnecting rather than
connecting, etc.  This is just a snapshot.
2010-09-10 01:30:40 -07:00
Andy2
01fe388f85 remove logging accidentally checked in 2010-09-03 06:40:17 -07:00
Andy2
b742c7dbb7 add new booleans to relay address record around public rooms 2010-09-03 06:38:46 -07:00
Andy2
a34ccb424f device now passes list of "relayID"s, consisting of connName plus
device id, to relay, one for each stored game that's communicating via
the relay.  Relay parses out each relayID.  Next relay can use these
to look up whether messages are available and reply with that, and
device can put up a notification.
2010-08-22 12:16:57 -07:00
Andy2
205723e03b add missing event to logging 2010-07-30 17:44:20 -07:00
eehouse
ea6166f8c7 add comms_resetSame that resets relay with existing params. 2010-06-05 03:39:16 +00:00
eehouse
9b955ae770 resendAll on REconnect as well as connect since it doesn't otherwise
seem to get done.
2010-03-28 16:09:34 +00:00
eehouse
55abf1116b get relay port from prefs and pass into jni 2010-03-25 04:50:19 +00:00
eehouse
786541e9ae pass default hostname in from platform code rather than compiling it
into jni; in java pull it from preferences and pass into jni.
2010-03-21 03:12:58 +00:00
ehouse
8450c9da2b New callback called on first connect to relay and on first ALLHERE
message so users can see progress.  Handle new relay message ALLBACK
meaning "ALLHERE but not for the first time".
2009-12-14 04:03:17 +00:00
ehouse
14b060707f Report relay connection denials due to misordering out to platform,
and refuse to connect again until comms has been reset.  This goes
with platform code to put up the new game/conns dialogs on disconnect
errors.
2009-12-04 08:14:03 +00:00
ehouse
7fbd2bed45 Fix to compile when RELAY feature disabled 2009-11-22 18:00:20 +00:00
ehouse
5ab3425377 allow default relay port, like name, to be set at compile time 2009-11-22 16:30:20 +00:00
ehouse
3d6b43f032 fix palm and palm-arm compile problems including using changed APIs. 2009-11-19 02:22:32 +00:00
ehouse
4025c37604 Make "Room 1" the default room name. 2009-11-09 00:03:43 +00:00