Commit graph

262 commits

Author SHA1 Message Date
Eric House
a34f4e4954 don't save unset channelSeed 2015-02-09 07:28:11 -08:00
Eric House
9e403ac6b2 add assert around the new bit that's -- bitten -- me once already 2015-02-09 06:46:34 -08:00
Eric House
5a28f8dedf fix recent message header hack to not break addressing of messages 2015-02-08 18:42:38 -08:00
Eric House
88dd25fb21 fix channel comparison so messages actually get deleted after they're
ack'd.
2015-02-08 13:39:35 -08:00
Eric House
fb011624bb add another assertion meant to find threading problems, and fix assert
firing because flag was set too late and sometimes bypassed.
2015-02-08 10:37:54 -08:00
Eric House
7e634ecc64 hijack a bit from channelNo to indicate whether message sender is
server or guest so that sender can tell when it receives a message
from itself (and reject it.) This fixes a lot of confusion in testing
where both participants in a networked game are on the same device,
but might also work around e.g. relay bugs.
2015-02-08 09:58:34 -08:00
Eric House
c6b42c539c add assert to ensure there are no thread issues: mutex may be required
if the assert winds up getting hit.
2015-02-08 07:51:08 -08:00
Eric House
17307f910b fix problem with misdelivered message forever locking out future
messages: when comms thinks a message is an init but server drops it,
give comms that info so it can remove it and give the next one a
chance.
2015-02-07 13:24:09 -08:00
Eric House
951f5462b3 remove assert. Can't always get forceChannel right on creation, and
it's mean to be advisory.
2015-01-12 07:23:50 -08:00
Eric House
28bfa3c904 make forceChannel part of CurGameInfo rather than comms, since Android
needs to save it there on receipt of an invitation (doesn't create
full game with comms until later.)  Passes discon2 tests and seems to
work on a single Android device. (Haven't tested inviting on Android
yet.)
2014-12-29 07:39:28 -08:00
Eric House
897c4d5786 add param to force a client to connect to host requesting a particular
channel. Works well enough that relay test script works. Not yet
integrated for let alone tested on Android.
2014-12-21 17:40:00 -08:00
Eric House
f0cf77d7d6 fix overwriting of addresses that happened for most (relay-only) games
run by my test script: match records based on channel number only.
This has yet to be tested on multi-addressing Android builds.
2014-12-10 07:54:50 -08:00
Eric House
5935681b82 in getDestID, deal with possibility game was consumated via a
non-relay channel, and allow client to use HOST_ID_SERVER.
2014-12-05 06:19:02 -08:00
Eric House
a6f9f6608a drop relay connect meta-messages (as well as game messages) when relay
send is disabled.
2014-12-02 06:52:48 -08:00
Eric House
53bfe9812d add const 2014-11-24 07:52:03 -08:00
Eric House
a1cdef6ad8 fix log format 2014-11-24 06:30:58 -08:00
Eric House
142861656e don't send when channel address doesn't have the right type yet 2014-11-21 22:53:48 -08:00
Eric House
fbea67e479 don't kill relay when bluetooth turned off: pass comms type into
comms_transportFailed()
2014-11-20 07:12:25 -08:00
Eric House
1d1af9ffb3 fix some asserts: we have BT working now 2014-11-14 07:06:02 -08:00
Eric House
f2ecefd573 copy bt address info too 2014-11-13 07:27:03 -08:00
Eric House
74afdbd8b6 add more asserts 2014-11-12 06:52:58 -08:00
Eric House
0e2bbfc1ad augment addresses even when message received is a duplicate. Now games
using (fake) SMS and relay work whichever of the address modes is
disabled during the game, on either side.  At least for two-device
games.
2014-11-11 07:46:01 -08:00
Eric House
c087824b47 snapshot with a bit of debugging added, mostly to tranfer to another machine 2014-11-07 20:26:02 -08:00
Eric House
8e616095ad add a bit more logging of channelNos 2014-11-06 20:28:51 -08:00
Eric House
70f4541bbe Merge branch 'android_branch' into android_multi2
Conflicts:
	xwords4/common/comms.c
