Commit graph

95 commits

Author SHA1 Message Date
Eric House
a7c114e3f9 refcount dicts. Model "owns" its copy and so increments the refcount when gaining one and decrements the count on any being replaced (and on all on exit). This is setting up the real change, which is to let the java world wrap dicts in objects that hang onto them until they're destroyed, which should fix problems where dicts are referenced after they've been destroyed. 2014-03-08 20:57:27 -08:00
Eric House
9d174740c8 don't show "send pending messages" menuitem when there are none 2014-03-01 16:15:35 -08:00
Eric House
b2b4c2a1f5 fix android compile errors 2013-12-27 19:32:56 -08:00
Eric House
2a47c91a91 add gi_setNPlayers() 2013-12-17 21:54:02 -08:00
Eric House
f1f13c65a2 don't overwrite gameID 2013-12-16 08:05:56 -08:00
Eric House
b5d6c513a6 add canUndo to GameStateInfo and use to hide the undo menu 2013-12-03 07:06:48 -08:00
Eric House
94216a5fb9 add canTrade to GameStateInfo, pass through to java world, and use to
determine whether to show trade menuitem
2013-12-01 21:53:41 -08:00
Eric House
fc6d6ec707 use local variable 2013-12-01 18:37:21 -08:00
Eric House
0cc45ad865 add new field canHideRack to GameStateInfo and use it to disable menu. 2013-11-17 13:54:21 -08:00
Eric House
182ea7f862 make it possible to set DrawCtxt after opening/creating game 2013-10-31 08:06:44 -07:00
Eric House
27d9f3de45 Don't enable chat when more than 128 messages are in queue to prevent
an extremely unlikely cause of stalls -- and make tests trip over full
queues less often.
2013-07-18 07:37:45 -07:00
Eric House
3e723c72c5 call comms_stop() before closing (removing from memory) a game. 2013-01-28 06:52:32 -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
83b1d4c364 fix compiler warnings 2012-12-08 06:40:21 -08:00
Eric House
cf8d30ce5d tweak logging; fix uninitialized debug-only variable 2012-11-13 21:18:52 -08:00
Eric House
13c74cfbd5 protect changeDict feature with compile-time flags (since it can't be
used on Android)
2012-10-24 06:46:54 -07: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
3221fb237a Make state disallow hints when game over 2012-10-08 07:21:36 -07:00
Eric House
ad67f31573 saveToken can be 0 when only gi is being saved 2012-09-15 15:19:23 -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
67ddbf140b remove comment unintentionally committed 2012-08-23 06:38:45 -07:00
Eric House
32e1530d3f i => ii; no other change 2012-08-22 07:44:21 -07:00
Eric House
60a4f123a2 include trayVisState in GameStateInfo 2012-06-05 22:13:26 -07:00
Eric House
08f03af2cc don't write gameID as 32 bits when it's bound for old-version client,
and assert based only on the lower 16 bits in case came from
old-version client.  Fixes crashes testing mid-game upgrade from beta
43.
2012-05-07 07:02:43 -07:00
Eric House
a34921155f make gameID consistently 32 bits in C code. It's been stored as 16,
so stream version must change.  Plan's to use it to address incoming
BT packets so a game needn't be open to receive.
2012-01-19 18:47:53 -08:00
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