Commit graph

202 commits

Author SHA1 Message Date
Eric House
ca6edcfc9a make trade and move confirm non-blocking
Probably breaks curses build, but for gtk and Android
turn move and trade confirmation into a two-step process, making
board_commitTurn() non-interactive when called with a second
parameter. The old blocking util methods now return void and it's up to
the client code to interact (on the main thread) then re-call
board_commitTurn() if appropriate.
2017-02-17 08:58:20 -08:00
Eric House
1f2f4506c4 remove unused query option. Less to convert. 2017-02-17 06:30:54 -08:00
Eric House
2a0b21e5e8 make password fetching non-blocking
First attempt to stop blocking the jni thread: instead of returning a
password from a util_ method, have it include enough state that the UI
can return, put up a dialog, and then pass that state and the password
back and have them matched up again. I think this will work for the
remaining blocking Alerts too.
2017-02-17 06:23:44 -08:00
Eric House
5742c5cb12 gtk: save game on every turn change
Idea is to have the games list stay in sync, but in fact it stays one
move behind, at least in a typical standalone human-vs-robot game. So
this is incomplete.
2016-09-19 09:12:23 -07:00
Eric House
7994c42691 allow board cells to be wider than tall
There are some screen dimensions, especially with dual-pane mode, where
the board is just bit narrower than the screen. Rather than have narrow
white borders, allow the cells to take up the slack. The API takes an
upper bound on the ratio of width to height so things shouldn't get too
odd looking.
2016-09-15 20:37:29 -07:00
Eric House
406eb77f54 post notification (rather than just play sound) when turn comes into
boarddelegate but it's not visible
2016-04-14 22:16:18 -07:00
Eric House
19713a40ad add param to comms_resendAll to limit type of message sent
(e.g. BT). Meant to be used when a single type has become available.
2016-02-02 07:01:48 -08:00
Eric House
87517edd6f fix counting of messages sent by "Resend messages" menuitem: actually
count them, and do so based on new msgNo passed from comms that's
concatenation of channelNo and msgID so that duplicates (over multiple
transports) aren't counted twice.
2015-09-30 06:50:04 -07:00
Eric House
6d7123c27a fix curses app for standalone games (at least to not crash) 2015-08-19 06:05:18 -07:00
Eric House
8f7267b3ec add index of sending player to chat transmission, and on receiving
side translate that into showing the sender's name in
notification. Not yet done: replacing silly "not me" in chat listing
with same, but now it should be easy.
2015-08-12 07:36:36 -07:00
Eric House
ad6be1bb7e add debug-only "tag" to open games so logging can more easily track
what's going on when multiple participants in a single game are on the
same device. But for a couple of strings passed into the jni the
changes are only in DEBUG code.
2015-02-09 19:15:43 -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
d81f022c78 Merge branch 'android_branch' into android_multi2
Conflicts:
	xwords4/linux/scripts/discon_ok2.sh
