Commit graph

518 commits

Author SHA1 Message Date
Eric House
63d3f70cdf more changes to storage and fetching of messages and to protocol so
presence of messages is reported on connect (as are bad relayIDs).
Now a game with a robot player in a "closed" game can continue.  Once
the next set of linux-side chances is committed.
2013-01-19 14:34:04 -08:00
Eric House
99307e45a0 queue incoming packets and process them in order in a separate thread 2013-01-18 19:56:21 -08:00
Eric House
c999bbae92 always test those last-minute pre-checkin cleanups 2013-01-18 07:22:56 -08:00
Eric House
3984d85795 oops -- prev checkin didn't compile 2013-01-18 07:12:26 -08:00
Eric House
1c5fef6a38 relay improvements for UDP connection: record addresses, prepare to
run in separate thread, etc.
2013-01-18 07:10:47 -08:00
Eric House
932778f700 stubbed-out thread manager for udp connection 2013-01-18 06:57:57 -08:00
Eric House
7fec736947 add udp socket and protocol for use over it so that a device can
manage a single connection to the relay for all of its games.  Works
so far to the extent that the game's playable with all boards on the
same device (with checkins about to come) as long as all boards are
open.  (Client doesn't handle opening closed games yet.)
2013-01-15 18:41:17 -08:00
Eric House
5a51af489a Merge branch 'android_branch' into gtk_multigame 2013-01-13 10:41:14 -08:00
Eric House
dc0cfdf001 bug in recent changes: need to mark socket unused to avoid double removal 2013-01-13 10:37:47 -08:00
Eric House
98679c8363 cleanup: better encapsulation for AddrInfo 2013-01-13 10:14:06 -08:00
Eric House
c567647a8d get rid of mapping of socket->game_connection, which will not work
once UDP sockets and/or per-device (not per-game) connections come
along.  Lots of changes, most not involving code flow but a couple
that did.  So far two gtk games can connect and exchange moves.
Haven't tested reconnection or store-and-forward.
2013-01-12 16:09:24 -08:00
Eric House
33735ae7a5 Merge branch 'android_branch' into gtk_multigame 2013-01-11 20:48:44 -08:00
Eric House
b46df07237 Merge remote branch 'origin/android_branch' into android_branch 2013-01-11 20:48:04 -08:00
Eric House
6dcd7022d4 don't pass .css file in; it's ignored 2013-01-11 20:42:57 -08:00
Eric House
55514719be include thread ptr in hung threads logging; assert (restart) when hung for too long 2013-01-11 20:42:04 -08:00
Eric House
39d12d088a use usleep when waiting for cref to be available 2013-01-11 20:37:08 -08:00
Eric House
aed2b6135c Merge branch 'android_branch' into gtk_multigame 2013-01-10 21:10:48 -08:00
Eric House
2ccc297463 make number of sockets at which we assert/reboot configurable so tests
can be done with large numbers of clients.
2013-01-10 21:10:18 -08:00
Eric House
7437a71aa6 use string_printf 2013-01-09 06:29:12 -08:00
Eric House
f827bebf80 ignore .pyc file 2013-01-02 21:13:36 -08:00
Eric House
ad78129e74 changes made over the past couple of months toward tracking an
apparent thread leak.
2013-01-02 21:12:42 -08:00
Eric House
d34ac1f86d rewrite to work without gcm library (whose lack of support for some
documented params makes it impossible to try using them)
2013-01-02 21:08:10 -08:00
Eric House
e920fbcaff unregister (flag in db) devids google says are unregistered 2012-12-01 11:55:16 -08:00
Eric House
2859ec9132 stime is the name of the column in actual use 2012-12-01 10:31:55 -08:00
Eric House
618d8530f2 some changes accumulated as script was running 2012-12-01 10:27:02 -08:00
Eric House
4dddd2da42 some changes accumulated as script was running 2012-12-01 10:26:00 -08:00
Eric House
e16245d19e include new column 2012-12-01 09:33:38 -08:00
Eric House
694857dd4e add, but disable with compile flags, ability to mark sent messages
with a timestamp rather than delete them.  Plan is to experiement with
this as a way of keeping devices from sending too many identical
messages when GCM's in use -- since constraints on the msgs table will
not allow identical messages to be added.
2012-11-15 06:25:22 -08:00
Eric House
c847ec127e add and use function that does formatted printing to a std::string so
query buffers can no longer overflow.
2012-11-15 06:15:44 -08:00
Eric House
c4f5b4522e minor printing tweaks 2012-11-13 07:17:56 -08:00
Eric House
6a85661095 lots of improvements: make useful for testing with non-android clients; shelve backoff data, etc. 2012-11-10 19:31:22 -08:00
Eric House
1316ae4b67 Fix relay devid protocol to deal with case where client submits a
ID_TYPE_RELAY id that's not in the devices table (as has happened when
a device switches relay URLs during testing, but might also happen if
I have to delete an entry from the devices table.)  In that case,
return ID_TYPE_NONE to the client, which will be its clue to delete
its ID_TYPE_RELAY id and submit the platform-specific id again.

