Commit graph

1098 commits

Author SHA1 Message Date
Eric House
7994c42691 allow board cells to be wider than tall
There are some screen dimensions, especially with dual-pane mode, where
the board is just bit narrower than the screen. Rather than have narrow
white borders, allow the cells to take up the slack. The API takes an
upper bound on the ratio of width to height so things shouldn't get too
odd looking.
2016-09-15 20:37:29 -07:00
Eric House
baf825e7db add gtk-3 to set of debs Makefile knows to install 2016-09-13 19:45:29 -07:00
Eric House
b1ce992d23 gtk: don't resize scrollbar
Mistaken option to gtk_box_pack_start() meant the scrollbar got
allocated space along with the board when the container expands, not
what you want with a scrollbar.
2016-09-04 20:46:25 -07:00
Eric House
c4efebad71 gtk: add localTurn column; format date 2016-08-26 07:26:33 -07:00
Eric House
1d1e971120 gtk: add initial size/position for window 2016-08-26 07:21:00 -07:00
Eric House
4c923ead08 add isLocal param to server_getCurrentTurn
I want to store this information separately in summaries tables so
e.g. games can be displayed sorted by whether it's the local player's
turn.
2016-08-26 06:58:55 -07:00
Eric House
457970b2d2 gtk: the tiniest bit of cleanup
Trying and failing to get just the content area of the tree view to
scroll, whether by putting it in its own container or hooking into the
scrollable interface tree view allegedly supports.
2016-08-10 14:53:44 -07:00
Eric House
bf7a38da08 copy more state into board being used for snapshot 2016-08-05 21:19:49 -07:00
Eric House
a275730824 gtk: fix crash when hit rematch button
Not all games have a draw context. Check!
2016-08-05 18:37:35 -07:00
Eric House
012b015f82 gtk: save games list window size and position 2016-08-05 18:31:17 -07:00
Eric House
25723bbb0f put main games window in a scrolling container 2016-08-05 12:02:05 -07:00
Eric House
7f513313b0 fix crash loading new game before snapshot exists 2016-08-05 10:37:42 -07:00
Eric House
0c6283ea63 add board_drawSnapshot
Toward something that should work with android: pass a potentially
unique draw context into new method that creates a new board just for
the draw and makes its scoreboard and tray disappear.
2016-08-05 10:23:39 -07: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
aeee2d801a toward snapshots in gtk version
Add new "snap" blob to db and pixbuf column to games display table, and
add code to store and retrieve from db. What's stored now is a
hard-coded file, so next up is generating an actual snapshot from the
game.
2016-08-05 08:29:25 -07:00
Eric House
b4393d5965 fix cursor-hiliting of player in scoreboard 2016-08-04 16:13:54 -07:00
Eric House
df6c1e0d3a make beginDraw return a boolean so can abort
When a gtk3 window's shutting down it appears we can't get a cairo_t*
for it. This change makes it possible to turn that fact into aborting
the whole draw operation.
2016-08-04 15:12:05 -07:00
Eric House
3c7af0023e fix curses drawtable fallback 2016-08-04 14:16:52 -07:00
Eric House
80f894b869 fix remaining gtk dialogs 2016-08-04 12:43:33 -07:00
Eric House
66e26c1489 hook up draw signal
Whenver we get the draw signal, invalidate the whole board and draw
it. This is resulting in a lot of wasted effort that might be mitigated
if I figured out how to get the invalid region out of the cairo_t*
that's passed in, but this is a test app and my machine's pleny fast. So
go with it for now.
2016-08-04 11:41:43 -07:00
Eric House
1892d24317 get all layouts from the same place 2016-08-03 17:56:38 -07:00
Eric House
9521b71be9 fix remtext rendering 2016-08-03 17:35:44 -07:00
Eric House
670f0034af fix a bunch of color setting 2016-08-03 16:54:45 -07:00
Eric House
eb6fb508bf fix crash dragging tiles
Add new begin() and end() methods around all drawing and get/destroy
cairo context there.
2016-08-03 15:50:17 -07:00
Eric House
b57e50a255 snapshot toward building with gtk3
Board renders, but only when touched. Tray and scoreboard skipped for
now. Lots of changed still to go, and some asserts added where I didn't
want to stop to solve a compile problem.
2016-08-03 15:19:12 -07:00
Eric House
2ade75158b gtk: update constants 2016-08-03 08:20:05 -07:00
Eric House
799e89fdc1 gtk: use accessors instead of peeking at structs 2016-08-03 08:09:47 -07:00
Eric House
bd8e829a06 replace deprecated gtk symbols (lightly tested) 2016-08-03 07:11:02 -07:00
Eric House
2ff7582688 enforce and follow new gtk header rules 2016-08-03 06:15:49 -07:00
Eric House
53e40be2e3 add lastMoveTime to summary table (gtk version) 2016-07-25 08:28:37 -07:00
Eric House
406eb77f54 post notification (rather than just play sound) when turn comes into
boarddelegate but it's not visible
2016-04-14 22:16:18 -07:00
Eric House
f288fe2860 use malloc to allocate storate for hci_inquiry instead of the
stack. That *seems* to fix it always returning 0, something that
changed with newer version of linux or libbluetooth or who knows
what. BT still doesn't work from linux, but this is a necessary start.
2016-04-09 15:49:11 -07:00
Eric House
9fb5f49595 when a game's opened from an Android db, there's no row data to delete 2016-03-04 19:28:38 -08:00
Eric House
50107949f2 merge local heads 2016-02-18 07:47:46 -08:00
Eric House
53f44af199 fix assertion failure by handling missing case 2016-02-18 07:45:41 -08:00
Eric House
4157169d91 add dict.xwd so I don't have to keep creating it 2016-02-16 20:48:28 -08:00
Eric House
19713a40ad add param to comms_resendAll to limit type of message sent
(e.g. BT). Meant to be used when a single type has become available.
2016-02-02 07:01:48 -08:00
Eric House
22dde029c8 Merge tag 'android_beta_100' into android_branch
ready for release
2016-01-03 11:36:37 -08:00
Eric House
a4a135b953 up CV version for testing 2016-01-01 19:30:35 -08:00
Eric House
dd242c3ff5 make undo ratio operate on 1/1000 scale -- and even with this it's
overwhelming when more than 40 clients are running.
2015-12-30 21:23:29 -08:00
Eric House
0a91f852cc add commented-out flag 2015-12-30 05:59:52 -08:00
Eric House
4ed843a529 start UDP at 100% by default since all clients will be that way now 2015-12-29 19:01:15 -08:00
Eric House
e3d6cb74fc for some reason log files are now considered binary by grep, so -a option's needed 2015-12-29 18:59:52 -08:00
Eric House
87517edd6f fix counting of messages sent by "Resend messages" menuitem: actually
count them, and do so based on new msgNo passed from comms that's
concatenation of channelNo and msgID so that duplicates (over multiple
transports) aren't counted twice.
2015-09-30 06:50:04 -07:00
Eric House
e5cf0ee4fb Merge branch 'android_branch' into relay_noconn
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2015-08-19 07:44:17 -07:00
Eric House
6d7123c27a fix curses app for standalone games (at least to not crash) 2015-08-19 06:05:18 -07:00
Eric House
47954f82d0 add index of sending player to chat transmission, and on receiving
side translate that into showing the sender's name in
notification. Not yet done: replacing silly "not me" in chat listing
with same, but now it should be easy.

