Commit graph

69 commits

Author SHA1 Message Date
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
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
bc6922cb8b add option to split tcp packets to test whether relay can handle reassembly. 2013-06-24 06:33:06 -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
59937b8514 modify how devids are handled on the relay and the protocol through
which they're communicated to the device.  Device is expected to have
a platform-specific notion of ID which the relay stores in a new
devices table and indexes with a 32-bit number which is returned to
the device -- which is encouraged but not required to use it in lieu
of the longer ID in future communications.  Modify linux client and
test script to use the relay-supplied id.  Some of this is commented
out for now.
2012-11-03 10:58:01 -07:00
Eric House
3469975d2a add, still disabled by compile-time flags, code to transmit device ID
(e.g. ID Android devices get via GCM) to relay and to associate it
there with messages that need to be delivered.
2012-10-30 07:01:47 -07:00
Eric House
e64ecfb78d implement resign on top of existing endGame logic, adding "quitter" as
new param passed to remote and changing final score formatting and
menu items to match.  Still need to show old menu on android in case
where game has already ended.
2012-10-07 12:47:06 -07:00
Eric House
140c982d41 merge from android_branch 2012-09-24 07:39:44 -07:00
Eric House
761f93dd7e use new mem_stream_make_sized 2012-09-11 19:07:00 -07:00
Eric House
75474e1891 Add option to pretend save failed a random pct of time. Point it to
test fix for problem on Android, but right now turning this on breaks
networking.
2012-09-11 07:26:17 -07:00
Eric House
0ccc2331b5 address bug where message was getting ACK'd by a device that failed to
save what it had ACK'd leaving the game permanently broken.  Do that
by adding a new method game_saveSucceeded() called after the client
claims to have committed bytes returned by game_writeToStream() to
disk.  In that method comms updates the value it'll use in subseqent
ACKs.
2012-09-10 07:31:45 -07:00
Eric House
270a19f3aa Revert "first of a set of changes to communicate to clients dictionary being"
This reverts commit b7a0f1489b, which I didn't mean to check in on this branch.
2012-09-03 21:34:51 -07:00
Eric House
ea4d805d5f first of a set of changes to communicate to clients dictionary being
used by server.  Clients need to care if e.g. the server's disallowing
phonies based on its dict.  Can only be sent if client is of latest
version.  In that case, common code calls into new util function.  In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it.  Once it's available, will want to install it.
2012-09-03 21:33:46 -07:00
Eric House
b7a0f1489b first of a set of changes to communicate to clients dictionary being
used by server.  Clients need to care if e.g. the server's disallowing
phonies based on its dict.  Can only be sent if client is of latest
version.  In that case, common code calls into new util function.  In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it.  Once it's available, will want to install it.
2012-09-03 21:29:21 -07:00
Eric House
a86ab69aec don't store argv element in game data structure where it gets freed. 2012-08-22 07:35:18 -07:00
Eric House
d25916ae5f protect sqlite code with compile-time flag so easier to disable. 2012-07-29 08:37:08 -07:00
Eric House
08e5fbdcc2 add ability to open game in sqlite3 DB from an Android phone. It's
read-only now: changes are not saved.  But it works!
2012-07-26 20:44:33 -07:00
Eric House
cd89885cd2 add new periodic (one-second) timer, and commandline option that sets
what percent of the times that timer fires will result in a move being
undone.  Will be used to interject random out-of-order undos into
games played for testing.  (Currently the tests fail when this is
enabled; I need to fix that.)
2012-05-23 19:58:03 -07:00
Eric House
09f9038cff add option to have robot choose to trade tiles a configurable percent
of the time.  Meant to increase automated test coverage of trades.
2012-05-02 20:14:42 -07:00
Andy2
17edc79aaf Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/android/XWords4/src/org/eehouse/android/xw4/XWApp.java
2011-12-06 19:56:10 -08:00
Andy2
b0470d5276 add new preference that when set prevents calculation and drawing of
crosshairs.
2011-12-06 18:17:55 -08:00
Eric House
9115b344fb use a hash of lists rather than a single list to store pending
background messages to fix assertion failure when more than two
devices are playing: messages must be sent grouped by relayID.
2011-11-21 17:57:38 -08:00
Eric House
8a51d5f3e4 fix race condition that was breaking tests: when one device sends two
messages they must be handled by the relay in order.  So modify linux
client to build a single packet of all messages sent instead of
letting rq sent each on a separate socket.  The relay would give the
sockets to different threads and sometimes the wrong one won.  Will
need to make sure the android code's doing the same thing (it appears
to be), or perhaps make the coalescing code common so I only debug it
once.
2011-11-17 19:56:36 -08:00
Andy2
c992c65015 changes to support automated testing of background messages sends: new
param gives name of Unix domain socket to be used to accept connection
that passes in messages from relay and receives messages to be sent
back.  Works once but needs debugging....
2011-09-30 06:32:21 -07:00
Andy2
7e0252713c changes to use glib main loop were incomplete, didn't include timers.
Fix that.  Now discon_ok2.sh test works with the USE_GLIBLOOP turned
on.
2011-09-19 18:28:19 -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
Eric House
4093e1c947 add option to switch between mmap and malloc for dict runtime access. 2011-07-18 18:07:15 -07:00
Andy2
c87df3ce16 add option to drop incoming packets randomly (rather than 1st, then
2nd, then 3rd etc.)
2011-06-20 18:55:57 -07:00
Andy2
2d7a1f13b8 add drop-nth-packet option 2011-06-15 06:47:08 -07:00
Eric House
26eadb3b99 add commandline option to set bonus square pattern via an external
file.  (Effects only Linux versions.)
2011-04-10 13:04:05 -07:00
Andy2
3b7b4802a9 add ability to specify, track and use separate dictionaries for each
player.  Works for gtk client.  Compiles for Android but there's no UI
yet to specify more than one dict.  Management of dupicate dicts
without duplicating memory -- refcounting -- will be up to the
platforms.
2011-04-01 19:57:10 -07:00
Eric House
4bf613a006 move pipe handling code to where can be shared by curses and gtk -- but use from curses is untested. 2011-01-24 22:20:47 -08:00
Andy2
825cda9125 new feature for testing proxy: --with-pipe option causes linux client
to, instead of putting up UI, blocking on pipe and once it's readable
opening saved game and passing messages into it from pipe then saving
it when done.  Works, but requires gtk so far.
2011-01-23 21:52:26 -08:00
Eric House
9fc39a55ed add params to set public-room-related booleans; add timeout option on
modal dialogs so gtk version can run unattended.
2010-09-14 21:13:45 -07:00
Andy2
6dc21ae7a8 pass (hard-coded) param controlling non-turn board switching 2010-07-17 06:22:42 -07:00
Andy2
80aa22b2d1 add common prefs field sortNewTiles and way to set on linux cmdline 2010-06-17 18:10:32 -07:00
eehouse
603462fc33 add option to skip modal dialog showing final game score (may prevent
curses version from becoming nonresponsive when used from playme.sh);
add menu command to curses version to resend messages.
2010-03-28 16:08:54 +00:00
ehouse
4425eaa99e move showColors into CommonPrefs, removing separate storage in linux
and wince and removing setter from board and jni APIs.  Palm change
pending.
2010-01-26 04:14:18 +00:00
ehouse
066c3de9a7 add to gtk version a quick -F option to use new skip-confirm feature 2009-11-08 17:25:19 +00:00
ehouse
547c1758a9 For testing, add option to send duplicates of all packets 2009-09-26 13:47:51 +00:00
ehouse
1da25307e5 Display relay state on board, horizontal scoreboard mode only for now. 2009-09-20 18:45:25 +00:00
ehouse
18e9301e87 rename Cookie to Invite, a change that may change. Rename everywhere
in clients but not in relay where cookie is too pervasive.  (There are
no code changes in this checkin.)
2009-09-14 03:11:11 +00:00
ehouse
4c523b628c Make slow-robot work for curses client too. 2009-07-10 05:04:04 +00:00
ehouse
184a154c52 New feature, meant for testing relay, makes robot skip random number
of seconds within specified range before making a move.  Working only
on gtk so far, and will probably never be used other than on linux
clients.
2009-07-09 12:43:51 +00:00
ehouse
3f01c9129e Lots of changes to make gtk version better test with relay: make
possible to start without specifying comms params, to switch roles
and/or number of players when starting new game; clean up dialogs,
esp. use notebook widget to have tab switch between comms types.
2009-02-28 18:52:44 +00:00
ehouse
cefd69d8b3 Since there's now a flag indicating whether to show the value of a
tile, make value unsigned.  Adjust/fix platforms.  Add cmdline flag to
linux apps for hiding values.
2008-12-29 03:09:35 +00:00
ehouse
1755267d55 Add support to gtk app for tranport over "sms", with files containing
base64-encoded data as the messages.  Make necessary changes to comms.
This is the foundation for doing real SMS transport on handhelds.
Currently a full robot game works for two gtk clients provided the
server is launched first.
2008-12-29 01:35:29 +00:00
ehouse
e30c72c829 make -q option take number of seconds to pause before quitting 2008-10-26 15:33:21 +00:00
ehouse
ff254fcef4 add ability to scroll the board by dragging it. add new method
util_altKeyDown to allow user to choose between scrolling board and
dragging the hint rect when both are possible.  add adjustYOffset;
make it and board_setYOffset more tolerant of out-of-bounds inputs and
use that to simplify calling code.
2008-04-08 03:55:53 +00:00