Note: android won't compile this revision thanks to util.h change
2012-11-10 15:05:44 -08:00
Eric House
f1ee77882b Send devid with RECONN as well as CONN so games present when device
upgrades can also use GCM.  Tested on relay but not device.
2012-11-09 06:54:12 -08:00
Eric House
2df4199a77 test script for messaging devices 2012-11-08 06:13:01 -08:00
Eric House
af89047969 treat an empty devID string as TYPE_NONE regardless of what the client claims. 2012-11-07 22:03:58 -08:00
Eric House
e6cd2265df fix crash: make formatParams work with empty strings 2012-11-07 21:57:18 -08:00
Eric House
83754d626e add backoff for resending for messages still not removed from msgs table 2012-11-07 08:05:45 -08:00
Eric House
45d0b2dbc8 various improvements, including printing a period on every loop when
there's no work to do.  All that remains is backoff.
2012-11-07 07:31:52 -08:00
Eric House
8516dca1cb what I really meant to check in 2012-11-07 06:23:20 -08:00
Eric House
9b48523ff3 fix to work with new DB scheme and to send json client now expects 2012-11-07 06:17:33 -08:00
Eric House
2c339ed7a5 fix to work with new devid/table scheme 2012-11-06 07:25:38 -08:00
Eric House
9ad28908bb assert enum within range 2012-11-06 07:07:14 -08:00
Eric House
03108f311a Merge branch 'android_branch' into android_gcm 2012-11-05 06:14:21 -08:00
Eric House
59937b8514 modify how devids are handled on the relay and the protocol through
which they're communicated to the device.  Device is expected to have
a platform-specific notion of ID which the relay stores in a new
devices table and indexes with a 32-bit number which is returned to
the device -- which is encouraged but not required to use it in lieu
of the longer ID in future communications.  Modify linux client and
test script to use the relay-supplied id.  Some of this is commented
out for now.
2012-11-03 10:58:01 -07:00
Eric House
fe819982da Merge remote-tracking branch 'origin/android_branch' into android_gcm 2012-10-31 07:44:16 -07:00
Eric House
3d6a170921 python script to check relay and invoke GCM to notify recipients 2012-10-31 07:20:40 -07:00
Eric House
d97c057b8c Merge branch 'android_branch' into android_gcm 2012-10-31 06:33:54 -07:00
Eric House
1cae4e9a4c increase buffer size, and test rather than assert for overflow. Fixes
crash with new large GCM devids.
2012-10-31 06:12:24 -07:00
Eric House
6014e3d76f turn on devid code and implement support in java. Untested, but should work. 2012-10-30 07:57:17 -07:00
Eric House
3469975d2a add, still disabled by compile-time flags, code to transmit device ID
(e.g. ID Android devices get via GCM) to relay and to associate it
there with messages that need to be delivered.
2012-10-30 07:01:47 -07:00