Commit graph

10246 commits

Author SHA1 Message Date
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
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
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
Eric House
d2897d6dc8 fix to match format of empty return case 2017-10-30 19:06:38 -07:00
Eric House
8ee17493ac log length of task lifetime
Need to figure out where the delays are.
2017-10-30 07:12:34 -07:00
Eric House
3d3a986dbd log count of tasks abandoned in queue on shutdown
This confirms that I need to process outgoing messages more quickly,
likely by combining them.
2017-10-29 09:46:51 -07:00
Eric House
1373d0b1db make min-run configurable
With the new http stuff, at least for now, it takes longer to get things
communicated and so killing games after 2 seconds of runtime meant no
moves ever got made. Making it configurable, and passing 10 (seconds)
means nearly all games in a large test run complete reasonably quickly.
2017-10-29 09:26:07 -07:00
Eric House
7b50c90aac pass timeoutSeconds
ACK doesn't need to wait 2 seconds for a reply, and when it does so the
next send waits too. Eventually we'll want to combine messages already
in the queue into a single send. For now, this makes things better.
2017-10-28 20:12:05 -07:00
Eric House
7c22d1fdf8 fix failure of http apps to ack relay
Change how acks are handled by adding ability to look up connname by
combination of hid and token. It's a bit of a hack, but it's already
there in the protocol and enough to find the game.
2017-10-28 16:29:04 -07: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
7d4fb1cc5d get rid of last [] from map access 2017-10-28 15:36:33 -07:00
Eric House
3215affd68 tweaks to test script 2017-10-28 15:31:17 -07:00
Eric House
e3b2a0e4e1 fix misbehavior by new in-memory map
I don't know why what I was doing didn't work, but removing access via
[] and using iterators passes all the asserts I could throw at it.
2017-10-28 15:01:31 -07:00
Eric House
952272172a always log bytes sent 2017-10-27 05:58:35 -07:00
Eric House
a8f06b53e2 test script; log threadid 2017-10-27 05:57:40 -07:00
Eric House
3645331061 pass hid in to db function getting per-dev info
Somehow I've been failing to treat this column as an array for some
time. I don't have any test cases that failed but it was clearly
wrong. Test cases still pass....
2017-10-25 20:33:25 -07:00
Eric House
051b6a7220 change resign-ratio to resign-pct
To match the way other pct stuff works, in part because it seemed it
didn't.
2017-10-25 20:00:55 -07:00
Eric House
6e06fdea07 stop storing cid in database
It's a runtime-only thing, explicitly removed from db on boot. So add a
map from connname->cid to the dbmgr class and modify that rather than a
column. Passes discon_ok2.sh tests as long as use-http stuff isn't on.
2017-10-25 19:56:56 -07:00
Eric House
14d9063ad0 add --room to error message/hint 2017-10-25 06:43:10 -07:00
Eric House
81df91c4db add commandline option to spec log dir location 2017-10-25 06:34:55 -07:00
Eric House
d05a67ed4b switch to milliseconds 2017-10-25 06:15:46 -07:00
Eric House
cc54621e45 store message first, remove on ack 2017-10-25 05:51:45 -07:00
Eric House
c68a067009 add option to not check moves except manually 2017-10-24 19:18:19 -07:00
Eric House
6ff13e6e23 move 'check moves' menu to main window 2017-10-24 19:14:23 -07:00
Eric House
342d229be1 refactor 2017-10-24 07:07:22 -07:00
Eric House
28bec6d456 implement checkForMoves menu again 2017-10-24 06:20:08 -07:00
Eric House
2cfac68f91 leave out entries without relayIDs
SQL is the easiest place to filter
2017-10-23 21:08:14 -07:00
Eric House
c3887b9c77 use a single thread and a protected queue
I don't want race conditions between threads talking to the server.
2017-10-23 21:07:05 -07:00
Eric House
6787fe1406 fix length byte 2017-10-22 21:29:16 -07:00
Eric House
4583b5d88d use ! with struct instead of ntohs 2017-10-22 15:47:01 -07:00
Eric House
4c15723f90 add http option to test script 2017-10-22 11:43:56 -07:00