Eric House
b7dfc169bf
add commented-out mutex protecting comms. I don't think I need it, but
...
this makes it easier to put back if comms->processingMsg assertions
start failing.
2015-02-08 10:37:06 -08:00
Eric House
c6b42c539c
add assert to ensure there are no thread issues: mutex may be required
...
if the assert winds up getting hit.
2015-02-08 07:51:08 -08:00
Eric House
17307f910b
fix problem with misdelivered message forever locking out future
...
messages: when comms thinks a message is an init but server drops it,
give comms that info so it can remove it and give the next one a
chance.
2015-02-07 13:24:09 -08:00
Eric House
a49e732371
remove logging
2015-01-12 06:26:03 -08:00
Eric House
4701fe2b90
pass in number of devices already connected so forceChannel can be set
...
more correctly; put up alert when device rejects an invitation as a
duplicate.
2015-01-03 09:50:07 -08:00
Eric House
28bfa3c904
make forceChannel part of CurGameInfo rather than comms, since Android
...
needs to save it there on receipt of an invitation (doesn't create
full game with comms until later.) Passes discon2 tests and seems to
work on a single Android device. (Haven't tested inviting on Android
yet.)
2014-12-29 07:39:28 -08:00
Eric House
e961756f12
give up on hard-coding size of thread->env map: expand it as needed.
2014-12-08 20:43:24 -08:00
Eric House
c8e55a85a3
use a constant; log a bit more for now
2014-12-02 06:08:58 -08:00
Eric House
fe76cfa1a1
remove logging
2014-11-26 07:21:27 -08:00
Eric House
9bdf9b2f5e
pass conType into java world from jni send proc, eliminating loops
...
e.g. sending relay setup traffic over BT.
2014-11-26 07:18:29 -08:00
Eric House
938756a34f
switch for loop to using C99-style variable declarations; no other change
2014-11-25 06:09:18 -08:00
Eric House
67d41f34a3
remove loggin
2014-11-21 07:58:17 -08:00
Eric House
fbea67e479
don't kill relay when bluetooth turned off: pass comms type into
...
comms_transportFailed()
2014-11-20 07:12:25 -08:00
Eric House
e236a32c20
forgot a mutex
2014-11-20 06:04:11 -08:00
Eric House
56121fdcd4
stop (or at least greatly reduce) leakage of thread->env mappings in
...
jni, mostly by having jnithread explicitly announce that it's closing.
Yuck. This stuff *should* obey a stacking protocol but the callback
stuff I'm doing makes me unsure that can work.
2014-11-19 21:42:21 -08:00
Eric House
1962371fe2
flesh out MultiMsgSink so that subclasses invoked e.g. in response to
...
BT traffic can send messages via other means as well. Relay games
with both participants on one device work again.
2014-11-19 18:46:35 -08:00
Eric House
7a1cd06486
fix crash in dict iteration: add to thread map the env that creates globals
2014-10-23 07:44:41 -07:00
Eric House
3fe3b1724a
replace stacked tracking of env with explicit mapping from pthread to
...
env for that thread to fix occasional assertion failure that indicated
I was using the wrong env occasionally. I'm not super confident in
this because I've seen the env for a thread change, but that could be
due to reuse of the thread id.
2014-10-22 06:58:42 -07:00
Eric House
2e74b97b4a
oops: set typeset field in java struct
2014-10-17 07:46:32 -07:00
Eric House
878a16b3bc
snapshot: android compiles, and works well enough to exchange moves
...
via relay! Lots of changes, mostly around treating connTypes as a Set
inside the java world. Jni to translate to that is a pain.
2014-10-16 06:45:24 -07:00
Eric House
215cbe94ba
turn on -std=c99
2014-10-15 21:43:34 -07:00
Eric House
fa3a2c1c5e
don't crash if somehow a game gets opened without a dict
2014-09-30 21:20:47 -07:00
Eric House
6f07098cf3
return succes from server_initClientConnection()
2014-09-14 13:42:11 -07:00
Eric House
172d01137a
copy stuff required to make main app support BT
2014-09-11 20:42:15 -07:00
Eric House
88248131da
show new client-formatted turn summary in notification; remove old
...
common-formatting code.
2014-08-26 21:37:33 -07:00
Eric House
2d08848715
snapshot: toward having a better description of the last move in
...
notifications.
2014-08-26 06:55:26 -07:00
Eric House
a902bdcbad
limit width of scoreboard too
2014-07-17 21:31:17 -07:00
Eric House
d51a5e67f0
fix for super-wide screen: tiles are never wider than tall. Next:
...
scoreboard.
2014-07-17 08:01:00 -07:00
Eric House
ddd1ef70b6
prevent games reset at the same time from all having the same seed by
...
passing rand()'s seed from java world rather than using current
seconds.
2014-07-15 07:32:57 -07:00
Eric House
dee75f5a0a
don't ref dicts from dmgr_get()
2014-03-10 21:50:06 -07:00
Eric House
f601f2bf57
use dictmgr in java. This requires jni globals that live across boards being opened and that include a mempool dicts will be allocated out of. Seems to work, and to get ref counts as high as 6 or so before they drop down to one when all boards are closed. (The final is held by the dictmgr which won't give it up until the app itself is GC'd)
2014-03-10 19:14:59 -07:00
Eric House
a2671f5ef0
add global mempool that can survive individual games, and include it every game's globals. Use it instead of game's mempool to create dictionaries so they can outlive a game and not trip asserts on pool delete. Wrap dicts in a java class that refcounts them when BoardCanvas wants to keep one so that, I hope, the bug using a deleted dict will go away.
2014-03-09 14:46:33 -07:00
Eric House
9d9c822bb8
save, commented out, how to call the contstructor of a nested class -- in case I go back to doing things that way.
2014-03-09 14:23:24 -07:00
Eric House
a7c114e3f9
refcount dicts. Model "owns" its copy and so increments the refcount when gaining one and decrements the count on any being replaced (and on all on exit). This is setting up the real change, which is to let the java world wrap dicts in objects that hang onto them until they're destroyed, which should fix problems where dicts are referenced after they've been destroyed.
2014-03-08 20:57:27 -08:00
Eric House
9d174740c8
don't show "send pending messages" menuitem when there are none
2014-03-01 16:15:35 -08:00
Eric House
c1e22dd3cf
add summary DB column and jni code to fetch it to store and display number of unacked messages a game has. And add debug-only option to display it in the main list. In the future I want to be able to iterate over all these games and resend their packets (without opening them visually) when an internet connection comes back up.
2014-02-28 18:59:12 -08:00
Eric House
29d08b95ce
expose comms_getStats() via a debug-build-only menu and dialog
2014-02-26 21:41:49 -08:00
Eric House
339e784d7c
fix compile warnings
2014-02-10 18:23:03 -08:00
Eric House
b29dcb1d2c
add debug-only logging toward figuring out occasional bad-dict crash
2014-01-31 07:55:07 -08:00
Eric House
57cd547078
remove apparently gratuitous second call to srandom
2014-01-31 07:54:43 -08:00
Eric House
1b185d1575
use ccache for jni if present
2014-01-21 07:20:51 -08:00
Eric House
e34cc9007d
fix problems with opening and using wordlists on 64-bit linux by
...
making XP_U32 32 rather than 64 bits. Duh. Do same on Android jni just
in case.
2014-01-07 06:58:20 -08:00
Eric House
b5d6c513a6
add canUndo to GameStateInfo and use to hide the undo menu
2013-12-03 07:06:48 -08:00
Eric House
94216a5fb9
add canTrade to GameStateInfo, pass through to java world, and use to
...
determine whether to show trade menuitem
2013-12-01 21:53:41 -08:00
Eric House
9b6f8d18e0
fix timer: don't reinit secondsUsed to 0 every time game loaded
2013-12-01 19:04:44 -08:00
Eric House
08b72bbc55
add asserts
2013-11-29 07:35:13 -08:00
Eric House
11bde2b7fd
remove logging
2013-11-27 07:10:08 -08:00
Eric House
0b00f303bb
cleanup after code review
2013-11-25 07:46:25 -08:00
Eric House
0cc45ad865
add new field canHideRack to GameStateInfo and use it to disable menu.
2013-11-17 13:54:21 -08:00
Eric House
088dd1bd75
center board when it must be narrower than screen
2013-11-15 20:46:22 -08:00