Commit graph

2732 commits

Author SHA1 Message Date
ehouse
df9b7bea2b More translations. 2009-09-11 07:05:31 +00:00
ehouse
448ea05443 Start adding logging to sockets code... 2009-09-07 18:23:49 +00:00
ehouse
03eeb93925 Prefs file is created HIDDEN; open it that way too. 2009-09-07 18:22:52 +00:00
ehouse
4e8d340304 Don't re-open conns dlg if in standalone mode 2009-09-07 16:55:54 +00:00
ehouse
13e50dd149 when only one conn mode available localized versions shouldn't show
choice either
2009-09-07 16:46:55 +00:00
ehouse
e8825e119c add comment re: stream format non-change for utf-8 2009-09-05 13:14:42 +00:00
ehouse
615603b66b Add define set to number of conn types compiled in; use it to compile
out conn type choice where there's only one (none to be made).  Refuse
to dismiss conns dialog when cookie not chosen.
2009-09-05 13:08:46 +00:00
ehouse
8ddc8612a8 experimental CC def should not have been checked in 2009-09-05 13:00:35 +00:00
ehouse
044c38e02f change formatting, variable name 2009-09-04 12:32:16 +00:00
ehouse
1c865eb2cc static linking for recent cegcc; don't ask mingw windres to do utf8 2009-09-04 12:31:15 +00:00
ehouse
3a1c2572dd Merge in unicode changes to read in utf-8 dictionary format 2009-09-04 12:30:10 +00:00
ehouse
c010a73098 copy over tall-narrow game info dialog layout from other .rc files 2009-09-04 12:18:46 +00:00
ehouse
7ca629a2f5 don't log socket closing as an error 2009-09-04 11:02:09 +00:00
ehouse
8acbe2c08f Don't sort tiles in blank picker! 2009-09-01 13:59:45 +00:00
ehouse
f72a8a5904 updates from translator 2009-09-01 12:41:56 +00:00
ehouse
188eea4646 Try again if fail to connect to relay. 2009-08-30 15:25:13 +00:00
ehouse
6827ab5d88 Unify signal handlers that do same thing; clean memory leaks and a
double-dispose.
2009-08-30 15:23:05 +00:00
ehouse
dd666472a3 Fix compiler warning in non-debug case. 2009-08-30 15:20:18 +00:00
ehouse
95a70862be Lock cref before calling method that assumes lock. 2009-08-30 15:18:40 +00:00
ehouse
2a569df97f For privacy, don't show host IP unless connection is local. 2009-08-30 15:16:06 +00:00
ehouse
1d2bd69251 Some fixup, e.g. missing or duplicated IDs, left from merge. 2009-08-29 16:10:56 +00:00
ehouse
1c8147c21c Tweak to support non-ascii utf-8 chars from dicts. Seems to display
Catalan and Polish fine (on board.)
2009-08-29 16:09:58 +00:00
ehouse
d86d2b556a Tweak to support non-ascii utf-8 chars from dicts. Seems to display
Catalan and Polish fine (on board.)
2009-08-29 16:09:24 +00:00
ehouse
9ae95366eb merge in changes from 2546 to current HEAD on wince_42_branch to catch up with localizability. Tested only on win32 so far, where can switch locales and play via relay 2009-08-29 13:37:37 +00:00
ehouse
6a36c045b6 fix wince compile error 2009-08-29 13:06:48 +00:00
ehouse
d29b048504 timeout games after five minutes no matter what 2009-08-23 15:35:47 +00:00
ehouse
b15665e041 serve http view from cached data and make cache refresh rate
configurable.  Should make it harder to attack the relay on http port.
2009-08-21 12:32:57 +00:00
ehouse
537de614b9 remove timer assert; log socket errors 2009-08-21 12:15:40 +00:00
ehouse
dbf9daf71b Fix problems reconnecting hosts where some but not all received the
ALLHERE message and connName: change relay protocol so cookie is
included in RECONNECT message, and hostIDs are not assigned until
ALLHERE, and change host-to-game matching to use connName first but
fall back to cookie.  This fixes nearly all cases failing to reconnect
after relay goes down.
2009-08-21 12:00:09 +00:00
ehouse
f5f5df990e Drive hosts launched from list of local roles in anticipation of
splitting tests between machines.
2009-08-21 03:31:34 +00:00
ehouse
493d3c226f log when crash 2009-08-20 12:12:43 +00:00
ehouse
1264cacdc1 when one participant in a game crashes kill the rest so another can
begin.
2009-08-20 11:56:33 +00:00
ehouse
53133839a4 don't log list of sockets by default 2009-08-20 03:50:40 +00:00
ehouse
e96becb05f variable name change only (for clarity) 2009-08-13 12:59:55 +00:00
ehouse
522bd8636d include timestamp in "game finished ok" output 2009-07-31 13:04:37 +00:00
ehouse
e746e2bc5b Fix assertion failures 2009-07-31 13:03:38 +00:00
ehouse
fbd3559e3b Fix assertion failures 2009-07-31 13:03:05 +00:00
ehouse
47d6d53419 make log file location configurable; remember start time as used for
permenent IDs on spawn rather than overall boot to avoid duplicating
cids.
2009-07-31 13:02:05 +00:00
ehouse
7077a11af6 pass .css file 2009-07-31 12:58:47 +00:00
ehouse
acbf8180ef add missing lock(); track and display uptime of daemon child as well as parent 2009-07-31 12:56:04 +00:00
ehouse
80ccdd6d04 spelling... 2009-07-31 12:47:58 +00:00
ehouse
f537169db5 Assign 0 not NULL to pthread variables. 2009-07-31 12:43:04 +00:00
ehouse
bcc887c0b1 Need to remove before inserting. Todo: is there a replace? 2009-07-31 12:39:47 +00:00
ehouse
503db9cc6f up copyright 2009-07-30 12:54:17 +00:00
ehouse
f35f2fe696 add css file path 2009-07-30 12:52:05 +00:00
ehouse
ba97f096dc make css file for http interface configurable; fix bug where
connections arriving too close together would wind up with different
crefs (using new mutex).
2009-07-30 12:49:21 +00:00
ehouse
631bf4b179 write to named file for use on ISP from cron 2009-07-30 12:46:40 +00:00
ehouse
2641ab6430 bug fix: mark after locking so will unlock in destructor 2009-07-30 12:39:45 +00:00
ehouse
7338a706cb option to randomly kill xwords instances 2009-07-29 04:31:23 +00:00
ehouse
192fb50bf8 add SIGINT handler that calls quit (to save files). Listen for errors in poll. 2009-07-29 04:29:29 +00:00
ehouse
4a5d74a0af rename state to take up less space in browser; add number of respawns
to status display.
2009-07-29 04:25:21 +00:00
ehouse
8be31357ad track per-cref lifetime and display it via http 2009-07-28 05:41:15 +00:00
ehouse
9ab746d8ac Include strerror output in a few socket-related error messages. 2009-07-28 05:17:44 +00:00
ehouse
8284799abe Fix crashes resulting from deleting cref instances in one thread while
another wanted to operate on them.  The root problem is that you can't
dispose of a mutex while somebody's blocking on it.  So now the
locking mutexes live inside the cref class.  When the lock owner
realizes the cref needs to die, it sets a flag and it's moved to a
recycled list.  A thread blocking on the mutex will then get it, but
checks the flag and releases it immediately if it's being recycled.
(Also improve the http interface a bit.)  With these changes I've run
31K (and counting) games against the relay without a crash or deadlock
(using sim_real.sh.)  The main problem that remains is that sometimes
two games using the same cookie wind up with two crefs (and so never
connect.)
2009-07-28 05:15:26 +00:00
ehouse
0d03ed71bb cleanup 2009-07-28 05:09:24 +00:00
ehouse
6b1cf247bf Don't alloc storage for fds and log buffer each time through poll
loop; instead reuse and realloc when needs to grow.
2009-07-28 05:08:15 +00:00
ehouse
8c7c457a54 shorten state names so they take up less webpage space. 2009-07-28 05:06:25 +00:00
ehouse
62b7d3c3a4 Clean up gtk case and fix post-game log checking. 2009-07-28 05:02:09 +00:00
ehouse
3b62e04d07 don't use -lmcheck. It causes a lot of crashes in places where it
certainly looks as if nothing is wrong.
2009-07-28 05:00:18 +00:00
ehouse
dddd5e1dd8 clean up logging. I got some cores that suggest overflow. This fixes
that if indeed it was happening.  Problems with sockets disappearing
while in poll may remain.
2009-07-16 04:43:33 +00:00
ehouse
19cff0f7c5 make all game ids (cookies) unique; fix success test 2009-07-16 04:36:30 +00:00
ehouse
0a0d4804dd store keys and values as const char* instead of string since the
string code was involved in a lot of crashes.
2009-07-16 04:23:02 +00:00
ehouse
8a0d963c95 include abbreviated uptime in stat row 2009-07-16 02:56:25 +00:00
ehouse
c5e73fd725 Add to http display number of games currently being hosted. 2009-07-13 03:01:22 +00:00
ehouse
582eb88f9a int->bool 2009-07-13 02:58:16 +00:00
ehouse
fed0458f2e various improvements. Runs games forever now, though exit is clumsy. 2009-07-13 02:57:41 +00:00
ehouse
d7cd277893 Add option to close stdin on startup, which seems required to run
curses version from script.  There's probably a better way...
2009-07-12 01:32:14 +00:00
ehouse
df293db349 script to run lots of games with events at more natural intervals against relay. 2009-07-12 01:18:09 +00:00
ehouse
4c523b628c Make slow-robot work for curses client too. 2009-07-10 05:04:04 +00:00
ehouse
184a154c52 New feature, meant for testing relay, makes robot skip random number
of seconds within specified range before making a move.  Working only
on gtk so far, and will probably never be used other than on linux
clients.
2009-07-09 12:43:51 +00:00
ehouse
854b3d9349 use synchronized method to add map entries 2009-07-06 02:02:59 +00:00
ehouse
2ef16d44ca Include number of games played in html output; don't report closed
sockets found while reporting closed sockets (to avoid deadlock);
remove sockets from crefmgr's map when closing them so new connections
using same (re-used) socket aren't treated as belonging to open games.
2009-07-06 01:50:51 +00:00
ehouse
a680a6e5fe Always close sockets we're done with. Otherwise they leak -- don't get reused. 2009-07-06 01:32:30 +00:00
ehouse
37dc9b7b88 running under valgrind I need to handle SIGPIPE. 2009-07-06 01:31:16 +00:00
ehouse
7893c2066a get rid of gratuitous echo 2009-07-05 01:46:27 +00:00
ehouse
c0073183ba improve relay test script to better run in a loop. 2009-07-03 14:55:20 +00:00
ehouse
f4db39f490 synchronize reads of std::map to fix crash due to memory corruption.
Apparently containers aren't thread-safe even for reads.
2009-07-03 14:54:21 +00:00
ehouse
a954286960 avoid mempool assertions by cleaning up on way out 2009-06-30 12:55:47 +00:00
ehouse
9b29e45ea4 plug valgrind-found leak; prefer localtime_r. 2009-06-29 12:58:30 +00:00
ehouse
c347bbd963 tweak new game dialog 2009-05-01 04:36:58 +00:00
ehouse
e19e8411cb fix compilation error 2009-05-01 04:29:13 +00:00
ehouse
927c363edf Move more (hopefully this is it) strings into resources; make sure all
three .rc files have all strings.
2009-04-30 04:25:17 +00:00
ehouse
ce09a83b12 script to check that .rc files have all expected ids defined 2009-04-30 04:20:30 +00:00
ehouse
ee2e1e1234 Move another string from code into resources. 2009-04-26 20:21:21 +00:00
ehouse
0c5088192d remove logging 2009-04-26 20:20:14 +00:00
ehouse
e4977e2c5f Add ability to scroll dialogs by dragging. Works only on
touchscreens, and has no sense of momentum.
2009-04-26 20:10:28 +00:00
ehouse
eb5ee8431b check string ids back in rather than generating; move macro from .rc
file into new .h all can include; use XWCOMBO more; build shippable
files in new built directory within obj_*; don't tell windres that
french is english.
2009-04-24 05:36:31 +00:00
ehouse
6638b251e0 Give all labels real IDs so can be moved; flesh out locale picker
dialog; add macro to replace listbox/combo triplet; rename some ids.
2009-04-23 12:37:07 +00:00
ehouse
568c75ba9a list dlls by name rather than pattern 2009-04-23 12:31:03 +00:00
ehouse
e573fa4fb5 add missing include 2009-04-23 12:12:57 +00:00
ehouse
3ae06069b4 Fix typo 2009-04-22 12:50:31 +00:00
ehouse
efe9fdf974 When resize dialog, put half the now-wider right margin on the left. 2009-04-21 12:42:51 +00:00
ehouse
984ec5934b get rid of translate comments. no code change. 2009-04-21 04:44:30 +00:00
ehouse
d06ade3cd7 Tweak resource layout to fit French translations better. 2009-04-21 04:29:37 +00:00
ehouse
173b49c2e2 Latest French translations; copyright catchup. 2009-04-19 17:36:28 +00:00
ehouse
c5ade1431a Move a few more strings into resources. 2009-04-19 17:34:14 +00:00
ehouse
481e2acb92 Add dialog for choosing localization .dll; save choice in prefs and open on boot. 2009-04-19 17:33:39 +00:00
ehouse
a7bf9f611d strip .dlls for size -- and since this seems to work around cegcc's problem with winmo 6.1 2009-04-19 17:12:55 +00:00
ehouse
8d6150e025 First cut from translator. 2009-04-14 03:38:33 +00:00
ehouse
80b9fde2da Starting point for French translation. 2009-04-14 03:34:41 +00:00
ehouse
51b0fd5e4e Changes to use .dll on wince: create window, which creates its menu,
after loading prefs since that's where language pref will be stored.
But for now, hard-code to load French so translator can see it
immediately.  Also, create l10n directory in which localized .rc files
will live and modify Make file to .dlls from all.
2009-04-14 03:33:46 +00:00
ehouse
76c0a518f1 change -j to -j3. No code change. 2009-04-14 03:27:32 +00:00
ehouse
61fc087c5d annotate template for translators. No code change. 2009-04-11 16:49:04 +00:00
ehouse
d19f052503 Track HINSTANCE of localization .dll separately, passing it where
appropriate; move rest (I think) of strings into resource; load menu
for win32 app after loading localization .dll.
2009-04-11 15:45:59 +00:00
ehouse
be7fe94650 add more strings 2009-04-11 15:41:40 +00:00
ehouse
aeb6d94248 generate string resource IDs from a list to avoid the trouble of keeping them sequential. 2009-04-11 15:40:19 +00:00
ehouse
d5afc6f252 generate string resource IDs from a list to avoid the trouble of keeping them sequential. 2009-04-11 15:40:01 +00:00
ehouse
848ccaaff7 remove resources (e.g. colors) that don't need localization; add more strings. 2009-04-11 15:38:40 +00:00
ehouse
2727cacae0 Start factoring out strings for localization: move most to resource,
add new file that loads resources (working around LoadString not
working as docs say it should).  Add all-caps version for testing and
not-yet-working cmdline change to use it.
2009-04-09 13:48:38 +00:00
ehouse
9df574b6f6 Fix to compile (and so dicts are read into new internal format) on Palm. 2009-04-07 04:33:47 +00:00
ehouse
669e423ca8 Use new dict API to get rid of XP_UCHAR4 type, replacing with const XP_UCHAR*. 2009-04-07 04:23:56 +00:00
ehouse
2838f421a5 fix a couple of null ptr exceptions 2009-04-05 23:48:33 +00:00
ehouse
7b5259a5c0 Use simpler API (no behavior change; not utf-8 related). 2009-04-05 20:19:29 +00:00
ehouse
f3b53e4aaf When dict is utf8, convert to wchar_t assuming CP_UTF8 rather than CP_ACP. 2009-04-05 20:18:46 +00:00
ehouse
f0d6dda9dd A couple of new types for xp code dealing with utf8. 2009-04-05 19:27:30 +00:00
ehouse
241b24c862 Read new dicts and old into new format. 2009-04-05 19:24:10 +00:00
ehouse
a9b88d95b2 Read new dicts and old into new format. 2009-04-05 19:22:55 +00:00
ehouse
641ae18864 Use new dict api to support utf8 faces. 2009-04-05 19:20:22 +00:00
ehouse
9f6114fb9e don't cast. 2009-04-05 19:18:47 +00:00
ehouse
96cfd7c7dd New stream version: dict sent over wire has faces as utf8 (unless dict is not.) 2009-04-05 19:16:52 +00:00
ehouse
38a23ba74f Begin changes for utf8 support (mostly from unicode_branch). Dict now
provides tiles as null-terminated const strings ptrs to which can be
passed and stored.  They're utf8 strings.  Old dicts still work,
platform must convert to utf8 on load.
2009-04-05 19:02:21 +00:00
ehouse
4a308f4f8e Don't use unitialized variables (thanks valgrind :-) 2009-04-05 18:47:45 +00:00
ehouse
b63c75f36e use libncursesw 2009-04-05 18:35:51 +00:00
ehouse
926f5963a3 rename only: stream_putString to stream_catString. 2009-03-29 18:26:59 +00:00
ehouse
8dca48b3ea Useful ftell, commented out. 2009-03-29 18:13:09 +00:00
ehouse
9e5b3f8f29 Changes to fix BYOD (though still need native speaker confirmation) 2009-03-14 22:33:53 +00:00
ehouse
690bf80b7b Fix so can build iso-8859-2 Polish dicts using make (won't work on
BYOD yet): add encoding to emacs mode line and fix the letters,
including hard-coding them as decimal numbers until I can figure out
how to get perl (in xloc.pm) to emit iso-8859-2 instead of utf8.
2009-03-14 19:27:29 +00:00
ehouse
0b0bf96cd5 accept ISO-8859-2; remove unused param; add assert that EOF/EOL aren't
part of a multibyte char
2009-03-14 19:22:15 +00:00
ehouse
b16a07d0ba build dict2dawg with debug symbols 2009-03-14 19:21:09 +00:00
ehouse
fbe95478ba rename now() as uptime(); drop NTHREADS to 1 for now; include time of
server boot in connName and keep counter in memory rather than a file.
2009-03-10 12:52:17 +00:00
ehouse
f9e6c5631d Move WSACleanup into main where it can be called once per launch
rather than per use of relay, parallel to WSAStartup.
2009-03-08 20:01:47 +00:00
ehouse
f874183475 Use nwgamest support for separate config button beside role combo, and
remove hack responding to tap (without change) on that combo.
2009-03-08 20:00:20 +00:00
ehouse
cb72b3ffef call gi_initPlayerInfo() for defaults when not provided on commandline. 2009-03-08 19:57:27 +00:00
ehouse
53fca87b10 Go back to combo box for role, and add config button beside it using new support in nwgamest. 2009-03-08 19:56:48 +00:00
ehouse
de4c57e740 include strerror output in logging when socket read fails 2009-03-08 19:56:01 +00:00
ehouse
d7eaa8e574 Add functions names to log statements. 2009-03-08 19:54:50 +00:00
ehouse
4e1155583f Add support for a config button as a cleaner alternative to launching
comms config dialogs on changes to host type (which often involved
platform-specific hackery to trigger the dialog when user doesn't want
to change role)
2009-03-08 19:54:14 +00:00
ehouse
f598340239 relay name defaults to eehouse.org, easier to set at compile time for testing 2009-03-08 19:47:36 +00:00
ehouse
4909ae0137 Close down relay connection when comms going away. Fixes crashes when
new game is standalone and prev used relay.  Add logging code in comms.
2009-03-06 13:43:03 +00:00
ehouse
8fd1d5b2a9 cleanup for new compiler: -D option, winsock2.h, fix warning 2009-03-06 04:53:56 +00:00
ehouse
44ef132d85 swprintf->_snwprintf to make newer cegcc happy 2009-03-06 04:52:06 +00:00
ehouse
1b49a26736 do loglevel and ports via the general-purpose config mech. No special
cases remain.
2009-03-05 13:49:01 +00:00
ehouse
3469dc7bf3 Make refresh interval configurable. 2009-03-02 05:29:06 +00:00
ehouse
6b3265ac47 Change config class from having a method for every configurable value
to returing values for string keys so adding a new config doesn't mean
modifying that class.  Then add new config for addr passed to bind so
relay can be run to accept http connections from remote machines.
2009-03-02 01:50:14 +00:00
ehouse
dbec991e9a use PID as cookie so creation order visible on relay during testing 2009-03-02 01:46:10 +00:00
ehouse
14cb742b38 don't pass wrong proc ptr 2009-03-02 01:45:16 +00:00
ehouse
9a8abb770d in web console list hosts present rather than just the count 2009-02-28 19:35:32 +00:00
ehouse
213c66b391 Reset all relay-related variable on new game. Fixes bug where devices
couldn't switch roles or join a new game.
2009-02-28 19:27:45 +00:00
ehouse
61c07ba1a3 Make all of a non-server's players local. 2009-02-28 19:25:46 +00:00
ehouse
acb37fda4f fix checkServerRole which was incorrectly counting players in client
case.
2009-02-28 19:25:08 +00:00
ehouse
aa48b4c3ed plug memory leak by closing relay socket when quitting 2009-02-28 19:19:42 +00:00
ehouse
3f01c9129e Lots of changes to make gtk version better test with relay: make
possible to start without specifying comms params, to switch roles
and/or number of players when starting new game; clean up dialogs,
esp. use notebook widget to have tab switch between comms types.
2009-02-28 18:52:44 +00:00
ehouse
c2b34e459d include pid in log for better multi-device debugging 2009-02-28 18:50:21 +00:00
ehouse
13415e895e test script, first draft. 2009-02-28 16:31:34 +00:00
ehouse
46cb6c2955 fix assertion on exit: nuke mempool after everything it contains; call
gtk_main_quit rather than gtk_exit() so can exit from main()
2009-02-28 16:31:03 +00:00
ehouse
3bf116c936 Add an http interface (read-only web console). 2009-02-28 16:15:59 +00:00
ehouse
21d4203fe2 Empty out queue and use existing code to re-add elems we want to keep.
Candidate for 4.2.
2009-02-28 16:11:09 +00:00
ehouse
9abb637330 assert queue ok after deleting. Candidate for moving to 4.2 branch if
to be used for Palm.
2009-02-28 15:06:12 +00:00
ehouse
233bf5ffde Fix crasher: removing ACK'd messages left list in inconsistent state.
Candidate for moving to 4.2 branch if to be used for Palm.
2009-02-28 14:40:50 +00:00
ehouse
9cb1f8ab59 minimal test for comparing cegcc versions 2009-02-25 03:45:14 +00:00
ehouse
bac17d8c1e start adding conns dialog 2009-02-24 04:34:37 +00:00
ehouse
8d1289d3b7 Create type to hold array rather than passing array whose lenght is assumed. 2009-02-23 04:01:15 +00:00
ehouse
03c806e961 add tarball target to help 2009-02-21 17:15:09 +00:00
ehouse
b2112371b2 Make it possible to see comms dialog in read-only mode when role
selector is disabled (for game info use of new game dialog.)
2009-02-21 17:03:30 +00:00
ehouse
317b3cbfaf Toward a palm build whose only comms mode is relay (no IR, which was
always default.)  Plays half a robot-robot game via relay as client --
that is, debugging remains.
2009-02-17 05:54:28 +00:00
ehouse
44a3888d6d Add enum to debug-only logging. 2009-02-14 16:24:06 +00:00
ehouse
fb3d4cf2ba Draw arrow only if inval bit set and cell is otherwise unoccupied.
Fixes wince bug where tile dragged onto arrow disappears.  Should be
merged to 4.2 branch.
2009-02-14 16:23:18 +00:00
ehouse
2be682b4e9 Use new bufqueue util 2009-02-09 02:51:43 +00:00
ehouse
b2acdbae91 Add simple helper for keeping a queue of buffers in a single array. 2009-02-09 02:44:58 +00:00
ehouse
9ce82a7c94 fix leak of packet buffers; get rid of multithread code. 2009-02-07 18:20:16 +00:00
ehouse
326e57e742 commented-out setting of default relay host name 2009-02-07 18:18:24 +00:00
ehouse
644dc3b5ad detect duplicate initial connect packets by checking what socket they're on. 2009-02-07 18:17:17 +00:00
ehouse
80b3425b5b log size of incoming packets 2009-02-07 18:15:17 +00:00
ehouse
43982e1a07 validate initial message correctly when comms heartbeat not being
used; improve logging.
2009-02-07 18:14:28 +00:00
ehouse
42b314966b If platform doesn't provide a game id, use current seconds. 2009-02-07 18:12:46 +00:00
ehouse
5a5cba9d1b Handle case where packet contains several messages; attempt to send on
socket-writable and on receiving message to be sent; cleanup.  With
this change full robot-vs-robot game has worked over relay, but not
reliably.  I think it's the relay's fault.  Still tested only on Win32.
2009-02-01 16:46:00 +00:00
ehouse
8d1da3ee0e Put back code initiating connection when starting client game. 2009-02-01 16:43:01 +00:00
ehouse
53b27c96c9 Helps to compile platforms too before checking in... 2009-02-01 16:20:18 +00:00
ehouse
46f72de960 new files into svn:ignore 2009-02-01 16:03:31 +00:00
ehouse
1ac4ef3bc6 Attempt to detect connections that are duplicates by checking if that
socket is already in a connection.  This doesn't seem to always work,
and I may be leaking cref instances when it does, so needs debugging
still.
2009-02-01 16:00:20 +00:00
ehouse
6ba2032187 clean up event logging 2009-02-01 15:55:45 +00:00
ehouse
c672fcfafd Make it possible to run same binary against relay with relay heartbeat
and direct with comms heartbeat.  This mostly means changing ifdefs.
2009-02-01 15:50:58 +00:00
ehouse
1a99dc7e1c Beginning of rewrite of socket code for communication with relay,
replacing dedicated threads for read and write with non-blocking
sockets driven from the main window proc.  So far it can do a
round-trip against the relay on win32, and compiles but isn't tested
on wince.
2009-01-31 18:06:09 +00:00
ehouse
9e7144d8c9 comment about APIs to use for implementation (probably the last checkin of this file.) 2009-01-31 18:03:06 +00:00
ehouse
0d08147472 Turn off SMS by default (pending confirming a way to use the apis in unsigned app); add commented-out NO_DRAW option. 2009-01-31 18:02:02 +00:00
ehouse
b9dce19a93 if setlocale doesn't work, try again with en_US -- works around
problem on my ISP.
2009-01-28 03:32:21 +00:00
ehouse
3a643c51a4 cleanup; set locale based on ENV 2009-01-25 20:31:13 +00:00
ehouse
b7fa674c28 Set locale based on params passed in, only on ENV if not specified. 2009-01-25 20:13:36 +00:00
ehouse
90f8a276e1 Cleanup to run on a machine that's utf8: specify iso-8859-1 when needed. 2009-01-25 18:57:05 +00:00
ehouse
f6d8924593 make tarball ready to be dropped into byod 2009-01-25 18:48:29 +00:00
ehouse
b2dd3f02b0 Need to escape period in grep pattern to get literal dot! 2009-01-22 04:30:35 +00:00
ehouse
24622876bb change default dictionary 2009-01-21 05:36:43 +00:00
ehouse
c2f1ff3d06 smartphone-size small bitmaps 2009-01-21 05:25:43 +00:00
ehouse
52a4a92e14 If smallest bitmap is too big, use it anyway at full size. 2009-01-18 19:52:46 +00:00
ehouse
50a6f93b99 Pick largest possible bitmap; fix inconsistency between cedict's idea
of bitmap format and cedraw's: rows are padded to 8-bit boundary, not
necessarily 16-bit.
2009-01-18 18:29:27 +00:00
ehouse
f422305542 Make smaller bitmaps 8x8 since that's the smallest size that can be
required and StretchBlt to smaller can't work for letters.
2009-01-18 18:25:33 +00:00
ehouse
06632f5495 get rid of excess logging (one line) 2009-01-18 18:17:08 +00:00
ehouse
ac1a88f603 Add __func__ to what's tracked for allocation in debug builds 2009-01-18 16:37:44 +00:00
ehouse
e1bc780beb In tray, when values are hidden draw letters instead of bitmap if
they'll fit.
2009-01-17 20:30:49 +00:00
ehouse
e6132b3dde Scale bitmaps for specials to the size of an M so they look right next
to other letters.
2009-01-17 18:49:35 +00:00
ehouse
dd1f9aa8ca Include function name in assertion failure message; always print to
file before putting up warning.
2009-01-17 18:44:45 +00:00
ehouse
d58d9bedd7 return TRUE after handling WM_INITDIALOG 2009-01-17 18:41:15 +00:00
ehouse
702940fe06 Tweaks to bitmaps; build for wince by default 2009-01-17 18:39:08 +00:00
ehouse
c754726b0f Don't pass valid bitmaps ptr when drawing blank tile. 2009-01-17 18:24:18 +00:00
ehouse
2e488374f1 bug fix: fix reversed width and height params to StretchBlt 2009-01-17 15:45:24 +00:00
ehouse
a56d84b64d add emacs mode line 2009-01-14 13:41:25 +00:00
ehouse
08ceeb85b7 Fix size test for bitmap caching 2009-01-14 13:27:56 +00:00
ehouse
21f5f329a0 Get rid of bogus assert 2009-01-14 13:02:38 +00:00
ehouse
8aadcb3406 Get rid of unused parameter 2009-01-14 13:02:08 +00:00
ehouse
5505c435a2 Don't pass new bitmaps struct to draw code uninitialized 2009-01-14 12:51:55 +00:00
ehouse
09c879dccc Add sms support, largely untested. 2009-01-13 13:33:56 +00:00
ehouse
41ae10f8b6 Allow language Makefile to specify encoding. Pass to perl and c++
dict builders, using it to open files and to determine whether to do
multi-to-wide conversion.
2009-01-13 13:32:07 +00:00
ehouse
7b8e4e0fd3 Add target to build all languages. Stops on Swedish at the moment. 2009-01-13 13:19:15 +00:00
ehouse
4e619601c2 To support Catalan, add Makefile and bitmaps for three special tiles.
The first of these, L-high-dot-L, requires Unicode to be properly
drawn, but the current dict format doesn't support it so it'll be L-L
for now.  Bitmaps are still rough.
2009-01-13 13:17:58 +00:00
ehouse
aee316372e Use new api. Use small for cell and large for tile still, but now
create and cache an actual HBITMAP, and prefer it to letters.  This is
needed for Catalan where "L-L" will never fit.  Still to be done:
prefer letters to bitmap where they'll actually fit (devices where
tiles drawn wider), and position better in tray.  May also want to
allow scaling.
2009-01-13 13:11:05 +00:00
ehouse
88364775a1 cleanup: get rid of confusing but harmless * 2009-01-13 13:03:59 +00:00
ehouse
99a5a7912b Use new draw API but same bitmap as always (large in tile, small in
cell.)  In cases where bitmap and text provided, prefer bitmap.
2009-01-13 13:02:17 +00:00
ehouse
6d7a81fce6 change draw api so all available bitmaps (only 2 in current format)
can be passed for tile and cell drawing
2009-01-13 12:57:56 +00:00
ehouse
eb1e667c17 Add type Letter to represent what are Tiles in Crosswords:
lang-independent indices into the set of letters in use.  Should be no
change in functionality or code generated.
2009-01-07 05:13:45 +00:00
ehouse
948981434b Fix compiler warnings. Should be no change in generated code. 2009-01-07 05:03:13 +00:00
ehouse
5d7ee61448 Turn on relay by default. 2009-01-07 04:54:23 +00:00
ehouse
ac8c06d9cf Turn on and enable UI for relay and sms transport. relay doensn't
work, at least on win32 where threading code is broken, and former is
completely stubbed out.
2009-01-05 14:13:40 +00:00
ehouse
4595191395 Always use GetForegroundWindow to find parent 2009-01-05 14:06:52 +00:00
ehouse
0b82d75bc8 add controls for sms connecting 2009-01-05 14:05:56 +00:00
ehouse
7158ef3802 Cleanup; add sms example to usage() 2009-01-05 02:11:13 +00:00
ehouse
dc82fc6bff Use the new common/strutils binToSms routines. For now, use glib's
too and assert output is the same.
2009-01-05 02:10:27 +00:00
ehouse
abeb5376c0 Implement, with help from glib base64 source, routines to turn binary
into SMS-compatible strings and back.  This should ensure that the
format is cross-platform.
2009-01-05 02:08:55 +00:00
ehouse
e570d692b5 cleanup. SMS, not BT, is the default conType for other than Palm. 2009-01-05 02:07:30 +00:00
ehouse
c731e0d231 Remove newlines from debug statements. 2009-01-05 01:59:04 +00:00
ehouse
4698b835e8 Fix to compile with relay enabled and not STANDALONE_ONLY. Verified
that win32 build can open games saved by previous version, but nothing
else (e.g. use of network or even dialogs to set up relay connection
parameters.)
2009-01-04 00:00:45 +00:00
ehouse
342674276a Cleanup to build with relay enabled; don't enable any network features
if STANDALONE_ONLY is defined.
2009-01-03 23:56:20 +00:00
ehouse
e32e231dd5 New stream version makes standalone and multi-device build formats the
same so new Wince can open files saved by current version.  Tweaks to
build with relay and heartbeat turned on.
2009-01-03 23:54:25 +00:00
ehouse
863f79bfb9 Fix compile errors using latest gcc (fread etc must have return value checked) 2009-01-03 18:12:34 +00:00
ehouse
552f6350f9 tweaks to stop/start script to run on an ISP's server better 2008-12-31 04:26:37 +00:00
ehouse
c53fe0857c Don't parse the same conf file twice in a row. 2008-12-31 04:21:03 +00:00
ehouse
1c3be799b7 start counter for uptime at launch 2008-12-31 04:19:23 +00:00
ehouse
9fc325a334 include new file in tarball 2008-12-31 04:16:55 +00:00
ehouse
32121c5634 include svnversion output in tarball 2008-12-30 05:17:00 +00:00
ehouse
ea6fff8f28 replace int with bool where appropriate; fix to compile with newer g++ 2008-12-30 05:13:30 +00:00
ehouse
cefd69d8b3 Since there's now a flag indicating whether to show the value of a
tile, make value unsigned.  Adjust/fix platforms.  Add cmdline flag to
linux apps for hiding values.
2008-12-29 03:09:35 +00:00
ehouse
1755267d55 Add support to gtk app for tranport over "sms", with files containing
base64-encoded data as the messages.  Make necessary changes to comms.
This is the foundation for doing real SMS transport on handhelds.
Currently a full robot game works for two gtk clients provided the
server is launched first.
2008-12-29 01:35:29 +00:00
ehouse
270006f47b rename variables; fix compiler warning. 2008-12-20 04:25:41 +00:00
ehouse
7e2f2fd38e invalCellsUnderRect didn't work for rects not intersecting board; fix. 2008-12-16 05:30:25 +00:00
ehouse
bc01341f95 When values are hidden, draw letters as large as possible in the tile. 2008-12-13 07:34:16 +00:00
ehouse
13001301ec Indicate tiles whose values should be hidden with a new bit rather
than a negative value.
2008-12-13 07:32:53 +00:00
ehouse
3666235462 App name and game name don't fit most titlebars, so use app name only
when game has none yet.
2008-12-13 07:29:47 +00:00
ehouse
dab2f23479 Use Ok for stringbox, Done for Saved games dialog; next release to be
rc1, not b7
2008-12-13 04:39:06 +00:00
ehouse
9e7bfe0ff7 Provide default player names in game info dialog rather than when
creating the very first game to fix bug where creating a game with n+m
players from a saved game with n yields m blank default names.
2008-12-12 13:42:52 +00:00
ehouse
59cd2a83d1 Make tray tiles one pixel taller, extending all the way to bottom of
screen.
2008-12-12 13:40:41 +00:00
ehouse
cb7b8bf84f Back out change: button to dismiss Saved games dialog is "Done" again,
not "Ok".
2008-12-12 05:28:53 +00:00
ehouse
e28363f369 Warn when unable to open a saved game (generally when an older version
of the app tries to open game saved by newer version.)
2008-12-11 13:48:59 +00:00
ehouse
37518415ea fix occasional crash: null-out ptrs after deleting what they point to. 2008-12-11 13:42:21 +00:00
ehouse
909bcb1dca Don't open saved games dialog unless current game has a name:
cancelling name request cancels saved games dlg too.
2008-12-08 05:51:21 +00:00
ehouse
5aa7289dfe Don't remove extension if there's isn't one (fixes new segfault.) 2008-12-08 05:50:25 +00:00
ehouse
19d8f307b1 Add appropriate icon flags to all uses of MessageBox; remove a couple
of unnecessary Cancel buttons.
2008-12-07 16:24:26 +00:00
ehouse
c38297711e Fix other sites putting up dialogs claiming main window as parent when
it isn't.
2008-12-07 05:21:13 +00:00
ehouse
c791010603 Don't let smartphone users set hintlimits checkbox, and explain
why. Fix bug calling MessageBox with main window ptr from dialog.
Include name of preexisting file when warning user who enters it while
saving/renaming.
2008-12-07 01:30:18 +00:00
ehouse
e37cfa6ce8 up version to b7 2008-12-06 22:21:38 +00:00
ehouse
c82fb50055 Use SetBkMode to prevent overlapping tile face/value pairs from
erasing each other.
2008-12-06 22:14:40 +00:00
ehouse
57197f8b2c Mods to saved games dialog: allow to rename the current game; after
renaming or duplicating a game, make that new name the one initially
selected in the listbox; remove sorting code relying on OS to sort
when CBS_SORT set.
2008-12-06 20:28:01 +00:00
ehouse
6da758b5fa set text color before drawing star bitmap to make color consistent;
add utility function for setting colors to reduce code size.
2008-12-06 16:22:43 +00:00
ehouse
af1ca9af84 Quash some compile-time warnings. snprintf instead of sprintf. 2008-12-06 15:59:30 +00:00
ehouse
5508ae4593 Add testcases for Treo-sized screens. 2008-12-04 06:17:14 +00:00
ehouse
a9fbd3c027 Ignore bitmap for tiles, using string instead. 2008-12-04 06:16:37 +00:00
ehouse
dbb8dd4713 Fix blank picker on PPC by making dropdown tall enough to drop. 2008-12-04 06:15:57 +00:00
ehouse
d3d3dd561f Pass string for tile even when it has a bitmap. Let platform decide which to use. 2008-12-04 06:13:59 +00:00
ehouse
088ab1451e Use minimum height for tile value; draw bitmaps (clipped) even if too large. 2008-12-03 13:42:30 +00:00
ehouse
62aca48673 Make Show values the left softkey after chosen once. 2008-12-03 13:40:07 +00:00
ehouse
7ae7b91e40 When hideTileValues changes, inval all tray tiles. 2008-12-03 13:38:54 +00:00
ehouse
1c6460f64a Add "Hide tile values" checkbox and support it. 2008-12-03 13:37:55 +00:00
ehouse
de6f6dcdef draw bitmaps larger when will fit; draw hint region border thicker and
in player color; rename constants.
2008-12-02 13:47:18 +00:00
ehouse
b3d3f80860 Lots of little tweaks to dialog item locations. Also, don't make
phonies combo/list box sorted since that screws up order of choices.
2008-12-01 13:19:14 +00:00
ehouse
3bb15ab093 add (unused) missing defines for IME stuff, which can't work until I
figure out how to test for presence of qwerty keyboard
2008-12-01 13:16:58 +00:00
ehouse
5c53620470 if scrollbar has focus when removed due to screen resize, don't
continue to draw indicator rects in focus color
2008-12-01 13:11:58 +00:00
ehouse
f8870da48f Don't draw hint rect, or start drag to change it, if hints are disallowed. 2008-12-01 13:06:37 +00:00
ehouse
438be9dd2a When tray overlaps board yet is hidden, should not be on top except
when focussed.  Remember state before gained focus, and restore it
when loses.
2008-12-01 13:04:14 +00:00
ehouse
b78a46e110 When tray overlaps board yet is hidden, should not be on top except
when focussed.  Remember state before gained focus, and restore it
when loses.
2008-12-01 13:03:42 +00:00
ehouse
ce2420840d a bit of cleanup 2008-11-22 19:43:47 +00:00
ehouse
6e9f5791d6 Fix bug: when using hint limits to restrict first move on empty board
limits were ignored for the vertical search.  Fix is to make
special-case treatment of first move more integrated so special limits
code isn't needed.
2008-11-22 19:32:42 +00:00
ehouse
b24f3d66a7 fix warning when DEBUG not defined 2008-11-22 17:14:08 +00:00
ehouse
7d9259f16a update readme 2008-11-22 16:49:55 +00:00
ehouse
44ae99a075 remove redundant set of #defines for whether we're compiling for desktop or wince 2008-11-22 16:43:55 +00:00
ehouse
5118e415c7 use a gharish color for focus so doesn't get lost 2008-11-22 16:37:58 +00:00
ehouse
542e441b69 hide focus when pen used, but remember where it was (don't set to
OBJ_NONE) so can replace it when focus keys used again.
2008-11-22 16:37:29 +00:00
ehouse
46b574b4e7 fix inval of focussed tile to take divider into account. 2008-11-20 05:12:48 +00:00
ehouse
68778333a4 finish rem: changes and fix crash: show Remaining tiles dialog and draw focussed 2008-11-19 05:08:57 +00:00
ehouse
5f27b1552c When fewer than 4 players shown in game info dialog, move controls
higher that are below player rows. On some screen sizes this prevents
those items from being off-screen. Note that this requires use of
DM_RESETSCROLL message to get Smartphone to recalc scroll info and
that DM_RESETSCROLL is not yet defined in cegcc.
2008-11-18 12:36:27 +00:00
ehouse
d4e2f5c07a Fix timer positioning; provide default values for w32 height & width;
put up dialog on assertion failures now that they're uncommon.
2008-11-13 05:46:21 +00:00
ehouse
a91aea537a up beta version 2008-11-12 04:55:54 +00:00
ehouse
ce82507db0 Add checkmarks to four menuitems to show state; add fullScreen
menuitem to w32 version and give it something to do.
2008-11-10 18:49:26 +00:00
ehouse
d4bc42b0a1 add getters 2008-11-10 16:01:46 +00:00
ehouse
e2cd0b5807 Speed up font calculation by interleaving width and height
constraints; simplify pending score display by using %dp rather than
trying to fit two strings in the many possible sizes of tiles.
2008-11-08 16:25:49 +00:00
ehouse
30df2166ab Don't assert when unknown key seen; just ignore. 2008-11-08 16:19:04 +00:00
ehouse
cfc00206c1 fix release build compile error. 2008-11-06 06:30:30 +00:00
ehouse
5cb97bf636 New Ubuntu has a stricter compiler... 2008-11-06 03:16:09 +00:00
ehouse
3958950ad1 When finding font to fit height, optionally force it to fit width as
well.  Mechanism used for Rem only so far, but will work for score too
as long as we don't need it to shrink font as score gets longer.
Current impl worries about height first, then width; would be better
to look at both simultaneously to reach the goal more quickly.
2008-11-02 23:17:38 +00:00
ehouse
e6399c74c1 Fix bug making glyphs from random garbage; when narrowing in on
correct font size, compute based on ratio from what we have rather
than just reducing by one each pass.
2008-11-02 04:17:42 +00:00
ehouse
be3863dd5a For win32 builds, locate files relative to ./ 2008-11-02 04:15:10 +00:00
ehouse
93e615b44c Don't skip over occupied tiles when moving cursor unless alt key is
down.  Smartphone doesn't have an alt key, and this
simplier-to-understand behavior should be the default.
2008-11-02 03:43:33 +00:00
ehouse
661a12ae5c bug: choosing hint menu also chooses commit-turn if focus happens to
be on 7th tile.  Problem is that OS sends key up after handling menu.
Fix is to track when we've seen a keyDown, and drop keyUp events when
we haven't.
2008-10-31 04:36:44 +00:00