Commit graph

75 commits

Author SHA1 Message Date
ehouse
8c6c177c99 flag unusued param to fix compile error; move code used only in
multi-device games inside ifdefs.
2008-10-11 17:30:35 +00:00
ehouse
e60d338488 Remove all tabs. No code changes. 2008-05-31 03:26:16 +00:00
ehouse
f1ec47aa93 force miniwindow entirely onto board even if natural position is on
tray; fix overdrawing onto miniwindow by making timer proc return a
boolean and only redrawing (on wince) when it's true.
2008-04-12 15:36:31 +00:00
ehouse
20ea57cf77 Fix errors, all in debug-only code, flagged by __attribute__ format addition. 2008-03-11 12:24:23 +00:00
ehouse
880fb716c6 Unify lookup by address and by channelNo; add method to check consistency of BT address. 2008-01-07 01:10:43 +00:00
ehouse
d658c29c88 test for duplicate initial client message and if so drop it; add const keyword; add assertion in addr comparion in attempt to learn why duplicates are getting through. 2007-12-31 20:00:13 +00:00
ehouse
63ccaed46e cleanup; replace a bunch of EvtAddEventToQueue calls with
postEmptyEvent; pass transport type with incoming packets so they can
be rejected if not on expected channel (to stop IR, which is always
on, from injecting into a BT game); do BT work and fire timers even
when menu is down; don't let robot run until after board is drawn for
the first time; on startup, don't let robot run until after board is
drawn once.  Up version to b3.
2007-12-09 01:59:15 +00:00
ehouse
244e600afa call util_addrChange prior to closing comms to fix crash moving from
BT to standalone game; add a couple of similar assertions; up beta
version.
2007-12-07 07:50:19 +00:00
ehouse
3a85db7b38 Rewrite of checkIncomingStream to be cleaner and fix bug with initial messages getting dropped
while heartbeat feature was enabled.  Fixed the problem on Linux, but experience on Treo650
is still better without HB feature, so turning it off on Palm.  This seems ready for beta,
but will test a bit more.
2007-12-05 06:33:37 +00:00
ehouse
0d5543b28f Fix dialog title; send heartbeat based on when connected even if no
messages yet received; reset bt connection on palm in two stages;
remove unused param.  Change version number for beta.
2007-12-03 01:20:32 +00:00
ehouse
b527110379 replace all __FUNCTION__ with __func__ 2007-12-02 19:13:25 +00:00
ehouse
42615345c9 Re-add direct-via-ip transport, and implement for linux in order to
better test heartbeats.  Fix so can play against Palm over BT.
Assertions failing on Linux when reset, but it's otherwise done.
2007-11-26 02:58:25 +00:00
ehouse
321acd1d42 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
e5d5584a04 add logging to help catch a recurring assertion 2007-09-15 13:46:59 +00:00
ehouse
f1cda6dad4 What I meant to check in. Need to save first.... 2007-03-18 23:38:53 +00:00
ehouse
da551e1177 Always send BT reconnet message, even if there are messages to resend.
Fixes failure to reconnect when opening a saved BT game where the
other device is waiting and will need to resend.
2007-03-18 23:38:19 +00:00
ehouse
80efa73a50 Cleanup: compile warning and to make logging easier. 2007-02-08 15:17:23 +00:00
ehouse
51f726ddcf Add a one-byte header to BT messages so one device can signal another
that a new game's begun without dropping the connection.  On Palm,
remove connection-drop on new game.  With this change starting a new
game takes imperciptible time, down from 30 seconds.
2007-02-08 02:53:10 +00:00
ehouse
a7313b1e30 Fix linked-list bug in removeFromQueue. 2007-02-07 11:58:01 +00:00
ehouse
a762f27846 deal with case where guest begins new game but connects to host that's
running the old game: the host may reply, but guest must not take that
as evidence of a connection having been established: don't remove sent
messages (this isn't an ACK), and don't assert later on.
2007-02-06 05:49:45 +00:00
ehouse
6af89b4182 Add assert; don't call comms if has been set to null (fixes device
reset); fix failure to install connCB (removes need to manually resend
messages when client starts up first.)
2007-02-04 17:13:01 +00:00
ehouse
924fa5c12b fix crash when linux is bt server: if no addr provided it's not a duplicate. 2007-01-09 02:43:09 +00:00
ehouse
c645534b83 Fix so IR-only multi-device build works again. 2007-01-06 16:46:45 +00:00
ehouse
7afafed41d reject initial messages coming in on the same address a second time.
Fixes problem that surfaces when clients are more agressive about
resending early in game.
2006-11-11 22:37:36 +00:00
ehouse
ef7ad6f889 make IR the default conn type on Palm, where it's been the only type
until now.
2006-10-15 14:09:17 +00:00
ehouse
0c146fb800 add const to a few formal param declarations 2006-10-15 13:53:17 +00:00
ehouse
ba4f91d9e0 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
8c112261b0 Don't return from middle of function. 2006-10-07 03:37:40 +00:00
ehouse
a97631b7ca Fix opening games and messages saved by last shipping version on Palm
by checking version and loading new fields conditionally.  (Not yet
tested for current wince version.)
2006-10-05 01:17:03 +00:00
ehouse
bc80eae516 Put relay-only fields into a struct for easier identification. No code change. 2006-10-02 14:26:56 +00:00
ehouse
22ae4209ca Fix longstanding bug removing too few messages from queue on ACK.
Print queue as part of stats.
2006-09-27 01:54:53 +00:00
ehouse
402b6c1c6f fix ARM crash loading bt game saved on 68K: specify sizeof array
rather than struct wrapping it.
2006-09-23 16:04:53 +00:00
ehouse
3af93c2d4d What I meant to check in. F***ing emacs. :-) 2006-09-23 15:22:26 +00:00
ehouse
f64e3d2d3d On bringup for bluetooth, resend any waiting messages rather than an
empty new one to get the connection started.  This increases the
chances new games will connect without user having to hit resend.
2006-09-23 15:18:01 +00:00
ehouse
f508fd853f remove over-agressive attempt to detect out-of-order messages that was
breaking IR comms.
2006-09-17 05:06:46 +00:00
ehouse
e61414933f do a better job of rejecting messages that have strayed in from a different game. 2006-09-15 07:33:59 +00:00
ehouse
35b3b7132a Make formal param const; add initial value to relay-only field so
asserts don't fail b/c of uninitialized value; don't typedef array:
make array field of struct.
2006-09-14 01:25:40 +00:00
ehouse
975226cc4e remove param from util_addrChange; add comms_getIsServer; save bt_addr
as part of comms.
2006-09-08 07:14:24 +00:00
ehouse
af7767389c use stream_getSize to detect corrupt (truncated) messages. 2006-08-29 13:18:12 +00:00
ehouse
7d48f2e430 Put up BT device browser while user is picking connection method
rather than when trying to send for first time, then pass address
through from conns dialog to bt code.
2006-08-26 21:12:10 +00:00
ehouse
3c6405d0d1 First shot at bluetooth support (turned off in Makefile by default).
A full robot vs. robot game now works between two Treos.  Added UI to
choose BT as transport mechanism, and added new send proc to establish
socket connection between host and guest.  Works only for two devices:
no piconet yet.  No error recovery, ability to quit game in middle,
start new game, etc.
2006-08-23 04:44:55 +00:00
ehouse
f561989644 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
851946ffbc add ifdef for compile with some optional condition 2006-06-16 01:46:47 +00:00
ehouse
0dbc2e6557 don't exclude BEYOND_IR-only fields 2006-04-07 03:08:23 +00:00
ehouse
dcd31cd092 update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
cb4672b8b9 fix unset var warning 2005-10-30 16:14:13 +00:00
ehouse
2b58da4cdf New scheme for accepting and limiting reconnections. Now device must
send player counts, local and expected.  Based on these the relay
accepts connections, declares the game full and ready for message
forwarding, and decides whether to accept a reconnect.
2005-10-02 15:39:38 +00:00
ehouse
93534b268a make transmitted vars smaller where possible; new relay identifying
scheme where cookie is used only to connect, and is replaced for
reconnects by a relay-generated name that's supposed to be unique
across all games on all relays; let relay assign non-servers' hostIDs
rather than doing 'em randomly; use hostIDs for comms-level protocol's
channelNo where possible to avoid tripping over duplicate messages
2005-10-01 16:01:39 +00:00
ehouse
15bd397f96 send disconnect message to relay before starting a new game. 2005-09-05 15:33:51 +00:00
ehouse
b99675640a reset cookieID for a new game 2005-09-04 20:30:47 +00:00