Commit graph

1027 commits

Author SHA1 Message Date
Eric House
a6602fabe0 hide menuitem when not in http mode 2017-10-21 14:24:38 -07:00
Eric House
37162e0471 fix curses commit; refactor & cleanup 2017-10-21 12:11:26 -07:00
Eric House
816df4336c run post in thread since it takes time 2017-10-20 06:26:46 -07:00
Eric House
3045697d31 wip: process moves received 2017-10-19 21:20:14 -07:00
Eric House
5223ccabe1 add option to run forever 2017-10-19 20:50:33 -07:00
Eric House
4a1e51b54a call query from C
Very rough code that fetches messages and does nothing with them.
2017-10-18 22:03:14 -07:00
Eric House
fbaa1f139e add test method and implement query() endpoint 2017-10-18 21:18:30 -07:00
Eric House
e6e93c09ab oops: use the right length 2017-10-18 07:19:43 -07:00
Eric House
c08be98fda wip: include multiple packets in reponse json 2017-10-18 07:09:05 -07:00
Eric House
b86ffeb2b9 wip: data gets to relay and response handled
A device registers and a game can start. But we don't get to being
able to make a move yet.
2017-10-18 06:53:15 -07:00
Eric House
2dc80ac93f talk to new python script to interface with relay
So far uses curl and json-c to send b64-encoded data to new script
which is able to echo the data. Next that script will need to open a
UDP socket to the relay and return results that appear before timeout.
2017-10-17 21:32:11 -07:00
Eric House
36aef059c1 remove assertion: deviceID can change
Hit this nuking the devices table mid-game. Games recover with the
assertion removed (and storing the new/non-matching deviceID)
2017-10-07 10:47:44 -07:00
Eric House
2cabf2332c fix compiler-found (but trivial) error
debian's new compiler rocks. Effected only test code I never use, but
still nice to fix.
2017-10-07 08:03:18 -07:00
Eric House
618ee89add fix crash drawing game timer
It's outside the normal begin_/end_draw flow and so cairo wasn't set up
as expected.
2017-09-20 07:26:26 -07:00
Eric House
0b0a50bd5c add timestamp to chat messages, db and display
On send, add current seconds to message. Store and display in android
code. Display layout needs work.
2017-06-10 11:36:45 -07:00
Eric House
6e5973c55b toward making tile picking work through rotations
Make face-up tile picker util method return void and add mechanism for
passing in selected tiles asynchronously, as has been done recently with
the rest of the once-blocking util callbacks. Works perfectly in the gtk
case. Likely crashes in curses (if picking face-up option is on.) In
java all the callbacks are there but rather than put up a UI we pretend
the user says "pick 'em for me" each time. Putting up a UI is next.
2017-03-09 20:36:14 -08:00
Eric House
c271202faa make bad phonies alert non-blocking
Continue conversion of alerts that required blocking the JNI thread. Now
board_commitTurn() takes a second boolean indicating whether phonies
found have been approved by user. Common code informs user, and if he
approves client code calls board_commitTurn() again. In case where
turn's lost there's no call to make back, but there's the undesirable
change that if a robot moves next its move will be reported on top of
the turn-lost alert. Ideally new alerts would appear under, not on top
of, those that have not yet been dismissed.
2017-02-20 07:20:19 -08:00
Eric House
42aef7b85c add UI to set phoniesAction creating new gtk games 2017-02-19 15:05:40 -08:00
Eric House
5f12d1a03b assign faces to blanks asynchronously
Next step in converting util_ methods that required blocking: blank tile
assignment. Now post a query and add a method that the client code can
call when the user's decided. Include enough state (col, row, and
playerNum) so that it's probably pretty safe.
2017-02-18 19:16:32 -08: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
1f2f4506c4 remove unused query option. Less to convert. 2017-02-17 06:30:54 -08:00
Eric House
2a0b21e5e8 make password fetching non-blocking
First attempt to stop blocking the jni thread: instead of returning a
password from a util_ method, have it include enough state that the UI
can return, put up a dialog, and then pass that state and the password
back and have them matched up again. I think this will work for the
remaining blocking Alerts too.
2017-02-17 06:23:44 -08:00
Eric House
4d5278704e symlink changed! 2017-02-16 19:05:34 -08:00
Eric House
b96d44393a add and use boolToStr
Just to make log messages a bit more helpful. Should be no behavior
change, and no change in code generated in release builds.
2017-01-22 14:15:29 -08:00
Eric House
92029b2443 fix to build with CURSES_ONLY flag 2016-12-22 08:57:54 -08:00
Eric House
55d86d5ca2 don't try drawing snapshot in curses mode
Was crashing on game save. Add to main launchParams struct whether we're
in curses or gtk mode and only save snapshot in latter case.
2016-11-09 07:38:41 -08:00
Eric House
3174705d63 gtk: remove assertion failure creating new games
I think this was related to changing the order in which save operations
happen and that it's no longer valid to insist that there already be a
rowid at this point, but could be wrong....
2016-09-26 08:24:47 -07:00
Eric House
e07686491c gtk: summarize before saving
Fixes problem with list view always being a move behind, since it's
saving not summarizing that was triggering the refresh, but summarizing
that added the data from which refresh/list view drew.
2016-09-20 08:27:17 -07:00
Eric House
5742c5cb12 gtk: save game on every turn change
Idea is to have the games list stay in sync, but in fact it stays one
move behind, at least in a typical standalone human-vs-robot game. So
this is incomplete.
2016-09-19 09:12:23 -07:00
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