Commit graph

70 commits

Author SHA1 Message Date
Eric House
adb9b3853d fix bugs around new variable-length tiles array changes, and otherwise
improve storage of col/row data so that test runs succeed with
MAX_COLS of 16 or 32.  Still to do: test mid-game upgrade.
2011-11-28 18:46:08 -08:00
Andy2
37e81fd062 use number of bits based on stream version not current build --
required in case new code is talking with old in networked game.
2011-11-18 07:43:10 -08:00
Andy2
fab39a5f87 Trying to deal with old- and new-proto devices interacting. Fix
clients to append their stream version to their inital connect
message.  (The format can't change, so detecting additional length was
the only option.  comm.c on existing clients won't allow more than one
connect message per channel, so adding a new to be used in addition
didn't work.)  New servers detect this; old will ignore.  Track the
version (implicit or not) of all clients, and use the lowest any
supports, so that new server and all new clients will use newer proto.
2011-11-16 06:47:55 -08:00
Andy2
86d5778ec3 remove 16x16 limitation on board size, replacing with 32x32. Change
is enabled by a compile-time flag so Android needn't follow yet.
2011-11-14 18:21:41 -08:00
Andy2
90f11abc37 add to game state passed into java world whether it's the cur selected
player's turn, and use that to enable/disable Pass/Turn done button.
2011-10-05 06:36:01 -07:00
Andy2
c9c498786e add to game state whether any tiles selected. Use that to disable
'commit exchange' button when there's nothing to commit, and get rid
of error message used when committing nothing since it's now
impossible (on Android).
2011-09-09 19:04:25 -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
Andy2
3b3a822dcc a gmae may have several dictionaries in several places, but all should
share the same language.  So pick one to send to draw_dictChanged
rather than sending all (some of which may be null.)
2011-04-28 18:40:44 -07:00
Andy2
96254ad8b5 when opening saved game, notify draw of per-player dicts as well as of
a single game-wide one.
2011-04-11 06:39:31 -07:00
Eric House
c77d3039cc add XP_FREEP. Should be no change in behavior. 2011-04-07 18:07:45 -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
Andy2
d9bb5197d4 Add two new menus to be available only when in trade mode. Hide and
show them and another group depending on whether trading at the time.
To make that work, replace the individual calls made to dis/enable
toolbar buttons with a single jin call that takes a struct full of
booleans and make that struct available in BoardActivity where menus
are hidden/shown.  Remove the individual calls from the jin interface.
2011-03-10 18:13:56 -08:00
Andy2
4b8e462b8b check for null ptrs to allow creating loading games that won't draw or
communicate with users.
2011-01-23 21:45:41 -08:00
Andy2
efb54c7b05 fix compile errors the stricter android compiler found. 2011-01-10 06:56:11 -08:00
Andy2
f111b78714 switch from tracking robot intelligence as a per-game boolean
implemented (when not smart) as trying to match the human's score to a
per-robot value between 1 and 100 that gives the percentage of best
moves to store before picking randomly from among them.  So a 1 means
save only the best move and always pick it; 100 means save all the
best moves (how many are saved is compile-time configurable) and pick
one of them.  Because it's settable per-robot a smarter robot can be
played against a dumber one (though I may choose not to make it
settable per-robot on shipping versions.)
2011-01-10 06:44:28 -08:00
Eric House
fd85bd35da set dictLang to 0 (unknown) when reading old-version stream 2010-10-26 20:56:41 -07:00
Andy2
20312144dd tons of changes, still rough, snapshoted here: a gtk device vs device
game works to completion with both signing up as guests (no -s) with
one local and one remote player (identical commandlines.)  Not yet
tested: if any signs up as a host, reconnecting rather than
connecting, etc.  This is just a snapshot.
2010-09-10 01:30:40 -07:00
Andy2
0b91e9634e save/restore new dictLang field; up stream version 2010-09-01 06:51:44 -07:00
eehouse
4ce0a30b2d save gameSeconds even if timer not enabled. Means stream version change. 2010-05-14 12:42:53 +00:00
eehouse
37646c20f3 accomodate null objects 2010-02-09 14:42:07 +00:00
eehouse
9f250c99ef get rid of gameID param. This change breaks all other platforms... 2010-01-31 21:35:07 +00:00
ehouse
b3dba204c6 fix compile warning 2010-01-26 04:03:21 +00:00
ehouse
3beba51b6f add jni methods, and modify common code, so a CurGameInfo struct alone
can be read from and stored to a game file.
2010-01-15 13:44:29 +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
acb37fda4f fix checkServerRole which was incorrectly counting players in client
case.
2009-02-28 19:25:08 +00:00
ehouse
42b314966b If platform doesn't provide a game id, use current seconds. 2009-02-07 18:12:46 +00:00
ehouse
e32e231dd5 New stream version makes standalone and multi-device build formats the
same so new Wince can open files saved by current version.  Tweaks to
build with relay and heartbeat turned on.
2009-01-03 23:54:25 +00:00
ehouse
37518415ea fix occasional crash: null-out ptrs after deleting what they point to. 2008-12-11 13:42:21 +00:00
ehouse
af1ca9af84 Quash some compile-time warnings. snprintf instead of sprintf. 2008-12-06 15:59:30 +00:00
ehouse
a1f3e3d174 call draw_dictChanged on load so draw can calc fonts immediately 2008-09-09 12:16:06 +00:00
ehouse
07e7032c16 give serverRole a default value. 2008-08-27 12:08:07 +00:00
ehouse
f749fdd560 Remove all tabs. No code changes. 2008-05-31 03:26:16 +00:00
ehouse
f3b8867518 Mark params unused in compiles for standalone; remove unused param. 2008-02-16 16:02:49 +00:00
ehouse
40f7295802 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
02ca3eb9d7 Make initial value of confirmBTConnect true. 2007-12-15 18:55:32 +00:00
ehouse
711bdf54f2 Instead of warning user on failure to connect via BT, add preference
to allow user to confirm before every attempt.  Users will learn to
set this when T650s are in the mix.  Save a new preference, and up the
stream version.  Up beta version.  Add the preference both to the prefs
dialog and to the bluetooth connection (for guest) dialog, with both
impacting the same field in gamePrefs.
2007-12-14 03:38:55 +00:00
ehouse
5457ea1b59 replace all __FUNCTION__ with __func__ 2007-12-02 19:13:25 +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
45d5bb6260 Hide tray on turn transitions when more than one non-robot local player present in game. 2007-05-20 20:46:29 +00:00
ehouse
dfc2d679e0 Don't call comms_start while opening game. Caller may still consider
another game open.
2007-03-18 23:55:58 +00:00
ehouse
aad182c2e3 turn stringFromStream into macro to aid logging for leak detection. Debug builds only effected. 2007-03-18 23:31:51 +00:00
ehouse
7c8b7294cd add const to a bunch of char* decls in APIs and variables; no code change 2007-02-03 17:54:20 +00:00
ehouse
3f111c5657 name change only: Connectedness becomes DeviceRole 2007-02-02 08:34:37 +00:00
ehouse
44eaa36319 More progress on one-handed navigation: fix ncurses board clipped to
bottom of tray; add focus-related params to draw*Finished routines
(and simplify to one) so platforms don't have to save from Begin
routines (and stop palm doing that); check version of saved game, and
handle case where older binary tries to open newer version; redraw
Palm tray buttons after focus change to stop focus-rect ghosting; fix
annoying overlap in saved games dialog; palm version goes to a3.
2006-11-05 16:54:18 +00:00
ehouse
878acbc759 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
9ab6ac701c cleanup and remove logging. 2006-09-23 15:18:44 +00:00
ehouse
a82e84c177 params become const; new macro syntax for strutils 2006-09-15 07:31:24 +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
a121388762 no harm in copying field when feature not available; may help newer
version to open file.
2006-03-04 16:07:21 +00:00
ehouse
6b140d641b fix b5 crasher: check for stream equivalence with the older version
now that current version's been upped.  Rename old version to better
indicate when it was current.
2006-03-04 06:12:38 +00:00