Conflicts:
	xwords4/android/XWords4/archive/R.java
2015-08-12 07:43:20 -07:00
Eric House
8f7267b3ec add index of sending player to chat transmission, and on receiving
side translate that into showing the sender's name in
notification. Not yet done: replacing silly "not me" in chat listing
with same, but now it should be easy.
2015-08-12 07:36:36 -07: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
dad39eedde Remove devID from comms address. It's not needed yet, may never be,
and I don't want to store it until it is.
2015-07-22 06:16:29 -07:00
Eric House
5dc8291981 show a toast when hint can't find anything, on the principle that user
should see some response to every action.
2015-07-11 16:24:21 -07:00
Eric House
d084ccec2b provide non-empty default names for linux players 2015-07-11 15:16:32 -07:00
Eric House
1eb82d5285 android doesn't send its devid in the nli struct, so don't assert it's
there.
2015-07-11 14:27:01 -07:00
Eric House
1423bc933d rename common file and methods for consistency with android. No logic
change.
2015-07-11 08:40:49 -07:00
Eric House
b5ae54f313 use common/native NetLaunchInfo to implement invite-via-relay that
works between linux and Android clients. Required renaming so struct
names and names of fields within match in c and java code. The point
is to test this as the foundation of rematch: now you have to type in
a deviceID in order to invite, which clearly sucks for users. Either
that goes away, or it's replaced with something that scans existing
games and lists past opponents as possible invitees.
2015-07-10 23:19:38 -07:00
Eric House
1f3959fc71 fix rematch initiated by a guest: needs to be host in the game it
creates.
2015-07-06 21:18:51 -07:00
Eric House
08e6c2b358 use a static to remember last devid typed 2015-07-06 20:52:22 -07:00
Eric House
0f33228155 get rematch working on linux, at least for two-device games. (Handling
the case where one of several guests wants to rematch is a hard
problem for later.) Requires passing old-style relayIDs (connname plus
device index) when devIDs aren't available, which they may not always
be.
2015-07-06 20:28:16 -07:00
Eric House
3a896df199 show game-over dialog (with its Rematch button) when a over game is
opened
2015-07-01 18:38:33 -07:00
Eric House
8f794fbd32 beginning of support for invite-by-relay (which is mostly interesting
for Rematch): works for linux version, provided you know the relayID
of the device you're inviting. Added to common/ a stream-saving
version of java's NetLaunchInfo I'll probably want to use there too
for cross-platform compatibility (there being no jni support for
json.)
2015-07-01 07:10:45 -07:00
Eric House
1b6ce4861f don't crash when invitation dialog cancelled 2015-06-28 09:00:41 -07:00
Eric House
d479486521 change defaults so a with-games-ui/udp game interface comes up by
default.
2015-06-26 07:35:24 -07:00
Eric House
49dc8e7d10 print index of game being killed so easier to find it in the list of
tiles-per-game
2015-05-17 11:53:48 -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
6d8f13df9e Merge remote-tracking branch 'sf/android_branch' into android_multi2
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2015-02-19 06:45:11 -08:00
Eric House
59bf77c871 fix occasional assert by increasing buffer size 2015-02-19 06:39:32 -08:00
Eric House
ad6be1bb7e add debug-only "tag" to open games so logging can more easily track
what's going on when multiple participants in a single game are on the
same device. But for a couple of strings passed into the jni the
changes are only in DEBUG code.
2015-02-09 19:15:43 -08:00
Eric House
acf5a01374 Fix assertion failure: comms_msgProcessed() must be called whenever
comms_checkIncomingStream() is
2015-02-08 11:29:27 -08:00
Eric House
17307f910b fix problem with misdelivered message forever locking out future
messages: when comms thinks a message is an init but server drops it,
give comms that info so it can remove it and give the next one a
chance.
2015-02-07 13:24:09 -08:00
Eric House
cf3c219b69 fix non-DEBUG compile 2015-02-07 12:54:46 -08:00
Eric House
4701fe2b90 pass in number of devices already connected so forceChannel can be set
more correctly; put up alert when device rejects an invitation as a
duplicate.
2015-01-03 09:50:07 -08:00
Eric House
28bfa3c904 make forceChannel part of CurGameInfo rather than comms, since Android
needs to save it there on receipt of an invitation (doesn't create
full game with comms until later.)  Passes discon2 tests and seems to
work on a single Android device. (Haven't tested inviting on Android
yet.)
2014-12-29 07:39:28 -08:00
Eric House
3209fc1b74 log sqlite error codes as strings in attempt to track down the
occasional assertions failure.
2014-12-28 21:40:31 -08:00
Eric House
3b7afa4557 pass --server if not setting forceChannel 2014-12-28 21:39:11 -08:00
Eric House
897c4d5786 add param to force a client to connect to host requesting a particular
channel. Works well enough that relay test script works. Not yet
integrated for let alone tested on Android.
2014-12-21 17:40:00 -08:00
Eric House
d81f022c78 Merge branch 'android_branch' into android_multi2
Conflicts:
	xwords4/linux/scripts/discon_ok2.sh
