Commit graph

67 commits

Author SHA1 Message Date
Eric House
d4436b7706 Break part of util into dutil
Trying to separate what's game-specific from what can be app/device
specific (i.e. with a long lifespan, and available when a game isn't
open.)

Android will be broken after this commit and fixed after the next
2018-07-05 07:58:50 -07:00
Eric House
d70b089835 use mem_stream_make_raw() where possible in linux code 2018-06-27 23:37:28 -07:00
Eric House
19a6672785 don't show current players tiles in list of remaining 2018-01-18 22:02:06 -08:00
Eric House
3e9381d946 use a single timer and a queue for received data
using g_add_idle() for each piece of data received on the (background)
curl-query thread wasn't working. They were getting starved, and I think
some were considered duplicates and never scheduled. So add a single
timer proc called every 50 ms and a queue that it checks and into which
the network thread can put stuff.
2017-10-28 16:13:11 -07:00
Eric House
a8f06b53e2 test script; log threadid 2017-10-27 05:57:40 -07:00
Eric House
3045697d31 wip: process moves received 2017-10-19 21:20:14 -07:00
Eric House
ca6edcfc9a make trade and move confirm non-blocking
Probably breaks curses build, but for gtk and Android
turn move and trade confirmation into a two-step process, making
board_commitTurn() non-interactive when called with a second
parameter. The old blocking util methods now return void and it's up to
the client code to interact (on the main thread) then re-call
board_commitTurn() if appropriate.
2017-02-17 08:58:20 -08:00
Eric House
3c0a128266 produce, store and display actual snapshot
Done in a way that won't work for Android just to try out the gtk
way. Tweaks and reuses the existing draw context and board, which is
precisely what the android version can't easily do.
2016-08-05 09:42:55 -07:00
Eric House
53f44af199 fix assertion failure by handling missing case 2016-02-18 07:45:41 -08:00
Eric House
0bb51e8b93 show a toast when hint can't find anything, on the principle that user
should see some response to every action.

Conflicts:
	xwords4/android/XWords4/archive/R.java
2015-07-26 12:09:15 -07:00
Eric House
e66260950e change final score formatting so it can be properly localized.
Note: because the substitution is done in common code I can't use the
positional specifiers (%1$s vs %s) and so this breaks the generated
"translations". The scripts that do the generation need to be fixed to
understand the formatted="false" attribute.
2015-05-13 07:51:32 -07:00
Eric House
09b36814bd fix to be able to open android xwdb files again. For the record,
here's a command that works, providing the game's wordlist and rowid:
run --game-db-file /tmp/xwdb --game-db-id 799809255 --dict-dir \
/var/www/and_wordlists/English --dict-name TWL06_2to15.xwd
2015-04-07 20:22:48 -07:00
Eric House
5f33d99c2e toward making full use of getQuantityString(): add util method to pass
quantity through to java world, use it, convert English <string>
resources to <plurals> (using python script) based on parallel changes
in French, and modify callsites to call getQuantityString() where
R.string.xxx became R.plurals.xxx.
2015-03-18 21:23:30 -07:00
Eric House
51a1ddfe39 include robot name in report of his score 2014-10-23 06:32:24 -07:00
Eric House
88248131da show new client-formatted turn summary in notification; remove old
common-formatting code.
2014-08-26 21:37:33 -07:00
Eric House
2d08848715 snapshot: toward having a better description of the last move in
notifications.
2014-08-26 06:55:26 -07:00
Eric House
75b6ecc325 add missing util function 2013-12-19 07:57:59 -08:00
Eric House
2629c07256 Address problem with devids (e.g. GCM): until now when you got a new
devid you tossed your relayID and reregistered.  Which meant any
existing messages meant for your relayID were orphaned, and any open
games didn't know who they belonged to until you reconnected to them
with your new relayID.  So: modify the UDP protocol (though not on
Android yet) to include both relayID and devid with registration, with
one or the other an empty string if not present or not changed from
earlier.  I can't fix existing clients that are dropping their
relayIDs, but when one does a re-connect without a relayID I can look
it up from the existing game record, then reuse it rather than issue a
new one.  Better than nothing -- and that protocol will be obsolete
soon anyway.
2013-09-14 21:06:14 -07:00
Eric House
d6658c5c08 don't show other_disconnected error message 2013-07-10 23:14:48 -07:00
Eric House
a522266ce4 add message checksumming for android too by making it part of util
(compiled out by default)
2013-07-10 08:05:47 -07:00
Eric House
5a20cc282c fix so curses app works well enough that discon_ok2.sh script runs
successfully.  GTK mode is untested and certainly broken.
2013-07-09 18:10:41 -07:00
Eric House
c75ecef240 test deletion of games and generation of anonymous relayIDs 2013-01-29 07:42:10 -08:00
Eric House
76f3bb3413 fix curses version so discon_ok2 tests work again. 2013-01-07 20:40:46 -08:00
Eric House
f88387da80 lots of changes to separate game data from app data so several games
can be open at once.  (curses version is almost certainly broken)
2013-01-07 06:10:44 -08:00
Eric House
6ca966f22a make test script and linux client mimic case where relay regid is
rejected by relay.  Client re-registers and a new relay regid is
issued.
2012-11-12 07:27:20 -08:00
Eric House
1316ae4b67 Fix relay devid protocol to deal with case where client submits a
ID_TYPE_RELAY id that's not in the devices table (as has happened when
a device switches relay URLs during testing, but might also happen if
I have to delete an entry from the devices table.)  In that case,
return ID_TYPE_NONE to the client, which will be its clue to delete
its ID_TYPE_RELAY id and submit the platform-specific id again.

