Commit graph

862 commits

Author SHA1 Message Date
Eric House
9f1b0c5121 Specify relative height of scoreboard and tray in board_figureLayout,
and allow those to be 0.
2013-11-04 06:19:33 -08:00
Eric House
f0b554213b assert rect isn't too small to inset 2013-11-04 05:59:18 -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
88b380503e add function, not compiled by default, to return bounding rect of all
non-empty tiles. As a test, add menu that uses it to grey out that
region.
2013-10-27 21:51:30 -07:00
Eric House
fe8bb0932c delete messages whose games have been deleted 2013-10-09 20:41:14 -07:00
Eric House
24509662e8 fix so standalone games don't crash! 2013-10-09 07:36:21 -07:00
Eric House
3b87c9562c formatting 2013-10-01 07:50:00 -07:00
Eric House
4d4f76c8ae assert not registering with RELAY_ID 2013-09-26 08:37:39 -07:00
Eric House
9169659c80 cleanup: let conversion to including devid and change in devid happen at different rates 2013-09-18 08:05:19 -07: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
c115752852 supply in linux client, and look for and store on relay, os version 2013-09-07 16:17:31 -07:00
Eric House
b3342c6e8a for --clean-start option, try not to remove games not created by this script. 2013-08-28 07:29:23 -07:00
Eric House
063b01d3d8 change most len-as-short+bytes strings to vli+bytes; add device model
to what's passed for device registration, and store it in a new column
in devices table.
2013-08-25 21:20:26 -07:00
Eric House
d10e9f6235 use vlis for acks in both directions 2013-08-25 16:59:07 -07:00
Eric House
7e02db78db change function name spelling 2013-08-25 16:14:42 -07:00
Eric House
91235f3be7 begin process of using variable-length-ints in udp protocol. Works
between linux client and relay, but unrelased features of Android
client will be broken until fixed.
2013-08-25 12:34:35 -07:00
Eric House
45998fd2c0 don't assert when packet size short is unexpectedly large. Not sure
why this happens, but it's not a reason to abort a test.
2013-08-21 21:28:47 -07:00
Eric House
2157706dcd add client version and a desc string to devices DB and to reg info sent to relay 2013-08-20 08:09:45 -07:00
Eric House
47203437cc register devices more often; add ctrl command to send text message to
device if possible, otherwise to post it to the db (mostly for testing).
2013-08-17 14:55:19 -07:00
Eric House
8ad549d2bd query on null db fails, doesn't assert 2013-08-16 19:15:28 -07:00
Eric House
42bbc946ae quote variable and echo when switching to udp 2013-08-15 07:20:22 -07:00
Eric House
ae21b6f0d8 use new --use-udp flag and, by default, switch devices from tcp- to
udp-based connections over time at a configurable rate.
2013-08-07 21:12:08 -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
b9450589c8 add new commandline option --use-udp. Not yet used. 2013-08-06 21:10:42 -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
d8a4b5ce29 include udp maxInterval, the number of seconds the relay's configured
to assume an address is still good when it hasn't heard from it, in
reg response reply, send that reply always, and read and log the new
field on clients.  It will eventually be used to implement a
keepalive.
2013-07-29 07:27:30 -07:00
Eric House
6418513a6d don't try to read from socket if == -1 2013-07-22 06:15:35 -07:00
Eric House
3a14b12cc5 exit when number of core files changes, not if it's non-zero 2013-07-20 12:52:32 -07:00
Eric House
49a2d099f0 include packet num in every udp packet. They start over on app
reboot, but add a bit of help with debugging.
2013-07-20 11:57:10 -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
3f59b31d51 Log received udp messages as b64-encoded strings. These match what the
relay's now logging
2013-07-18 07:07:25 -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
93a7c7f817 fix to compile when DEBUG not defined 2013-07-17 06:52:35 -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
e6e7154c82 close socket rather than proceed with what looks like a bad packet/connection 2013-07-16 06:42:21 -07:00
Eric House
27e90c2d2c exit as soon as there's a core file 2013-07-15 07:16:35 -07:00
Eric House
8a4e766b32 make 50% of games communicate via UDP by default 2013-07-11 20:39:40 -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
9db54a5461 make linux version's gameToken combine game's seed with rowid so we
can test that the relay is keeping them straight
2013-07-11 20:01:17 -07:00
Eric House
d6658c5c08 don't show other_disconnected error message 2013-07-10 23:14:48 -07:00
Eric House
7dfd19a7a2 name change 2013-07-10 23:14:24 -07:00
Eric House
a522266ce4 add message checksumming for android too by making it part of util
(compiled out by default)
2013-07-10 08:05:47 -07:00
Eric House
4bde445c48 fix so gtk mode works too by providing storage for CurGameInfo 2013-07-09 18:19:22 -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
48fbf15a69 needed to quote variable 2013-07-09 18:07:03 -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
4b5af7ebdf don't try to read from socket after it's been closed 2013-07-04 12:37:55 -07:00
Eric House
6cd3ebd780 improve logging 2013-07-02 18:31:02 -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
9ceb1615b3 replace tabs with spaces 2013-06-30 17:24:33 -07:00
Eric House
070590b3c2 cleanup 2013-06-30 08:34:09 -07:00
Eric House
b506a91068 add commandline params 2013-06-30 08:33:58 -07:00
Eric House
195f873ab0 tweak logging 2013-06-30 07:37:35 -07:00
Eric House
6fbf2d4a8b use g_compute_checksum_for_data, removing self-written equivalent 2013-06-30 07:36:56 -07:00
Eric House
7efbfab0e5 fix crash in debug version: len of data to be summed needs to be 32 bits! 2013-06-30 06:50:57 -07:00
Eric House
1a73ab26ac tweak logging 2013-06-28 20:33:27 -07:00
Eric House
17eda4e5e1 move md5sum code into separate function that relay can copy 2013-06-28 20:33:12 -07:00
Eric House
6c756533e3 fix double-dispose crash (but there's still a memory leak) 2013-06-28 20:32:19 -07:00
Eric House
5c284fe6b0 test PID is live before killing it 2013-06-28 18:55:19 -07:00
Eric House
292982a4b4 when splitting packet, queue them and send on timer rather than
sleeping the main thread.
2013-06-27 07:00:36 -07:00
Eric House
0bb4f5b0f5 fix occasional memory leak 2013-06-26 00:41:16 -07:00
Eric House
8324b9c770 fix compile error by making HELP another command. 2013-06-26 00:39:58 -07:00
Eric House
7967966982 Merge remote-tracking branch 'origin/android_branch' into local_fix_relay
Conflicts:
	xwords4/linux/linuxmain.c
	xwords4/linux/main.h
2013-06-25 06:18:43 -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
5842654418 fix pattern 2013-06-24 07:30:38 -07:00
Eric House
aca3a96b54 fix pattern so ended games are detected 2013-06-24 07:18:53 -07:00
Eric House
bc6922cb8b add option to split tcp packets to test whether relay can handle reassembly. 2013-06-24 06:33:06 -07:00
Eric House
5e22508ff7 kill existing xwords instances as part of --clean-start 2013-06-21 06:58:20 -07:00
Eric House
6446819466 use nice to give the relay a fighting chance 2013-06-21 05:41:23 -07:00
Eric House
5bec10048b add --clean-start option to speed testing 2013-06-20 06:45:51 -07:00
Eric House
5da4936e43 report unexpected received packet size as an error 2013-06-17 06:42:21 -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
d41c1a4ca8 add new param so pending text can be drawn differently when it's not
the player's turn.
2013-05-30 07:17:13 -07:00
Eric House
72a78100b1 fix compile error in non-debug version 2013-05-27 16:18:11 -07:00
Eric House
ffa983db94 use pipe to quit from signal handler since calling g_main_loop_quit()
doesn't work with more recent glib versions (and has always been a bad idea)
2013-05-24 21:19:20 -07:00
Eric House
4d96b695e6 toward having commandline params show up as defaults in new game dialog 2013-05-10 07:19:32 -07:00
Eric House
79a212c985 don't put up dict change dialog (which blocks) unless names are
different.
2013-05-09 21:37:58 -07:00
Eric House
d74814a806 part of previous (merge) commit that got left out -- files not saved. 2013-05-09 06:33:19 -07:00
Eric House
7d8cddb31f Merge branch 'android_branch' into gtk_multigame
Conflicts:
	xwords4/linux/gtkmain.c
	xwords4/linux/linuxmain.c
	xwords4/relay/xwrelay.cpp
2013-05-08 07:37:55 -07:00
Eric House
3e9bb1c6b9 fix leak: dispose struct before overwriting it 2013-05-08 06:38:52 -07:00
Eric House
66d42fe5f2 fix a couple of leaks 2013-05-07 07:07:10 -07:00
Eric House
5a026ffda3 merge android_wordlists (local branch) 2013-05-01 06:39:31 -07:00
Eric House
541fc546ab remove that bit from flags -- since we already do the right thing for it. 2013-04-20 19:46:35 -07:00
Eric House
e4f52c5678 add assert and comment explaining why non-utf-8-aware hack is safe. 2013-04-18 07:15:14 -07:00
Eric House
2873d08974 fix memory leak 2013-04-13 16:49:20 -07:00
Eric House
195e6bfad3 add option to dump an .xwd file, meant to replace dawg2dict.pl which
is becoming a pain to maintain.
2013-04-09 21:10:40 -07:00
Eric House
5912b76cb8 add option to dump an .xwd file, meant to replace dawg2dict.pl which
is becoming a pain to maintain.
2013-04-09 21:05:35 -07:00
Eric House
07cfdad699 fix to support synonyms within specials too -- for linux only so far.
Seems to work, though the dawg2dict.pl script is broken.
2013-04-09 07:43:04 -07:00
Eric House
3a628f4375 load new-format dict into linux client, display default faces
correctly, and search using alternate as well as default faces.  Next:
support for alternate specials.
2013-04-06 11:43:57 -07:00
Eric House
168ebeeb5b fix variable name misspelling 2013-02-22 21:10:46 -08:00
Eric House
c75ecef240 test deletion of games and generation of anonymous relayIDs 2013-01-29 07:42:10 -08:00
Eric House
72e100ccac use autoincrement primary key, same as on Android 2013-01-28 07:02:33 -08:00
Eric House
4b335ab464 make function static 2013-01-26 18:36:40 -08:00
Eric House
b324a382e2 I've seen read() return 0 after being told there's something on the
socket.  So in that case loop and try again five time -- in case the
docs are wrong that 0 means EOF?  Hmmm.
2013-01-26 11:58:48 -08:00
Eric House
88b20769f9 increase buffer size 2013-01-26 11:56:29 -08:00