Commit graph

562 commits

Author SHA1 Message Date
ehouse
8450c9da2b New callback called on first connect to relay and on first ALLHERE
message so users can see progress.  Handle new relay message ALLBACK
meaning "ALLHERE but not for the first time".
2009-12-14 04:03:17 +00:00
ehouse
14b060707f Report relay connection denials due to misordering out to platform,
and refuse to connect again until comms has been reset.  This goes
with platform code to put up the new game/conns dialogs on disconnect
errors.
2009-12-04 08:14:03 +00:00
ehouse
7fbd2bed45 Fix to compile when RELAY feature disabled 2009-11-22 18:00:20 +00:00
ehouse
5ab3425377 allow default relay port, like name, to be set at compile time 2009-11-22 16:30:20 +00:00
ehouse
3d6b43f032 fix palm and palm-arm compile problems including using changed APIs. 2009-11-19 02:22:32 +00:00
ehouse
3eadd93aa6 Pass scores and remaining tiles count to draw_scoreBegin so can
determine font size based on max length.   API change.
2009-11-18 13:24:56 +00:00
ehouse
7966f20829 for REM rect too place innerRect centered in outerRect 2009-11-15 15:45:50 +00:00
ehouse
4025c37604 Make "Room 1" the default room name. 2009-11-09 00:03:43 +00:00
ehouse
f6fb019732 Send to relay if connected, even if not all hosts present. And detect
duplicate initial packets a bit better.  This change goes with the
next checkin on the relay side: move to modified store-and-forward so
devices can connect at different times once the game is established.
2009-11-08 21:30:13 +00:00
ehouse
a61d01c5ff add new global preference that allows turning off confirmation dialog
after each turn.  Meant to fix ID: 2735517 feature request on sf.net.
2009-11-08 17:00:20 +00:00
ehouse
3bdfda6548 Make it possible for multiple games to connect using the same room
name.  All new connections are stored together, and after each
connection an attempt is made to build one complete game with a host
and however many guests.  All remaining devices are moved into a new
pending record in the same state, and the completed game is treated as
always.  Seems to work, though nearly 20% of linux instances are
failing to connect the relay run from the new test script samename.sh.
Need to figure out why.

Also added logging of seed and connname to comms.c since games
launched together can no longer be certain to connect on the relay.
This allows the test script to identify joined games from their logs
and detect success or failure.