Note: android won't compile this revision thanks to util.h change
2012-11-10 15:05:44 -08:00
Eric House
59937b8514 modify how devids are handled on the relay and the protocol through
which they're communicated to the device.  Device is expected to have
a platform-specific notion of ID which the relay stores in a new
devices table and indexes with a 32-bit number which is returned to
the device -- which is encouraged but not required to use it in lieu
of the longer ID in future communications.  Modify linux client and
test script to use the relay-supplied id.  Some of this is commented
out for now.
2012-11-03 10:58:01 -07:00
Eric House
3469975d2a add, still disabled by compile-time flags, code to transmit device ID
(e.g. ID Android devices get via GCM) to relay and to associate it
there with messages that need to be delivered.
2012-10-30 07:01:47 -07:00
Eric House
e64ecfb78d implement resign on top of existing endGame logic, adding "quitter" as
new param passed to remote and changing final score formatting and
menu items to match.  Still need to show old menu on android in case
where game has already ended.
2012-10-07 12:47:06 -07:00
Eric House
968340f665 Fix release-build warnings that new compiler flags. 2012-10-07 11:43:50 -07:00
Eric House
140c982d41 merge from android_branch 2012-09-24 07:39:44 -07:00
Eric House
1608f0a8f9 handle missing error messages 2012-09-09 15:49:17 -07:00
Eric House
270a19f3aa Revert "first of a set of changes to communicate to clients dictionary being"
This reverts commit b7a0f1489b, which I didn't mean to check in on this branch.
2012-09-03 21:34:51 -07:00
Eric House
ea4d805d5f first of a set of changes to communicate to clients dictionary being
used by server.  Clients need to care if e.g. the server's disallowing
phonies based on its dict.  Can only be sent if client is of latest
version.  In that case, common code calls into new util function.  In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it.  Once it's available, will want to install it.
2012-09-03 21:33:46 -07:00
Eric House
b7a0f1489b first of a set of changes to communicate to clients dictionary being
used by server.  Clients need to care if e.g. the server's disallowing
phonies based on its dict.  Can only be sent if client is of latest
version.  In that case, common code calls into new util function.  In
future changes, BoardActivity's implemention of the callback will need
to check if the server's choice of dict is available, and if not offer
to download it.  Once it's available, will want to install it.
2012-09-03 21:29:21 -07:00
Eric House
bd70a1dd7d improve text in remaining tiles dialog, and always show the tiles for
all trays rather than excluding those in current player's tray.
2012-07-09 21:44:29 -07:00
Eric House
bd35f8363f cast enum to int inside switch to avoid new compiler error 2012-01-11 18:43:51 -08:00
Eric House
c1e420f726 Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/relay/rq.c
2011-11-29 06:45:32 -08:00
Eric House
1b864b5527 Add backtrace function. May only work on Linux but still very useful. 2011-11-28 18:12:56 -08:00
eehouse@eehouse.org
93a7d15a5e Merge remote branch 'origin/send_in_background' into send_in_background 2011-11-23 17:57:54 -08:00
Andy2
d37424ad7f Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/linux/linuxutl.h
2011-11-21 22:18:52 -08:00
Eric House
9115b344fb use a hash of lists rather than a single list to store pending
background messages to fix assertion failure when more than two
devices are playing: messages must be sent grouped by relayID.
2011-11-21 17:57:38 -08:00
Eric House
8a51d5f3e4 fix race condition that was breaking tests: when one device sends two
messages they must be handled by the relay in order.  So modify linux
client to build a single packet of all messages sent instead of
letting rq sent each on a separate socket.  The relay would give the
sockets to different threads and sometimes the wrong one won.  Will
need to make sure the android code's doing the same thing (it appears
to be), or perhaps make the coalescing code common so I only debug it
once.
2011-11-17 19:56:36 -08:00
Andy2
210c59ef9b move bonus square values into model: add API to set an array, and API
to query model for values.  Now everybody else queries new model API
rather than client via util_getSquareBonus(), model uses its internal
values if present otherwise falls back to util_getSquareBonus(), and
internalizes the array as part of the game.  Now it should be easier
to have different bonus patterns and to have them exchanged as part of
network game init.
2011-11-16 19:01:11 -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
Eric House
c591182d6c Modify linux bonus square code to work with board data that's half the
size.  Toward a board small enough to be transmitted as part of
network game initialization.
2011-11-08 21:11:06 -08:00
Andy2
4eee7f8aa7 Pass selected tiles into new util function, and from there into java
world, so confirming query can include them.
2011-10-19 18:34:26 -07:00
Andy2
da475347a5 get rid of unused constants 2011-09-02 18:36:26 -07:00
Eric House
4093e1c947 add option to switch between mmap and malloc for dict runtime access. 2011-07-18 18:07:15 -07:00
Eric House
febb640049 add name of remote player to notification that remote player moved.
And remove a few dead strings.
2011-07-15 18:13:55 -07:00