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
ehouse
48495df7e5
handle OTHER_CONNECT message by resending any unACKed messages.
2005-09-03 18:31:32 +00:00
ehouse
49676995e7
handle other-disconnected error message
2005-09-03 15:37:49 +00:00
ehouse
460cda0390
Receive disconnect events and display message for error codes.
2005-09-03 06:57:01 +00:00
ehouse
44996f14a7
send XWRELAY_RECONNECT
2005-09-02 06:26:33 +00:00
ehouse
711e0cdc36
cleanup for wince compile
2005-07-23 15:28:15 +00:00
ehouse
a26549afa9
Pass protocol version code with connect request, and return error if
...
it isn't what relay can handle. Report error to user.
2005-07-06 01:36:52 +00:00
ehouse
9d4bc009c0
name change
2005-07-06 00:58:20 +00:00
ehouse
93b78bc3f6
Make cookieID a 32-bit value instead of 16-bit
2005-07-05 23:02:15 +00:00
ehouse
2d23ffddd3
eliminate unnecessary setHeartbeatTimer call
2005-07-05 20:57:37 +00:00
ehouse
d29698c1b0
put back functions that never should have been removed.
2005-06-27 05:45:28 +00:00
ehouse
2abb6fe77f
cleanup: make module-local functions static
2005-06-25 05:43:56 +00:00
ehouse
82a0045cb3
convert util_setTimer to take procptr; remove timer call on board; add
...
heartbeat to comms that uses util_setTimer with new timer type.
2005-06-23 04:16:53 +00:00