Commit graph

48 commits

Author SHA1 Message Date
Eric House
552ab8fa48 fix assertion (leaving the confusion in the code about tracking the
open relay socket)
2014-11-11 07:36:55 -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
8d20c33b76 snapshot: still not correctly recording return address 2013-12-16 08:06:29 -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
c75ecef240 test deletion of games and generation of anonymous relayIDs 2013-01-29 07:42:10 -08:00
Eric House
4b335ab464 make function static 2013-01-26 18:36:40 -08:00
Eric House
9f3250cb3f make curses version use udp socket when --db param passed. There's no
UI for the DB and the assumption is only one game will be stored but
this should let the test script be modified to test the new protocol.
2013-01-24 07:49:49 -08:00
Eric House
12f70154a0 changes for includes-messageID-please-ack protocol addition 2013-01-23 07:43:58 -08:00
Eric House
fac3e6b678 fix gtk version to correctly implement util_setIsServer (which only
Android did so far) by calling server_initClientConnection().  Now
relay games work with both started as hosts.  (GTK UI prevents
starting one as a guest; cmdline is required for that, if it still
works.)
2013-01-08 07:28:30 -08:00
Eric House
76f3bb3413 fix curses version so discon_ok2 tests work again. 2013-01-07 20:40:46 -08:00
Eric House
f88387da80 lots of changes to separate game data from app data so several games
can be open at once.  (curses version is almost certainly broken)
2013-01-07 06:10:44 -08:00
Eric House
e0dc83ed70 rest of what I just meant to commit. 2013-01-05 16:08:47 -08:00
Eric House
4af30c534c snapshot. New game button works and game gets saved in DB. Next: display and open from DB. 2013-01-05 16:08:19 -08:00
Eric House
093fc4d1fa cleanup 2012-11-13 07:23:07 -08:00
Eric House
c69dbda36f add new game_changeDict() and enough gtk code to test it. 2012-10-23 19:06:00 -07:00
Eric House
e90c5ee94f pass index of resigning player into util_notifyGameOver. Not yet
passed into java.
2012-10-09 05:31:12 -07:00
Eric House
140c982d41 merge from android_branch 2012-09-24 07:39:44 -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
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
0934f83106 add gameID to params passed to comms' sendproc, including passing
through to java layer.
2012-01-25 18:27:37 -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
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
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
82382a7cfa Pass results back via timers and call board_draw() when so indicates.
Needed to test dragDropSetAdd.  Candidate for merge to trunk.
2010-01-25 00:28:30 +00:00
ehouse
aa48b4c3ed plug memory leak by closing relay socket when quitting 2009-02-28 19:19:42 +00:00
ehouse
f021964213 fix ncurses version so it can save games and read them back in: make existing gtk code run on both. 2008-09-18 03:46:27 +00:00
ehouse
ad52e63ff0 separate UI-specific code so that a non-UI linux library can be compiled, e.g. for use with a toolkit not gtk or ncurses 2008-06-30 03:39:27 +00:00
ehouse
c6da605b56 add missing error message 2008-05-24 16:08:13 +00:00
ehouse
6e9e5b5c99 Fix to compile and run standalone 2008-01-19 16:03:53 +00:00
ehouse
4c8cf98d24 Add and set a compile-time option so comms will set a periodic timer
and use it to send and check for heartbeats over any transport.
Caller must supply a reset proc which is called when heartbeat hasn't
been received in too long.  No changes required to comms protocol, but
that means the heartbeat interval is fixed at compile time: can't be
negotiated, and the two ends had better agree.  Currently tested with
linux host and PalmOS guest, where only the first heartbeat failure is
recovered from.  So there's some debugging to be done still.
2007-11-18 23:43:27 +00:00
ehouse
098a2ec5c4 Use new keydown/up APIs from linux, and add key support and drawing
changes to implement keyboard navigation/focus in gtk port.
2007-01-06 17:46:02 +00:00
ehouse
5f25ba9f57 remove BEYOND_IR, replacing with XWFEATURE_RELAY and
XWFEATURE_BLUETOOTH.  The goal is to be able to build to support
bluetooth only, or relay/ip only, e.g. for a palm bluetooth beta.
Seems to work.
2006-10-10 01:34:37 +00:00
ehouse
fb87fd31d2 Start adding bt support to linux port. Required removing assumptions
that all connectivity was with relay and over streaming sockets (since
BT is using l2cap's datagram-style sockets.)  With this checkin, a full
robot-vs-robot game is possible with palm as host and linux as client.
Linux as host isn't started yet.
2006-08-26 21:15:20 +00:00
ehouse
4daabf6fe5 Set -Wunused-parameter for those versions of gcc that support it, and
deal with the output by removing params where possible and elsewhere
by adding XP_UNUSED macro wrapping __attribute__((unused)).  There
should be NO change in function in spite of the large number of files.
2006-08-16 13:44:44 +00:00
ehouse
19414ae505 Finish scrollbar work by passing number of visible rows to
util_trayHiddenChange, which means an API change.  In board, calculate
bottom of board based on bottom of tray when tray is hidden, and round
so that it's an exact multiple of cell height.  In wince, take
advantage of the new parameter to fix the scrollbar so that very
constrained boards can be scrolled even when the tray is hidden.
2006-05-19 13:44:05 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
d29937a734 add a const 2005-10-30 05:06:41 +00:00
ehouse
237deee542 just log some messages so user interaction not required. 2005-09-14 05:11:29 +00:00
ehouse
18fc5e2c14 add linuxFireTimer 2005-09-09 03:12:58 +00:00
ehouse
e3cadfbf79 catch up with API changes 2005-09-02 06:24:47 +00:00
ehouse
1c7e530538 deal with tcp streams the same in curses as on gtk. Both work now
with the relay.
2005-03-12 05:33:30 +00:00
ehouse
897caf4e88 Replace UDP-based messaging with TCP. Stream protocol says distinct
message is length plus data.  Use non-deprecated gtk select-like
function.  With these changes can play full games through the relay on
gtk.  Untested on ncurses but probably broken.
2005-03-06 18:07:00 +00:00
ehouse
5776da0b93 first checkin 2003-11-01 05:35:29 +00:00