Commit graph

580 commits

Author SHA1 Message Date
Andy2
7e0252713c changes to use glib main loop were incomplete, didn't include timers.
Fix that.  Now discon_ok2.sh test works with the USE_GLIBLOOP turned
on.
2011-09-19 18:28:19 -07:00
Andy2
c2e2bdf3c5 listen on stdin always -- not sure how the condition got added -- and
don't register for OUTbound events when listening -- stdin gets one
and I don't want to sign up to handle it.
2011-09-19 17:56:20 -07:00
Andy2
9eacdb3856 add server_listWordsPlayed, and implement via function in model.c that
uses existing stack and undo features to run a WordNotifierInfo over
some number of scoring passes to gather the words seen.  Seems to work
as tested from gtk version.  Now need to try from android....
2011-09-18 17:20:01 -07:00
Eric House
84931f34ff Merge branch 'android_branch' into send_in_background 2011-09-07 21:44:36 -07:00
Andy2
da475347a5 get rid of unused constants 2011-09-02 18:36:26 -07:00
Andy2
2d2f3e23fd change signature of util_playerScoreHeld(): pass player num rather
than formatted text. Client code can use new
model_getPlayersLastScore() or whatever else it wants to build text to
show the user.
2011-09-02 18:36:03 -07:00
Andy2
dadf41ad2e add "cancel trade" menu item 2011-09-02 06:38:30 -07:00
Andy2
c2150bc9ed get rid of util_setInTrade() 2011-09-02 06:14:29 -07:00
eehouse@eehouse.org
b6e5327b1a Merge branch 'android_branch' into send_in_background 2011-08-31 06:46:42 -07:00
Eric House
c01981bc8f Make miniwindow stuff compile-time optional. The goal's to use native
features where they look better or are easier to manage, e.g. Toasts
and dialogs on Android.
2011-08-29 20:36:01 -07:00
Eric House
3b719f54de add compile-time option to use glib main loop (instead of select())
with ncurses.  The goals to make it easier to include watch on pipes
for incoming messages to better model Android -- and to be a bit more
modern.  Works for one run of test script but needs more testing to be
turned on.
2011-08-29 20:24:15 -07:00
Andy2
eb00984563 Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java
2011-08-20 12:44:17 -07:00
Eric House
c2c673e932 improve testing of proxy delete by saving up a number of relayIDs and
sending with multiple -d flags to rq.
2011-08-16 19:44:37 -07:00
Andy2
dfab747504 make server_do() take a new param to allow caller to call it until
there's nothing more to do (without the assumption it's driven from an
event queue.)
2011-08-16 19:28:59 -07:00
Eric House
cbfdf992bd add compile-time option to allow passing game seed from commandline.
This should allow testing relay changes to deal better with duplicate
seeds.
2011-07-31 22:23:46 -07:00
Eric House
47da43a581 use new param to turn on mmap 2011-07-18 18:08:31 -07:00
Eric House
4093e1c947 add option to switch between mmap and malloc for dict runtime access. 2011-07-18 18:07:15 -07:00
Andy2
c482df300b better value for RESIGN_RATIO 2011-07-15 18:24:26 -07:00
Andy2
d81458c34c use nmap -- as test case for doing same in jni 2011-07-15 18:24:08 -07:00
Eric House
febb640049 add name of remote player to notification that remote player moved.
And remove a few dead strings.
2011-07-15 18:13:55 -07:00
Andy2
1686f3d9a8 make --skip-confirm do what it says, and include it in test script. 2011-07-12 07:13:58 -07:00
Eric House
abf60e027d fix pattern to pick the right hostid. 2011-07-06 20:02:51 -07:00
Andy2
4789bac85e add new mode that only launches games after the relay says there's a
message for them.  This is to mimic a common way games are played on
Android and to ensure that there are no points where that style of
play hangs because no device in the game will be "up".
2011-07-04 19:46:12 -07:00
Eric House
e207e0e142 add option to run only one game at a time in a given room. The idea
was to mimic conditions that are creating a bug on-device but it
didn't work.  Still, a useful test case....
2011-07-02 23:12:16 -07:00
Eric House
5c5708fa66 try to fix race condition that sometimes means script detects game is
over but doesn't communicate to relay: don't consider file done until
have info to sent to relay.
2011-06-30 19:37:37 -07:00
Eric House
ef9d359ab9 tweak default param values 2011-06-29 21:38:54 -07:00
Andy2
363acc228a use printf so rooms sort numerically 2011-06-28 17:38:59 -07:00
Andy2
b2a7acbdf1 remove echo 2011-06-27 18:59:36 -07:00
Andy2
3db0543994 work in absence of drop-nth-packet param 2011-06-27 18:57:27 -07:00
Andy2
8673c6a001 toward being able to verify that upgrading the relay won't hurt
in-play games: add ability to pick up games mid-play; don't sleep
before killing a device unless it's only been running less that the
minimum.
2011-06-27 18:32:30 -07:00
Andy2
e122953fd5 clean up logging 2011-06-27 18:27:07 -07:00
Andy2
e44ed96691 fix logging: calling read(), not recv() 2011-06-24 18:28:18 -07:00
Andy2
a5bab1232f deal with changing connnames: use the last 2011-06-23 18:12:38 -07:00
Andy2
b4381e8403 drop-packets off, not on, by default 2011-06-22 18:17:47 -07:00
Andy2
c87df3ce16 add option to drop incoming packets randomly (rather than 1st, then
2nd, then 3rd etc.)
2011-06-20 18:55:57 -07:00
Andy2
9b4034f409 fix undefined variable by updating script before possibly deleting it 2011-06-16 18:35:08 -07:00
Andy2
3f7cd851f2 use new drop-nth-packet option, incrementing by 1 each time.
Currently this breaks the relay -- which must be fixed.
2011-06-15 06:49:15 -07:00
Andy2
2d7a1f13b8 add drop-nth-packet option 2011-06-15 06:47:08 -07:00
Eric House
cb3e33ef72 update for months-old param name changes 2011-06-14 05:46:27 -07:00
Andy2
4c5c435fb5 add new parameter so client always gets notified on connection
including how many players are still missing.
2011-05-19 05:51:00 -07:00
Eric House
3cc105da0b add ability to dump board (model) as text, protected by ifdef that
will likely only get set on Linux.  Uses lower-case to designate
blanks.  For that and maybe string size assumptions is very broken for
non-ascii languages, including Spanish.
2011-04-13 06:45:22 -07:00
Eric House
0474fda127 reverse (back) sense of show-other option 2011-04-13 06:41:49 -07:00
Eric House
d6165deb47 anything beyond the 15th char in a bonus-square line is a comment (ignored) 2011-04-10 13:13:45 -07:00
Eric House
26eadb3b99 add commandline option to set bonus square pattern via an external
file.  (Effects only Linux versions.)
2011-04-10 13:04:05 -07:00
Eric House
3310645a12 test files for new bonus-squares-settable feature 2011-04-10 13:02:45 -07:00
Eric House
c77d3039cc add XP_FREEP. Should be no change in behavior. 2011-04-07 18:07:45 -07:00
Andy2
3b7b4802a9 add ability to specify, track and use separate dictionaries for each
player.  Works for gtk client.  Compiles for Android but there's no UI
yet to specify more than one dict.  Management of dupicate dicts
without duplicating memory -- refcounting -- will be up to the
platforms.
2011-04-01 19:57:10 -07:00
Andy2
d430e158ba add commandline flag for phonies 2011-04-01 17:36:04 -07:00
Andy2
f6be6222a1 draw timer in player color 2011-04-01 07:22:40 -07:00
Andy2
379538fd7e show robot/remote scores by default 2011-03-31 06:41:34 -07:00
Andy2
80e0edbf03 cleanup 2011-03-31 06:41:11 -07:00
Eric House
553bee4956 replace fwrite etc with write so fsync can be added before close. 2011-03-14 18:56:17 -07:00
Andy2
fc4fddb055 check if can hint (to refresh buttons) after enter/leaving trade mode 2011-03-08 07:41:16 -08:00
Andy2
54f2ae3edf error string for: fire user error rather than committing turn when
trade attempted without any tiles selected.
2011-03-07 06:29:40 -08:00
Andy2
3fb7c48172 turn off tile selection for linux (perhaps temporarily) 2011-02-18 22:31:28 -08:00
Andy2
15f40f01af fix to compile with new gdk that's on ubuntu 10.10. Need to fix the
APIs eventually.....
2011-02-18 22:28:32 -08:00
Andy2
f41356c98b fix the show-other param 2011-02-01 18:57:01 -08:00
Andy2
bf0582f0aa make hint buttons en/disabled based on board_canHint() results. 2011-02-01 18:56:37 -08:00
Eric House
4bf613a006 move pipe handling code to where can be shared by curses and gtk -- but use from curses is untested. 2011-01-24 22:20:47 -08:00
Eric House
4ae8c76959 break printed runtime into hours:minutes:seconds 2011-01-24 22:19:02 -08:00
Andy2
825cda9125 new feature for testing proxy: --with-pipe option causes linux client
to, instead of putting up UI, blocking on pipe and once it's readable
opening saved game and passing messages into it from pipe then saving
it when done.  Works, but requires gtk so far.
2011-01-23 21:52:26 -08:00
Andy2
09b5c44fb4 add option to prevent switching players by tapping scoreboard (to
mimic android)
2011-01-21 21:29:28 -08:00
Eric House
c4bf153d36 log reason game ended to game's logfile 2011-01-20 18:10:33 -08:00
Andy2
c9fec737e5 changes, protected by a disabled compile-time flag, to use cairo-based
API for drawing instead of now-deprecated gdk ones.  Unfortunately
nothing actually draws and I'm putting the debugging off until I have
some time.
2011-01-14 18:15:33 -08:00
Andy2
e7dbac41a6 fix to compile with new gdk that's on ubuntu 10.10. Need to fix the
APIs eventually.....
2011-01-12 19:00:20 -08:00
Eric House
b3de3fc91e add --robot-iq param for testing 2011-01-10 18:18:35 -08:00
Andy2
f48c1cc8b2 add robot-iq param to test new common code and adapt to its API
changes; change param from robot-name to robot.
2011-01-10 06:46:09 -08:00
Andy2
639279f865 up the number of moves saved to 32 to match Android. 2011-01-10 06:44:47 -08:00
Andy2
fc23080120 param name has changed 2011-01-10 06:40:42 -08:00
Andy2
7fe5e43963 modify to use new long-only flags 2010-12-21 08:02:51 -08:00
Andy2
63e7084cc8 fix a couple of the new options 2010-12-21 08:01:44 -08:00
Andy2
a7aabdc41b use getopt_long_only and a table to make adding params easier, fix
running out of letters, and force better usage.
2010-12-21 00:58:02 -08:00
Eric House
442b3983cf highlight during draw where possible because doing it after isn't
possible with wide chars -- meaning I haven't figured out how yet.
ncurses documentation is well hidden....
2010-12-13 22:07:25 -08:00
Andy2
4a12f7a96f Revert "in attempt to work around non-random rand() in jni world, call back"
This reverts commit 99c92e779d.