2014-12-15 16:48:10 -08:00
Eric House
30d2c84dcc so tests can continue, comment out an assertion that indicates a relay
bug that neverless doesn't prevent games from running to completion.
2014-12-15 16:43:24 -08:00
Eric House
eb5ae9edd3 declare as little-a array so key will be listed in numeric order 2014-12-15 16:41:15 -08:00
Eric House
45ef4fcb65 add --dup-packets calling through to linux client 2014-12-15 16:14:59 -08:00
Eric House
4835afbe4a simplify and print in order 2014-12-15 15:29:37 -08:00
Eric House
7560156351 summarize the number of tiles left every 20 passes to give better view
into games' progress
2014-12-15 15:11:29 -08:00
Eric House
1eb7d01be5 add option to turn on duplicate packets -- which fires an assert on
the relay instantly.
2014-12-11 20:23:51 -08:00
Eric House
00d19eada6 log a few more message checksums 2014-12-10 07:48:51 -08:00
Eric House
9ff7cd1ff9 comment out dead code so I stop trying to debug it 2014-12-10 07:47:36 -08:00
Eric House
97092e361c update grepped string to match changes in logging 2014-12-08 06:23:18 -08:00
Eric House
f84f9aa85f include timestamp of switch to UDP -- in case it needs to be
correlated with logs
2014-12-08 06:20:47 -08:00
Eric House
b2b60d6c48 add commandline params that disable comms types on game creation so
relay not connecting initally can be tested.
2014-12-02 06:49:35 -08:00
Eric House
4b30d98bd0 fix to compile with DEBUG off 2014-11-20 07:16:37 -08:00
Eric House
fbea67e479 don't kill relay when bluetooth turned off: pass comms type into
comms_transportFailed()
2014-11-20 07:12:25 -08:00
Eric House
c008f55133 add invite button only if I'm a host and am missing players 2014-11-12 06:52:40 -08:00
Eric House
552ab8fa48 fix assertion (leaving the confusion in the code about tracking the
open relay socket)
2014-11-11 07:36:55 -08:00
Eric House
ba44863381 add simple tell() as wrapper on ask() 2014-11-11 07:35:56 -08:00
Eric House
10a960930c collect number to be invited. (Not tested: whether a number other than 1 works) 2014-11-11 07:35:14 -08:00
Eric House
ba6151c385 remove param that causes assert to fire 2014-11-10 07:31:51 -08:00
Eric House
c704b7ff4f remove dead code 2014-11-10 07:31:33 -08:00
Eric House
786d775878 don't pass null address 2014-11-07 20:25:13 -08:00
Eric House
70f4541bbe Merge branch 'android_branch' into android_multi2
Conflicts:
	xwords4/common/comms.c