2014-11-06 20:09:20 -08:00
Eric House
a34a859d18 log channelNo more consistently 2014-11-06 18:44:19 -08:00
Eric House
540d3e9622 wire disabling checkboxes into comms. They work -- and show that
multi-addressing needs debugging still.
2014-11-06 06:35:28 -08:00
Eric House
b1de8663d6 fix to compile with DEBUG undefined 2014-11-06 06:32:00 -08:00
Eric House
2426e04a70 fix overwriting of address info so that, AFAICT, both address types
are successfully being used through much of a test game.
2014-11-05 21:57:25 -08:00
Eric House
8aae7ae10a fix crash: don't use comms before initialized 2014-11-05 07:49:17 -08:00
Eric House
17bc0ab47c snapshot of work toward communicating when two addresses are in use.
An invitation works with relay and (fake) SMS on, and the invited
client connects successfully using both (the second to arrive being
correctly identified as a dupe.)  While the game can be played after,
only SMS messages are being received. And opening a saved game
crashes.
2014-11-05 07:41:20 -08:00
Eric House
e1a10508e1 when preprocessing a message, limit search to the address type of the
channel it came in on if known.
2014-11-02 17:24:37 -08:00
Eric House
b624867cb4 add addr_rmType() 2014-10-28 08:03:19 -07:00
Eric House
93f0b626af snapshot: invite sent by NFC connects two devices using relay with BT
ability passed too (though not yet used.)
2014-10-27 07:51:25 -07:00
Eric House
878a16b3bc snapshot: android compiles, and works well enough to exchange moves
via relay!  Lots of changes, mostly around treating connTypes as a Set
inside the java world.  Jni to translate to that is a pain.
2014-10-16 06:45:24 -07:00
Eric House
fe4c7b52f2 snapshot: relay test script works with a second address type set
(though with its actual transport stubbed out).  Android doesn't even
compile.
2014-10-15 07:26:18 -07:00
Eric House
93526d38d7 cleanup (version upgrade test works) 2014-09-25 22:24:09 -07:00
Eric House
43bd3c018a make an addr's conType a bitfield rather than holding a single value.
Works for large numbers of relay games in test, but will not yet
actually hold more than one value.  Should be safe to merge to main
branch once stream upgrade is verified.
2014-09-25 20:05:37 -07:00
Eric House
4d2f49d33f when sending and don't have an address for channel yet, send the one
comms was created with, which is what client will have to do anyway.
2014-09-14 13:41:12 -07:00
Eric House
23b72467bb don't assert unset cookieID, as that's normal (I think) for unconnected case 2014-03-08 12:47:58 -08:00
Eric House
c1e22dd3cf add summary DB column and jni code to fetch it to store and display number of unacked messages a game has. And add debug-only option to display it in the main list. In the future I want to be able to iterate over all these games and resend their packets (without opening them visually) when an internet connection comes back up. 2014-02-28 18:59:12 -08:00
Eric House
025bcb885b don't move state forward when should be moving back 2014-02-09 19:35:17 -08:00
Eric House
0b132661ca change struct name from r to rr for easier searching; no code change 2014-02-07 21:12:45 -08:00
Eric House
e34cc9007d fix problems with opening and using wordlists on 64-bit linux by
making XP_U32 32 rather than 64 bits. Duh. Do same on Android jni just
in case.
2014-01-07 06:58:20 -08:00
Eric House
de41802f54 rename variable so I don't trip up again 2013-12-17 21:08:27 -08:00
Eric House
4420049bd0 remove duplicate lines (added by merge?) 2013-12-16 08:05:35 -08:00
Eric House
1f877c7567 remove logging 2013-07-29 07:29:01 -07:00
Eric House
a191c6fc2a don't add chats to queue at len 64 rather than 128 2013-07-22 06:12:06 -07:00
Eric House
27d9f3de45 Don't enable chat when more than 128 messages are in queue to prevent
an extremely unlikely cause of stalls -- and make tests trip over full
queues less often.
2013-07-18 07:37:45 -07:00
Eric House
62dacb83d8 fix to compile when DEBUG not defined 2013-07-16 08:17:46 -07:00