Conflicts:

	xwords4/android/XWords4/jni/utilwrapper.c
2010-12-07 18:43:53 -08:00
Eric House
c4cdc24b78 initial changes to add a header to xwd format so that stuff like
number of words can be included.  Changed to build dicts and linux to
open them.  Android still needs to learn.  Also, some of the tools in
dawg/ need to be fixed to read old-format (pre-utf8) .xwd files.
2010-12-05 19:33:10 -08:00
Eric House
9fd4229384 pass host to rq too 2010-12-02 22:34:59 -08:00
Andy2
99c92e779d in attempt to work around non-random rand() in jni world, call back
into the java world by making it a util_ctxt function.  Do same on
linux to test.  We'll see how it is -- and can back this commit out if
there's no improvement.
2010-12-02 19:02:36 -08:00
Andy2
5bf87b3bea add function to invoke rq once for all the relayIDs in the set of
devices making up a game.  Actually using it make the script fail for
some reason and so it's commented out, but it helped to debug the
relay.
2010-11-23 18:12:11 -08:00
Andy2
2127394260 don't allow resignations below a certain point -- which happens to fix
divide-by-zero error.
2010-11-22 20:44:28 -08:00
Eric House
a1caaeb183 simulate games being deleted before they're finished 2010-11-18 22:27:46 -08:00
Eric House
7a2d279308 add logging so script can better track what state relay game is in 2010-11-18 22:27:06 -08:00
Eric House
f33466b6db exit with non-0 on failure so calling script/loop can exit too 2010-11-16 20:29:55 -08:00
Andy2
3b30aff613 use external relayID.sh script 2010-11-15 19:01:38 -08:00
Andy2
58cd93ef6f given a log file, generates an ID that can be passed with the -d
option to relay/rq.
2010-11-15 18:34:56 -08:00
Andy2
a69e2ad8be add test for device-gone notification by calling rq after gleaning
required params from logs.  So far testing only after game is over;
need to test mid-game deletion too.
2010-11-15 06:52:35 -08:00
Andy2
9026d5c149 remove obsolete script I keep accidentally invoking 2010-11-12 18:26:01 -08:00
Andy2
fc8cac3b6a handle new device-gone message by posting timed-out dialog. 2010-11-11 06:43:36 -08:00
Eric House
966616cbc4 throw in the public flags; disallow unset variables 2010-11-09 05:54:23 -08:00
Eric House
2a2f4d4395 been a while since cvs... 2010-11-09 05:53:49 -08:00
Andy2
2d9851902c replace chat menuitem with chat button enabled using comms_canChat() 2010-11-01 06:55:37 -07:00
Andy2
ab708e4db1 add devOrder (= hostID) to params passed on connect. Make linux apps compile after API change. 2010-10-29 06:32:18 -07:00
Andy2
4cd15a9c6a Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy
Conflicts:
	xwords4/common/comms.c