This checkin changes the relay protocol, so relay and clients will
both need to be upgraded.
2009-11-02 01:01:47 +00:00
ehouse
27c518dec4 When tray's hidden you can't see that you're in trade mode. So try
revealing the tray (and so showing the mode) before aborting trade
request due to being in trade mode.
2009-10-25 00:23:00 +00:00
ehouse
85da3d2082 add parens for clarity 2009-10-24 14:50:23 +00:00
ehouse
1fa8b2e48f remove unused param (not even compiled on Palm); on wince, try to
duplicate for timer the vertical offset used for scores.
2009-10-16 03:20:39 +00:00
ehouse
e7f476c13e format last player whose turn it is, and track remaining space, so
platform code can include the name as a turn indicator.
2009-10-15 12:38:47 +00:00
ehouse
dde7cfa9b1 add a const 2009-10-15 12:37:42 +00:00
ehouse
1fba7d7ef6 add a couple of consts 2009-10-01 04:09:46 +00:00
ehouse
b24cab9af3 Just enough changes to get compiling on Palm again: seems to work
against the relay!  Begin process of displaying relay status via icon
reusing BT's spot.
2009-09-27 16:33:36 +00:00
ehouse
0e43675abf Address problems matching [re]connections to games: first, go back to
setting connName when all in a game are present.  Second, have every
host include in connections a random number.  That number is made part
of the connName and in general used to test whether a host belongs in
a particular game.  Add this "seed" to web interface.  Means new
versions for relay protocol and game stream format.  Latter is handled
correctly so older games can be opened.
2009-09-26 14:37:49 +00:00
ehouse
edde3e2fd5 cleanup 2009-09-26 14:33:52 +00:00
ehouse
881639c230 fix null ptr exception using null engine. Logic error was not exposed
earlier because except in multi-device game the UI would not allow you
to ask an engine-less robot player for a hint.
2009-09-25 10:17:35 +00:00
ehouse
ef8c85734e don't send on disconnect unless connected 2009-09-22 03:50:37 +00:00
ehouse
a13e1d6488 add util_clearTimer, implement on all platforms, and call when closing
comms to fix crash on Wince when timer fired after comms had been
deleted.  The closure stored and passed in was no longer a valid ptr.
2009-09-21 12:49:08 +00:00
ehouse
a91fd28773 fix some warnings when building linux client without debugging but
with warnings as errors.
2009-09-20 21:51:29 +00:00
ehouse
e8b372c274 fix more release build unused var warnings 2009-09-20 21:11:58 +00:00
ehouse
250e223a20 add bqRemoveAll 2009-09-19 21:28:07 +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
6603949b0e Fix bug where device quitting one game to start another with same
cookie winds up connecting to the old game -- by flagging a cref as
full and no longer accepting connections without connNames even when
in the MISSING state.  Required a protocol changes so that devices get
their connNames as early as possible.
2009-09-14 01:55:03 +00:00
ehouse
535e97b855 replace array of indices with array of ptrs for faster & smaller code 2009-09-13 05:28:12 +00:00
ehouse
49ac5d10a2 fix lookup of "special" char strings: Spanish and Catalan apparently
displayed properly since I merged the unicode changes in.
2009-09-13 04:57:44 +00:00
ehouse
6c4b991566 Modify comms and games APIs so single struct of callbacks is passed
instead of multiple callbacks; add callback called when relay state
changes; adapt linux and palm clients to new API.  (Wince changes
pending.)
2009-09-12 21:39:13 +00:00
ehouse
86b560c441 fix to compile on palm: accomodate old compiler and new dict struct
fields.  Network play against relay works!
2009-09-12 15:35:03 +00:00
ehouse
e8825e119c add comment re: stream format non-change for utf-8 2009-09-05 13:14:42 +00:00
ehouse
615603b66b Add define set to number of conn types compiled in; use it to compile
out conn type choice where there's only one (none to be made).  Refuse
to dismiss conns dialog when cookie not chosen.
2009-09-05 13:08:46 +00:00
ehouse
3a1c2572dd Merge in unicode changes to read in utf-8 dictionary format 2009-09-04 12:30:10 +00:00
ehouse
188eea4646 Try again if fail to connect to relay. 2009-08-30 15:25:13 +00:00
ehouse
6a36c045b6 fix wince compile error 2009-08-29 13:06:48 +00:00
ehouse
dbf9daf71b Fix problems reconnecting hosts where some but not all received the
ALLHERE message and connName: change relay protocol so cookie is
included in RECONNECT message, and hostIDs are not assigned until
ALLHERE, and change host-to-game matching to use connName first but
fall back to cookie.  This fixes nearly all cases failing to reconnect
after relay goes down.
2009-08-21 12:00:09 +00:00
ehouse
e746e2bc5b Fix assertion failures 2009-07-31 13:03:38 +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
76c0a518f1 change -j to -j3. No code change. 2009-04-14 03:27:32 +00:00
ehouse
9df574b6f6 Fix to compile (and so dicts are read into new internal format) on Palm. 2009-04-07 04:33:47 +00:00
ehouse
669e423ca8 Use new dict API to get rid of XP_UCHAR4 type, replacing with const XP_UCHAR*. 2009-04-07 04:23:56 +00:00
ehouse
7b5259a5c0 Use simpler API (no behavior change; not utf-8 related). 2009-04-05 20:19:29 +00:00
ehouse
641ae18864 Use new dict api to support utf8 faces. 2009-04-05 19:20:22 +00:00
ehouse
9f6114fb9e don't cast. 2009-04-05 19:18:47 +00:00
ehouse
96cfd7c7dd New stream version: dict sent over wire has faces as utf8 (unless dict is not.) 2009-04-05 19:16:52 +00:00
ehouse
38a23ba74f Begin changes for utf8 support (mostly from unicode_branch). Dict now
provides tiles as null-terminated const strings ptrs to which can be
passed and stored.  They're utf8 strings.  Old dicts still work,
platform must convert to utf8 on load.
2009-04-05 19:02:21 +00:00
ehouse
926f5963a3 rename only: stream_putString to stream_catString. 2009-03-29 18:26:59 +00:00
ehouse
d7eaa8e574 Add functions names to log statements. 2009-03-08 19:54:50 +00:00