Commit graph

10489 commits

Author SHA1 Message Date
Eric House
607567cd35 don't allow duplicate group names
If group already exists, warn rather than create another with the same
name.
2017-11-12 22:50:45 -08:00
Eric House
c2eff7d3f2 add "archive" option to dialog on opening done game
Create the group if needed. Name's not user-editable at this
point. Should be a preference, and that preference should be changed if
user renames it.
2017-11-12 22:31:48 -08:00
Eric House
b77ea0aaad copied from relay_via_http branch
(was at: ./xwords4/android/scripts/relay.py) This is the web API clients
can use to talk to the relay.
2017-11-12 20:29:15 -08:00
Eric House
f072c68bf9 bring in changes from relay_via_http branch
It's time to make them live so client development can use a live relay,
and all the old tests pass, so why not.
2017-11-12 20:25:29 -08:00
Eric House
35d172225f Use AtomicInteger rather than synchronization 2017-11-12 20:10:51 -08:00
Eric House
373c0249bc start backoff timer at 5 second, not 30.
Makes the http case nearly as quick as the udp one when both games are
on the same device. Which is all I've tested so far.
2017-11-12 20:04:22 -08:00
Eric House
fb4f44b0fc remove mistaken assert
I'm not quite sure why it was firing, but the pattern of a FindGame
failing due to a race condition and requiring a retry exists elsewhere
in the code. Lots of tests pass once this change is made. :-)
2017-11-12 19:59:20 -08:00
Eric House
8650795a81 don't crash when can't reach relay via http 2017-11-12 08:53:19 -08:00
Eric House
ec075eff18 comment out assertion that's firing when db wiped 2017-11-11 18:49:23 -08:00
Eric House
5bd71ba7c5 put cids back into the database
The hack I came up with for storing them in memory isn't working. Even
if it's just that I don't understand C++ maps they need to be cleared
when the DB's wiped (my favorite test these days) and I don't want to
spend the time now.
2017-11-11 18:46:02 -08:00
Eric House
057728c287 make gtk include an invite ID in rematch invitations
otherwise Android refuses to accept the second "" it receives.
2017-11-11 16:39:09 -08:00
Eric House
cb87a849ab rename dict symlink
It breaks rematch that "dict" is being passed to the Android client from
the linux side, and this is easier than figuring out how and when to
dereference the link.
2017-11-11 16:12:06 -08:00
Eric House
fa52c5091a fix tap down lower not opening game
Making the right_side elem match its parent height prevents the
lower-right region of game list items from falling through and
triggering a toggle-selection event.
2017-11-11 15:45:00 -08:00
Eric House
39deeeb089 fix tap down lower not opening game
Making the right_side elem match its parent height prevents the
lower-right region of game list items from falling through and
triggering a toggle-selection event.
2017-11-11 15:43:07 -08:00
Eric House
3da5f237c6 add asserts to catch non-web holdouts; don't crash
Getting nulls when e.g. the relay isn't up. Shouldn't crash in that
case.
2017-11-11 15:31:36 -08:00
Eric House
bd4ddb0adf name change 2017-11-11 15:26:09 -08:00
Eric House
878875dd34 revert DB changes -- don't need 'em now
It'll be a lot easier moving the relay forward if I can not change the
DB.
2017-11-11 13:26:44 -08:00
Eric House
c2d5f2d253 cleanup 2017-11-11 13:05:25 -08:00
Eric House
e2c6480992 fix linux client
everything takes one param now, and post sends an array
2017-11-11 12:57:33 -08:00
Eric House
f428538afc send an array of packets to post()
Somethimes there are several on the queue, so why not send all at
once. Note: this will break the linux implementation which I'll fix next.
2017-11-11 10:47:26 -08:00
Eric House
b9800b22f5 RelayService uses web instead of UDP!
As expected, moves are no longer received instantly because the UDP
socket isn't available for the relay to write too once the URL
handler (relay.py) finishes.
2017-11-11 09:56:20 -08:00
Eric House
4a3133924a name change for clarity 2017-11-11 09:14:35 -08:00
Eric House
0831bd8022 talk to relay.py/kill, first web api use from android
And it seems to work!
2017-11-11 08:22:52 -08:00
Eric House
31123b72ce fix failure to notify relay of half-game deletion
Wasn't detecting as a relay game something registered on relay but not
yet joined by another device, a common case!
2017-11-11 08:13:29 -08:00
Eric House
da3f6db9e4 fix failure to notify relay of half-game deletion
Wasn't detecting as a relay game something registered on relay but not
yet joined by another device, a common case!
2017-11-11 08:10:48 -08:00
Eric House
acf668ae8a add new prefs controlling web api usage
Add, but don't use yet, prefs giving relay.py path and checkbox whether
to use the new APIs.
2017-11-10 22:16:15 -08:00
Eric House
f2c4c82129 a shot at no-conn connecting
Ideally the comms module wouldn't go through its connecting routine in
order to join a game. To that end I added a join() method to relay.py
and code to call it. Joins happen (pairing games, starting new ones,
etc.), but after that communication doesn't. First part of fixing that
would be to make cookieID persistent and transmit it back with the rest
of what join sends (since it's used by all the messages currently sent
in a connected state), but I suspect there's more to be done, and even
that requires a fair number of changes on the relay side. So all that's
wrapped in #ifdef RELAY_VIA_HTTP (and turned off.)
2017-11-10 21:34:02 -08:00
Eric House
ecc247d56d fix a couple of obvious bugs 2017-11-10 20:30:25 -08:00
Eric House
d1e6a0d1d3 fix seed comparison: ints vs strings
Was coming in as a string when called via curl. This may be a problem
for other ints if I go with lots of params instead of a json, which is
looking less likely.
2017-11-09 06:47:33 -08:00
Eric House
d0dd7a2c02 new columns required by relay.py's join() 2017-11-08 08:07:47 -08:00
Eric House
205adf0d0f add prototype of join()
join's how devices will create or join existing games. It more
compilicated than I'd like but seems to work except that once a slot's
assigned it's unavailable to anybody else even if the other fails ever
to respond (i.e. needs the ACK function of the c++ relay.)
2017-11-08 08:04:57 -08:00
Eric House
6c8b9d5277 fix query syntax: % operator bad 2017-11-07 07:34:06 -08:00
Eric House
c661c8a74e basic join() (inserting/updating game records) works 2017-11-07 07:33:04 -08:00
Eric House
e6acd0fbcc beginnings of new relay: shows persistence
Mostly comments, it's where I'll start to think about the API for a
web-app version of the relay. The server itself ought to exist
already.
2017-11-05 19:24:41 -08:00
Eric House
02f05dc867 fix to compile with UDP packet logged
to match up with delivery on client
2017-11-04 09:27:33 -07:00
Eric House
7efcdf0cb8 script for tracking message delivery
The http-based comms flow is stalling. This will help figure out why.
2017-11-04 09:27:33 -07:00
Eric House
1648c9b3e3 tweak to start GTK games and run a long time
I'm trying to fix game-start-time right now....
2017-11-04 09:27:33 -07:00
Eric House
3a2953427a combine adjacent QUERY tasks
Trying to reduce the size of the queue. Eventually the lists of relayIDs
will need to be merged.
2017-11-04 09:27:33 -07:00
Eric House
c4312a2158 new files that may replace GSList in relaycon
If I want to move relaycon into common so Android can use it (assuming
the jni code starts including json-c and libcurl so it can handle
networking) I'll need a replacement for GSList. This is a start.
2017-11-04 09:27:33 -07:00
Eric House
9f5f5da29c add more required debs 2017-11-03 18:07:12 -07:00
Eric House
24171d8317 log more about tasks 2017-11-02 07:16:51 -07:00
Eric House
3dfd419ec7 relay returning NOTHING is a thing; deal with it 2017-11-02 07:16:11 -07:00
Eric House
55f5b500e3 cleanup: method names and logging 2017-11-02 06:19:35 -07:00
Eric House
d6f22d55c5 add g++ to required debs 2017-11-01 06:53:34 -07:00
Eric House
66d6240ece better git revision fallback 2017-11-01 06:12:04 -07:00
Eric House
220918e5cd fix to compile with gdk3.2 (latest Debian) 2017-11-01 05:16:32 -07:00
Eric House
61937ac2d0 use float consistently
timeout of 0 was not making the relay.py script happy
2017-10-31 20:07:12 -07:00
Eric House
a1433e5f3d add kill to relay.py; call from test script using curl
It'll eventually get called from Android and maybe linux, but for now
it's cool to have games disappear from the showinplay display when
they're done.
2017-10-31 20:05:07 -07:00
Eric House
8aeba861cf fix script to move db files again 2017-10-31 06:38:32 -07:00
Eric House
23f0d54f63 tweaks: add comment; show only pending messages 2017-10-30 19:07:13 -07:00