2010-10-29 05:27:07 -07:00
Eric House
e069a268cd implement dialog to edit chat text 2010-10-28 21:31:40 -07:00
Andy2
7e0bcee6d2 add room name to callback used when device connects: fix linux to compile 2010-10-28 18:46:07 -07:00
Andy2
5400fad50d log timeout-dlg messages so there's a record 2010-10-28 18:44:37 -07:00
Eric House
6e843dec6c make 10997 default relay port 2010-10-22 18:30:19 -07:00
Andy2
b9e3ca212b turn off glib-dependant checksuming for non-linux builds 2010-10-18 22:08:04 -07:00
Eric House
211e9ded7f TIMEOUT needs to be bigger for small NGAMES values 2010-10-18 20:18:24 -07:00
Eric House
38ae2faacc don't nuke bad files along with good 2010-10-14 22:17:34 -07:00
Eric House
c92d59fa53 games can be started with multiple dicts; saving of successful games/logs optional 2010-10-14 05:59:45 -07:00
Eric House
40a7a1b5a3 cleanup; track checked rooms rather than checking each time seen 2010-10-12 19:17:42 -07:00
Eric House
8011eeec2c cleanup; fix off-by-one bug with NAMES that was breaking runs with
four-device games; check before run that there aren't already waiting
games in db.
2010-10-12 05:17:32 -07:00
Eric House
6c5b279946 respect TIMEOUT, and kill all remaining processes before exiting 2010-10-05 20:58:29 -07:00
Eric House
f0b05da131 reduce logging 2010-10-05 20:57:07 -07:00
Andy2
31f3cbc6c8 complete rewrite: use bash's new associative arrays to track games and
pids etc. so that a single process can manage starting and stopping
all games.  Fixes race conditions where a game would be killed after
finishing but before it'd sent out the message that would allow other
games to finish.
2010-10-04 22:16:58 -07:00
Andy2
a13bb34419 plug memory leak 2010-10-04 22:14:44 -07:00
Eric House
14fd1f9023 add test code for chat feature: display incoming chat and send via
menu.  Sent message is hard-coded for now; should fix that.
2010-10-03 18:13:48 -07:00
Eric House
a6f5ea5f4a sync after saving. Seems to improve recovery from TERMs sent by test scripts. 2010-09-28 18:06:05 -07:00
Eric House
1bfdd1978e move log directory away each time 2010-09-24 20:19:12 -07:00
Andy2
35ff5a7835 exit on logdir being gone before grepping it 2010-09-23 06:41:37 -07:00
Andy2
451ced44ba cleanup: shorter timeout; set aside games that finish correctly 2010-09-23 06:29:55 -07:00
Eric House
659278448b changes to work against remote relay 2010-09-22 05:45:40 -07:00
Eric House
076b211cab tweak to allow to specify host/port for use against remote relay 2010-09-21 20:38:54 -07:00
Eric House
b6ce74be1c add timeout after which all games are killed 2010-09-20 22:08:51 -07:00
Eric House
c671f2ab05 plug memory leak 2010-09-20 22:07:10 -07:00
Andy2
d199ec5168 account for possibility client apps won't exit on TERM 2010-09-20 05:33:58 -07:00
Andy2
84a26c2c1a more to ignore 2010-09-20 05:32:17 -07:00
Andy2
00cdbc97d3 Install a no-op TERM handler at first then replace later with one that
just exits main loop.  Do cleanup/file saving on exit from mainloop.
Fixes occasional crash where TERM came in before we were setup to
cleanup.
2010-09-20 04:55:35 -07:00
Andy2
54512b9e11 put logs in own dir 2010-09-18 07:35:16 -07:00
Andy2
eec07649a6 put logs in own dir; echo every time game ends successfully. 2010-09-18 07:35:02 -07:00
Andy2
7e1066dbcc vary room names 2010-09-16 22:20:43 -07:00
Andy2
76e7459a6d various improvements, e.g. random sleeps before and after starting 2010-09-16 18:56:34 -07:00
Andy2
ca6039e890 new test script attempting to mimic real-world usage 2010-09-16 05:39:50 -07:00
Andy2
452e3fc86b timeout in milliseconds instead of seconds 2010-09-16 04:46:04 -07:00
Andy2
fa50bd00f1 timeout final scores alert 2010-09-16 03:42:57 -07:00
Andy2
0d7165f881 add ability to run gtk from newrelay.sh. Trying to run 50 instances
crashes the relay as ACKs take too long to come back.
2010-09-16 01:44:54 -07:00
Eric House
9fc39a55ed add params to set public-room-related booleans; add timeout option on
modal dialogs so gtk version can run unattended.
2010-09-14 21:13:45 -07:00
Andy2
86a1e943ca make dict settable too 2010-09-12 03:53:39 -07:00
Andy2
8908ca5b1d ignore new test script's log files 2010-09-11 01:40:05 -07:00
Andy2
1cd2d542f7 new test script 2010-09-11 01:39:20 -07:00
Andy2
d5f2a72227 note that file's out-of-date 2010-09-11 01:28:04 -07:00
Andy2
b3d3673dc9 read the langcode out of dict and into common struct 2010-09-10 01:57:22 -07:00
Andy2
20312144dd tons of changes, still rough, snapshoted here: a gtk device vs device
game works to completion with both signing up as guests (no -s) with
one local and one remote player (identical commandlines.)  Not yet
tested: if any signs up as a host, reconnecting rather than
connecting, etc.  This is just a snapshot.
2010-09-10 01:30:40 -07:00
Andy2
34a94f23a0 fix error message to not specify host or guest 2010-09-10 01:24:42 -07:00
Andy2
f7c5ff619d turn off heartbeats 2010-09-10 01:24:03 -07:00
Andy2
2d69d8f2b0 use new crosshairs flags to draw a cross in the middle third of cells 2010-08-11 18:51:09 -07:00
Andy2
6dc21ae7a8 pass (hard-coded) param controlling non-turn board switching 2010-07-17 06:22:42 -07:00
Andy2
e4feef9bbc reverse sense of -I since hint region unsupported on Android 2010-07-16 18:24:17 -07:00
Andy2
a99e8142b0 Merge branch 'android_branch' into toolbar
Conflicts:
	xwords4/android/XWords4/jni/Android.mk
	xwords4/android/XWords4/jni/xwjni.c
	xwords4/android/XWords4/res/values/strings.xml
	xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java
	xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java
