Commit graph

249 commits

Author SHA1 Message Date
Eric House
da639af7c3 change what must be a mistaken assert 2020-08-25 08:25:44 -07:00
katianderic
c7c1946793 use deviceID to invite via relay; make 3- and 4-device games work 2020-02-16 19:12:22 -08:00
Eric House
d6cf1d2f95 add comment about work needing doing 2020-01-11 20:44:12 -08:00
Eric House
0be3bb192d Wait for ACK to remove stored message
Bringing in a change that's been on the production relay for a while but
apparently didn't pass tests locally. Now it does.
2019-03-17 11:52:48 -07:00
Eric House
ce2ec03d3e relay tracks variantCode int, not string 2019-03-07 18:12:26 -08:00
Eric House
a14b43bba0 communicate variant to relay, and store in new column 2019-01-27 06:31:21 -08:00
Eric House
89f4246e83 track and log types of (un-acked) messages 2018-05-24 21:03:25 -07:00
Eric House
40ce484a92 fix mistaken and very broken commit
(Fortunately I never ran a relay with this in it!)
2018-05-21 21:19:25 -07:00
Eric House
1b71198d4e add valgrind option to test script 2018-04-14 10:48:20 -07:00
Eric House
74406c9bba on failure, don't log what looks like success 2018-03-09 06:45:21 -08:00
Eric House
61993fc079 add tests to the rest of the forever loops 2018-02-26 07:03:47 -08:00
Eric House
811c8f535e add socket refcounting
AddrInfo now has ref()/unref() and keeps a global socket->refcount map
(since actual AddrInfo instances come and go.) When the
count drops to 0, the existing CloseSocket() method is called. This
seems to fix a bunch of race conditions that had a socket being closed
and reused while old code was still expecting to write to the device
attached to the socket the first time (along with lots of calls to close()
already-closed sockets, attempts to write() to closed sockets, etc.)
2017-12-07 07:18:09 -08:00
Eric House
dbf38f7759 don't use mlock in config; don't close socket
Use of mutex logging recurses infinitely if config uses mlock, so remove
that. And don't free sockets after handling their messages as they may
be in use elsewhere. This likely introduces a leak of sockets.
2017-12-06 19:11:32 -08:00
Eric House
70dea02efc cleanup; fix possible socket drop
Haven't seen it happen, but I think there was a bug that could have led
to all the sockets coming back as ready from poll() being dropped. Fixed
that and added/cleaned up some logging.
2017-12-04 20:40:44 -08:00
Eric House
d5c4ecabce rename class; add some logging
Rename class that's no longer just about UDP as it began. Add a bit of
logging. This commit *should* not change behavior at all.
2017-12-03 19:18:36 -08:00
Eric House
e485af925f log milliseconds: seconds not enough. 2017-12-03 16:07:30 -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
bd4ddb0adf name change 2017-11-11 15:26:09 -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
23f0d54f63 tweaks: add comment; show only pending messages 2017-10-30 19:07:13 -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
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
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
cc54621e45 store message first, remove on ack 2017-10-25 05:51:45 -07:00
Eric House
37ecd81c04 change param names
about to introduce a second. This will make things clearer. No code
change here though.
2017-10-10 20:17:36 -07:00
Eric House
2a3bd60740 supply missing param 2015-12-08 07:15:26 -08:00
Eric House
d468866a01 no more variables called socket; all are "sock" now. 2015-11-20 23:15:04 -08:00
Eric House
67f4e4475c manual bring-over of relay changes for invite support 2015-07-11 08:08:22 -07:00
Relay User
8f863f0369 Make it possible to launch relay early in machine boot cycle before
postgres is running (e.g. from a @reboot shortcut in a crontab) by
having it wait, sleeping periodically, until a connection is
available. Requires new flag be passed into main.
2015-07-11 07:04:24 -07:00
Eric House
dba86a657f add and handle new INVITE message types. (This can safely be added to shipping relay.) 2015-07-10 23:25:06 -07:00
Eric House
6fe0940187 don't log normal case as error 2015-02-20 07:52:19 -08:00
Eric House
c70fcf64a7 ignore client index of 0, since it means the device needs a slot
assigned.
2014-12-08 06:22:30 -08:00
Eric House
b8660470f7 include timestamp in "new day" post-crash line 2014-12-05 06:35:31 -08:00
Eric House
9ba9d258f3 If client provides its index, honor that when placing it in game. This
allows a game where indices have already been established over some
transport other than relay to start using the relay mid-game.
2014-12-04 06:03:42 -08:00
Eric House
f3828ab7c9 merge android_branch -> android_multi2 2014-11-22 17:15:22 -08:00
Eric House
4b635791d7 crash fix: provide missing param to format string 2014-11-22 17:08:17 -08:00
Eric House
68e7f303b0 oops -- here's the relay md5sum logging. app side went in prior. 2014-11-05 21:42:45 -08:00
Eric House
4de894627a fix infinite loop -- duh 2014-04-18 06:01:03 -07:00
Eric House
0e4f24dfe9 use fixed string for model rather than clearing it 2014-04-17 08:24:09 -07:00
Eric House
6f0b5c1bea empty the model string if the client version's lower than what I'm
about to release and there's non-ascii stuff in it.
2014-04-17 08:13:01 -07:00
Eric House
f05b1e0525 log model -- can remove later 2014-04-17 07:44:32 -07:00
Eric House
27a5990283 log out-of-date token 2014-02-24 08:00:52 -08:00
Eric House
b43855a313 fix curses build for 64bit compile and to use common layout (meaning
tray is now under the board unstead of to the right).  Works on 64-bit
system at least for non-networked games.
2014-01-05 13:04:59 -08:00
Eric House
b3723897d5 to prevent duplicate UDP packets (I hope), bind the UDP socket to a
single ip address rather than INADDR_ANY.  Get that address at runtime
for an interface provided in the config file.
2013-09-30 23:40:12 -07:00
Eric House
4202f24091 don't allow reregister with a RELAY_ID (a client bug) 2013-09-26 08:37:21 -07:00
Eric House
657d0d2b1f -l - means log to stderr 2013-09-15 10:04:45 -07:00
Eric House
2629c07256 Address problem with devids (e.g. GCM): until now when you got a new
devid you tossed your relayID and reregistered.  Which meant any
existing messages meant for your relayID were orphaned, and any open
games didn't know who they belonged to until you reconnected to them
with your new relayID.  So: modify the UDP protocol (though not on
Android yet) to include both relayID and devid with registration, with
one or the other an empty string if not present or not changed from
earlier.  I can't fix existing clients that are dropping their
relayIDs, but when one does a re-connect without a relayID I can look
it up from the existing game record, then reuse it rather than issue a
new one.  Better than nothing -- and that protocol will be obsolete
soon anyway.
2013-09-14 21:06:14 -07:00
Eric House
c115752852 supply in linux client, and look for and store on relay, os version 2013-09-07 16:17:31 -07:00
Eric House
032f8c1f99 add ctrl port command to post UPGRADE message to clients 2013-09-03 06:52:02 -07:00
Eric House
8da0b73744 replace string_printf() with new class derived from std::string with
printf() method.
2013-09-02 13:17:42 -07:00