Commit graph

92 commits

Author SHA1 Message Date
Eric House
b9c6551e8b merge android_branch changes to comms_make
Not tested at all on android
2022-11-18 11:09:22 -08:00
Eric House
8c335aace3 fix crash on shutdown (post-relay world) 2022-05-28 08:49:07 -07:00
Eric House
d17ac7ea0b rename gamesdb public functions (linux only) 2020-09-26 09:48:35 -07:00
Eric House
eb9ef738e4 remove comms/transport from using thread->env map 2020-04-26 13:39:21 -07:00
Eric House
87802150d5 fix logging macro to allow a single argument 2020-04-10 07:12:56 -07:00
katianderic
b1bd506e22 harvest relaydevid (for use in invitations later) 2020-02-16 19:12:21 -08:00
eehouse111999
845370c9ca cleanup and fix test script stalls
Old code always had client trying to connect. So do that here
too. Seems to fix test script stalling.
2020-02-07 23:11:20 -08:00
Eric House
03faeecd0b add new log macro that includes file name and function 2020-02-02 15:29:14 -08:00
Eric House
598be04bef make curses app more like the rest
Lots of changes adding a games-list view to the app from which you
create new games, open and delete existing ones, etc. There's still
plenty that's unimplemented, but it's already more useful for testing
and development. Which is the point.
2020-01-24 09:05:16 -08:00
Eric House
68890cdf86 don't pass relayDevID unless inviting using relay
And do some cleanup to make things more clear
2020-01-08 11:20:51 -08:00
Eric House
ce2ec03d3e relay tracks variantCode int, not string 2019-03-07 18:12:26 -08:00
Eric House
15a2897112 Revert "toward compiling with gcc8"
This reverts commit d293517e7c.
2019-01-29 09:05:54 -08:00
Eric House
d293517e7c toward compiling with gcc8
My VSIZE is no longer legal, and apparently there's no workaround (no
way to safely figure the length of an array whose size is known at
compile time.) To avoid the risk of duplicating little constants, added
macros that define length in a way a new VSIZE can pick it up. Couldn't
make that work for struct field arrays, however, so there I'm using
constants.
2019-01-28 17:24:53 -08:00
Eric House
a14b43bba0 communicate variant to relay, and store in new column 2019-01-27 06:31:21 -08:00
Eric House
d70b089835 use mem_stream_make_raw() where possible in linux code 2018-06-27 23:37:28 -07:00
Eric House
1821d197b9 fix to compile on 32-bit system 2018-05-23 19:48:30 -07:00
Eric House
4504302b3b make "release" builds compile again
Release isn't really a thing on linux, but I'm fixing something that
only reproduces when DEBUG is undefined.
2018-02-18 11:30:54 -08:00
Eric House
243eb213bb make reply messages a param within result
Makes it easier to debug by adding stuff on the relay end
2017-12-06 18:57:48 -08:00
Eric House
768b63df24 move free() after last use of ptr 2017-11-15 05:48:45 -08:00
Eric House
033ceab9d1 log outgoing params 2017-11-13 07:26:47 -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
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
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
24171d8317 log more about tasks 2017-11-02 07:16:51 -07:00
Eric House
55f5b500e3 cleanup: method names and logging 2017-11-02 06:19:35 -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
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
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
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
952272172a always log bytes sent 2017-10-27 05:58:35 -07:00
Eric House
d05a67ed4b switch to milliseconds 2017-10-25 06:15:46 -07:00
Eric House
c68a067009 add option to not check moves except manually 2017-10-24 19:18:19 -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
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
16ee3e9439 rename and make self-initing 2017-10-22 10:05:36 -07:00
Eric House
523fd26eee make relay hostname configurable 2017-10-22 09:58:01 -07:00
Eric House
f49c81462c wip: received messages dispatched to games 2017-10-22 09:29:15 -07:00
Eric House
43ffb156fc wip: successfully get list of moves 2017-10-22 07:30:14 -07:00
Eric House
47a048d553 fetch relayIDs from db 2017-10-21 16:05:54 -07:00
Eric House
a65af79953 add check for being on main thread 2017-10-21 15:23:46 -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
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