2010-07-16 06:32:32 -07:00
Eric House
e2c663622f ignore dicts 2010-07-15 18:09:40 -07:00
Andy2
f4e0c5f1ad turn on crosshairs feature 2010-07-13 06:27:07 -07:00
Andy2
f2674ed27c XWFEATURE_RAISETILE is off by default 2010-07-12 19:11:42 -07:00
Andy2
de32e514ab cherry-pick three revisions from toolbar branch (d1c7d4097c, f848473c1a and 6484a2fb9b) and manually fix conflicts. 2010-07-12 18:48:03 -07:00
Andy2
6484a2fb9b fix to compile (with or without KEYBOARD_NAV undefined) 2010-07-09 06:50:39 -07:00
Andy2
6b9b97231a fix to compile with KEYBOARD_NAV undefined 2010-07-09 06:49:32 -07:00
Andy2
4425ff838c add buttons (gtk) to test new prev-move feature; modify to fit new api
(curses).
2010-07-07 05:29:04 -07:00
Andy2
3452666231 use board_canTogglePending to disable button 2010-07-03 11:39:10 -07:00
Andy2
592d99ba80 add new button and handler to test redo of undone pending moves. 2010-07-02 18:53:37 -07:00
Andy2
e150db29ee use board_canFlip() to prototype disabling flip button when useless. 2010-06-30 20:25:56 -07:00
eehouse@eehouse.org
1fdf1e1a41 Merge branch 'android_branch' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into android_branch 2010-06-17 20:40:13 -07:00