2014-12-15 16:48:10 -08:00
Eric House
30d2c84dcc so tests can continue, comment out an assertion that indicates a relay
bug that neverless doesn't prevent games from running to completion.
2014-12-15 16:43:24 -08:00
Eric House
9ff7cd1ff9 comment out dead code so I stop trying to debug it 2014-12-10 07:47:36 -08:00
Eric House
c704b7ff4f remove dead code 2014-11-10 07:31:33 -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
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
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
6f07098cf3 return succes from server_initClientConnection() 2014-09-14 13:42:11 -07:00
Eric House
4231ed1108 fix refcount leak 2014-03-11 21:59:53 -07:00
Eric House
19c70ccdcb fix mistaken scoreboard size calc 2014-01-06 06:54:56 -08:00
Eric House
3702a9f326 don't constrain screen size 2014-01-06 06:40:59 -08:00
Eric House
b43855a313 fix curses build for 64bit compile and to use common layout (meaning
tray is now under the board unstead of to the right).  Works on 64-bit
system at least for non-networked games.
2014-01-05 13:04:59 -08:00
Eric House
6bdd939531 rename field 2013-12-17 20:02:31 -08:00
Eric House
8d20c33b76 snapshot: still not correctly recording return address 2013-12-16 08:06:29 -08:00
Eric House
2a56a0ba98 snapshot: more linux-sms stuff 2013-12-12 21:08:25 -08:00
Eric House
7cffa27a88 snapshot toward implementing fake-sms as per-device rather than per-game 2013-12-11 07:54:26 -08:00
Eric House
184ac28ebc fix to compile, and in gtk case to work, when COMMON_LAYOUT defined 2013-11-03 12:15:53 -08:00
Eric House
2629c07256 Address problem with devids (e.g. GCM): until now when you got a new
devid you tossed your relayID and reregistered.  Which meant any
existing messages meant for your relayID were orphaned, and any open
games didn't know who they belonged to until you reconnected to them
with your new relayID.  So: modify the UDP protocol (though not on
Android yet) to include both relayID and devid with registration, with
one or the other an empty string if not present or not changed from
earlier.  I can't fix existing clients that are dropping their
relayIDs, but when one does a re-connect without a relayID I can look
it up from the existing game record, then reuse it rather than issue a
new one.  Better than nothing -- and that protocol will be obsolete
soon anyway.
2013-09-14 21:06:14 -07:00
Eric House
71ea59e7fb separate whether app is using udp from whether it stores games in a
sqlite3 db so that it can switch mid-game -- that being something that
needs testing.
2013-08-07 21:09:48 -07:00
Eric House
da54b1e5fb add keepalive timers 2013-08-02 08:01:16 -07:00
Eric House
63ad3a196b debug build asserts that packet is meant for this device, but
non-debug should drop those that aren't.
2013-07-29 07:30:46 -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
1e6ff9b33c include seed in chat messages to make sure they're unique 2013-07-18 07:06:20 -07:00
Eric House
d6fd79be44 log, and be more aggressive about closing, sockets on which errors occur 2013-07-16 06:43:30 -07:00
Eric House
491b288631 assert that the seed's preserved for curses version too (where
clientToken is otherwise ignored since there's only one game per app
instance)
2013-07-11 20:39:10 -07:00
Eric House
5a20cc282c fix so curses app works well enough that discon_ok2.sh script runs
successfully.  GTK mode is untested and certainly broken.
2013-07-09 18:10:41 -07:00
Eric House
f5696334a9 changes to get the merged code to compile but not included by git in the commit 2013-07-09 07:25:23 -07:00
Eric House
d50c808f96 Merge branch 'android_branch' into gtk_multigame
Conflicts:
	xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java
	xwords4/common/comms.c
	xwords4/linux/cursesmain.c
	xwords4/linux/cursesmain.h
	xwords4/linux/gtkmain.c
	xwords4/linux/gtkmain.h
	xwords4/linux/linuxmain.c
	xwords4/linux/main.h
	xwords4/linux/scripts/discon_ok2.sh
	xwords4/relay/xwrelay.cpp

(Note: The curses app crashes on exit with mempool assertions, but that's a problem before the merge.)
2013-07-09 07:18:00 -07:00
Eric House
923d41e0ee fix to compile when DEBUG not set 2013-07-07 13:17:26 -07:00
Eric House
0ac5d6d9e2 don't send more than three unanswered chats per boot -- to avoid
filling up the queues in a way that doesn't reflect real use.
2013-07-02 18:30:23 -07:00
Eric House
dd48cea912 don't log string before it's initialized 2013-07-02 07:26:32 -07:00
Eric House
9fca3792cf don't pile on chat messages when relay isn't even connected: it's an
unfair test that doesn't duplicate what users will likely do.
2013-07-02 05:53:58 -07:00
Eric House
195f873ab0 tweak logging 2013-06-30 07:37:35 -07:00
Eric House
1a73ab26ac tweak logging 2013-06-28 20:33:27 -07:00
Eric House
5612bb000b quick hack to allow testing intermix of chat with normal moves 2013-06-24 18:37:49 -07:00
Eric House
c8f584dad2 don't listen on stdin if it's been closed 2013-06-10 06:15:36 -07:00
Eric House
72a78100b1 fix compile error in non-debug version 2013-05-27 16:18:11 -07:00