2014-11-06 20:09:20 -08:00
Eric House
a34a859d18 log channelNo more consistently 2014-11-06 18:44:19 -08:00
Eric House
540d3e9622 wire disabling checkboxes into comms. They work -- and show that
multi-addressing needs debugging still.
2014-11-06 06:35:28 -08:00
Eric House
b1de8663d6 fix to compile with DEBUG undefined 2014-11-06 06:32:00 -08:00
Eric House
3d9ee4b9f9 use app define, not relay's 2014-11-05 21:45:14 -08:00
Eric House
c516e1f77c add code to log md5 sums of udp packets sent and received. These match
relaycon logging to be added shortly.
2014-11-05 21:42:03 -08:00
Eric House
405b3eef93 remove dead/commented out code 2014-11-05 21:33:54 -08:00
Eric House
564e671b47 quick hack to add checkboxes for turning off transport sends and
receives to be used for testing after it's actually hooked up.  This
is just the UI.
2014-11-05 18:48:53 -08:00
Eric House
17bc0ab47c snapshot of work toward communicating when two addresses are in use.
An invitation works with relay and (fake) SMS on, and the invited
client connects successfully using both (the second to arrive being
correctly identified as a dupe.)  While the game can be played after,
only SMS messages are being received. And opening a saved game
crashes.
2014-11-05 07:41:20 -08:00
Eric House
fc6ccf217f fix formatting of types: don't crash on too-small buffer, and add
separator only when needed.
2014-11-02 17:25:56 -08:00
Eric House
f853aad904 add checkbox to tab label when selected 2014-11-02 11:55:46 -08:00
Eric House
71fbae622a clean up code a bit 2014-10-28 20:13:48 -07:00
Eric House
1ca5515b07 Add checkbox to each type tab indicating whther the game will use that
addressing type to communicate.
2014-10-28 08:08:11 -07:00
Eric House
9b336bde49 fix crash: must iterate when multiple types are possible 2014-10-28 08:04:05 -07:00
Eric House
c3e7b12103 merge android_branch 2014-10-23 06:33:28 -07:00
Eric House
51a1ddfe39 include robot name in report of his score 2014-10-23 06:32:24 -07:00
Eric House
9886d5a6e6 merge over changes to run with new bash 2014-10-22 18:57:33 -07:00
Eric House
878a16b3bc snapshot: android compiles, and works well enough to exchange moves
via relay!  Lots of changes, mostly around treating connTypes as a Set
inside the java world.  Jni to translate to that is a pain.
2014-10-16 06:45:24 -07:00
Eric House
14a0ca95fe don't crash with, and correctly save, multiple addresses 2014-10-15 07:52:35 -07:00
Eric House
fe4c7b52f2 snapshot: relay test script works with a second address type set
(though with its actual transport stubbed out).  Android doesn't even
compile.
2014-10-15 07:26:18 -07:00
Eric House
737af802b0 don't abort if core file count goes down -- I probably removed some
old thing
2014-10-15 06:38:43 -07:00
Eric House
3534bc0e49 print usage prettier (with an apparent off-by-one error) 2014-10-01 19:52:07 -07:00
Eric House
b82383a5ad fix -- I hope -- array syntax that was getting lots of games launched
without an app (until it got upgraded)
2014-10-01 19:49:46 -07:00
Eric House
92292ad1fe fix problems with undeclared variables that older bash didn't mind 2014-09-25 21:45:44 -07:00
Eric House
43bd3c018a make an addr's conType a bitfield rather than holding a single value.
Works for large numbers of relay games in test, but will not yet
actually hold more than one value.  Should be safe to merge to main
branch once stream upgrade is verified.
2014-09-25 20:05:37 -07:00
Eric House
abf12e90da save a bit of work setting up game manually by assuming two players --
but ths must be happening too late because not all takes effect.
2014-09-25 06:35:10 -07:00
Eric House
3668b7d8a7 merge android_branch -> android_shipbt 2014-09-24 20:51:23 -07:00
Eric House
9ad8ad601c add cur dir to empty dict search path 2014-09-24 07:29:57 -07:00
Eric House
64b30b68d2 merge android_branch -> android_shipbt 2014-09-23 21:33:57 -07:00
Eric House
b4ef9ced87 merge android_branch changes 2014-09-23 21:33:02 -07:00
Eric House
113c7a13d2 print number of devices left 2014-09-23 21:26:46 -07:00
Eric House
49689ab04c always log error message 2014-09-23 07:30:34 -07:00
Eric House
ab64197ac4 fix recent booboo: it's not an error for server_initClientConnection()
to fail here.
2014-09-23 07:30:23 -07:00
Eric House
049cf284c5 toward getting direct-ip addressing working again: add a tab to the
connections dialog
2014-09-20 18:08:33 -07:00
Eric House
6f07098cf3 return succes from server_initClientConnection() 2014-09-14 13:42:11 -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
622760b71a post response to long-tap on player as a gtk dialog rather than just logging it. 2014-08-25 07:52:18 -07:00
Eric House
4231ed1108 fix refcount leak 2014-03-11 21:59:53 -07:00
Eric House
a4302897e2 enlarge dictmgr to track a compile-time defined number of dicts 2014-03-10 21:01:24 -07:00
Eric House
55267f2e42 add memmove 2014-03-10 20:25:38 -07:00
Eric House
6203a23c62 don't crash in networked games 2014-03-10 18:58:16 -07:00
Eric House
5500d36cde add and use dict manager that caches, using refcount, dicts across games. Allows multiple games to be opened, and open at the same time, with only one instance of a dict ever created. Works on linux; not used or tested yet on Android. 2014-03-09 19:12:21 -07:00
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
8a6adfec34 cleanup -- no logic change 2014-03-08 20:51:49 -08:00
Eric House
7002ff11c7 fix so non-DEBUG build compiles 2014-03-04 07:07:01 -08:00
Eric House
3ecd0a4b03 fix to compile without DEBUG 2014-02-28 04:58:25 -08:00
Eric House
e6564c679c use ccache if present 2014-01-21 07:10:13 -08:00
Eric House
e34cc9007d fix problems with opening and using wordlists on 64-bit linux by
making XP_U32 32 rather than 64 bits. Duh. Do same on Android jni just
in case.
2014-01-07 06:58:20 -08:00
Eric House
459c12d91f copy string's null terminator too 2014-01-06 07:05:34 -08:00
Eric House
19c70ccdcb fix mistaken scoreboard size calc 2014-01-06 06:54:56 -08:00
Eric House
3702a9f326 don't constrain screen size 2014-01-06 06:40:59 -08:00