Commit graph

1329 commits

Author SHA1 Message Date
ehouse
ebcc30dd5f send notice when a socket closes. This seems to be resulting in dups. 2005-09-04 20:37:42 +00:00
ehouse
0134c96962 fix deadlock by collecting crefs into local storage before starting to
act on them.
2005-09-04 20:36:53 +00:00
ehouse
7803fead80 use comms_setAddr rather than modifying const to set resolved address. 2005-09-04 20:34:52 +00:00
ehouse
75b8f5342a add error messages 2005-09-04 20:34:16 +00:00
ehouse
6d0b23a8e8 TALL_FONTS (support for Danish tall letters) now on by default 2005-09-04 20:32:16 +00:00
ehouse
aa0a9ec158 add error message; don't assert (crash) when socket closes. 2005-09-04 20:31:34 +00:00
ehouse
6f8b33a05b reset cookieID for a new game 2005-09-04 20:30:47 +00:00
ehouse
1f43831219 new error code 2005-09-04 14:35:13 +00:00
ehouse
1aed9882ef new (commented-out) info message 2005-09-03 18:36:08 +00:00
ehouse
4882c92a07 generate XWRELAY_OTHERCONNECT message 2005-09-03 18:35:34 +00:00
ehouse
8072bc687c add XWRELAY_OTHERCONNECT message 2005-09-03 18:32:12 +00:00
ehouse
59edec4955 handle OTHER_CONNECT message by resending any unACKed messages. 2005-09-03 18:31:32 +00:00
ehouse
e6e9646253 make all APIs private and add as friends the safe classes that will
access them.  This should allow reduction in the locking within cref
instances since only one thread at a time will be permitted inside by
SafeCref.
2005-09-03 15:59:48 +00:00
ehouse
4479933657 add missing state transition 2005-09-03 15:41:59 +00:00
ehouse
a4033a44c3 when one device is disconnected for heartbeat, tell others it's going
away.
2005-09-03 15:41:17 +00:00
ehouse
ca8877a5de for testing, add -H option to prevent client from sending heartbeat
messages to relay.
2005-09-03 15:39:15 +00:00
ehouse
abbd1a072f handle other-disconnected error message 2005-09-03 15:37:49 +00:00
ehouse
9a2567252b cleanup: get rid of unused states/actions and code to handle them. 2005-09-03 07:15:05 +00:00
ehouse
1114784217 Add strings for error codes for relay disconnect events. 2005-09-03 06:58:05 +00:00
ehouse
ab0e833a9b Receive disconnect events and display message for error codes. 2005-09-03 06:57:01 +00:00
ehouse
6a0abc16e8 Add range for relay errors. 2005-09-03 06:56:33 +00:00
ehouse
c82fd2e4f2 Send disconnect events with error codes on heartbeat and connect timer
failures; change how state machine handles heartbeats: only put events
into the machine when there's a failure.
2005-09-03 06:55:08 +00:00
ehouse
b0cc6f458b add disconnect event and error codes 2005-09-03 06:46:03 +00:00
ehouse
2ba0f451a7 fix failure to record bytes forwarded 2005-09-02 07:18:39 +00:00
ehouse
8f32f4f99a loads of changes: get settings from config file; remove sockets and
kill crefs via state machine, and protect access to a cref so it can
die without another thread being in it; do timers via timeout to
poll() rather than interrupt (and integrate into state machine);
detect when all players are present and change state so new
connections on that cookie will get a new cref.
2005-09-02 06:56:34 +00:00
ehouse
5d22be174a initial version 2005-09-02 06:40:34 +00:00
ehouse
9ac04243b5 first checked in. works. 2005-09-02 06:35:25 +00:00
ehouse
39fa5728ef send XWRELAY_RECONNECT 2005-09-02 06:26:33 +00:00
ehouse
e3cadfbf79 catch up with API changes 2005-09-02 06:24:47 +00:00
ehouse
6ebce9ff5e protect logging with mutex since happens from multiple threads now. 2005-08-21 14:54:49 +00:00
ehouse
a227dfd605 flesh out interaction with comms. Now able to play a complete game vs
linux version over GPRS.
2005-08-21 14:36:11 +00:00
ehouse
bef309be3f add stream_setOnCloseProc 2005-08-21 14:33:38 +00:00
ehouse
c0bdfb54c9 constant name changed 2005-08-21 14:18:56 +00:00
ehouse
a236d6a972 tweak how timers stored 2005-08-21 14:07:29 +00:00
ehouse
13d9e7e8c8 timeout isn't an assertion failure 2005-08-21 14:07:12 +00:00
ehouse
f77a4854b6 use renamed constant 2005-08-21 14:05:29 +00:00
ehouse
e8a94b670a rename constant 2005-08-21 14:04:32 +00:00
ehouse
abde767154 tweaks to logging and adding some message enums 2005-08-08 23:33:51 +00:00
ehouse
23739eee9b reduce interrupt-time logging 2005-08-03 01:17:49 +00:00
ehouse
ae91d38e45 Clean up and fix timer code. 2005-08-03 01:14:49 +00:00
ehouse
91abdb3bcc fix bug where client connecting before server would result in attempt
to forward packet to host not yet available.  Drop such packets now.
2005-08-02 04:57:13 +00:00
ehouse
170ad8f419 make overly verbose logging conditional 2005-08-02 04:56:08 +00:00
ehouse
1b40b1956e add const to match new signature 2005-07-30 02:44:42 +00:00
ehouse
dcb5783924 add vc60.pdb 2005-07-30 02:07:20 +00:00
ehouse
f6649e17f6 make some conn-related IDs conditional 2005-07-30 02:05:59 +00:00
ehouse
7d4700622e add cesockwr.o 2005-07-30 02:04:29 +00:00
ehouse
294ce5f513 Add and use driver for communication over TCP. Driver uses two
threads, reader and writer, on a single socket.  With this checkin a
connect request reaches the relay and a response comes back and is
passed to and recognized by the common code.  A full game should now
work, but hasn't been tried.  Nor is there any handling of socket
errors, retries, etc.
2005-07-30 02:02:49 +00:00
ehouse
aa27360761 tweak conn dialog 2005-07-30 01:51:24 +00:00
ehouse
9abf6f8970 add a const 2005-07-30 01:48:17 +00:00
ehouse
3ecc871515 begin work of allowing multi-device play over WiFi/Cellular: add
dialog to gather params, save 'em, and stub out send proc.  Still need
to debug a bit, and add threads to send/receive packets.
2005-07-23 15:31:21 +00:00
ehouse
24fb48008f cleanup for wince compile 2005-07-23 15:28:15 +00:00
ehouse
77d7bc9fa7 add const 2005-07-23 15:21:23 +00:00
ehouse
d6fac2014e add assertion on null string 2005-07-23 15:16:26 +00:00
ehouse
bc3515272c Get rid of unused param 2005-07-14 02:54:47 +00:00
ehouse
84ec7e38f2 Get rid of WinCopyRect-based method of drawing letters and values in
tray tiles, since it seems not to work on all versions of PalmOS.
Simply drawing seems fine where tested; will try close clipping if
erasure happens elsewhere.  Draw board-top stuff one pixel higher on
highres devices, and fix scoreboard being too narrow on high-res
devices.
2005-07-14 02:45:10 +00:00
ehouse
fc4fd3ea93 fix compile error 2005-07-13 12:35:38 +00:00
ehouse
3b12c4df87 syntax error 2005-07-09 15:36:39 +00:00
ehouse
8acfb31153 protect TIMER_HEARTBEAT for standalone platforms 2005-07-09 15:27:06 +00:00
ehouse
bf2e208d6f catch up with API changes 2005-07-09 15:26:12 +00:00
ehouse
9f694f74d1 wrap line 2005-07-09 15:25:51 +00:00
ehouse
e1d3eeaf2a don't use %c on ARM. Crashes due to my bad StrPrintF implementation. 2005-07-08 08:30:42 +00:00
ehouse
e537e29e87 new functions for measuring glyphs 2005-07-08 08:29:37 +00:00
ehouse
a16505727a Moving glyph-measuring code to drawing; fix for highres case. 2005-07-08 03:14:43 +00:00
ehouse
d3249d93ae Moving glyph-measuring code to drawing 2005-07-08 03:10:21 +00:00
ehouse
58728ae00d remove glyph-measuring API just added (since it belongs in drawing,
not dict)
2005-07-08 03:08:16 +00:00
ehouse
f082c6ad2e dict_tilesToString sig change; remove glyph-measuring API just added
(since it belongs in drawing, not dict)
2005-07-08 03:06:08 +00:00
ehouse
dc84bd22df dict_tilesToString sig change 2005-07-08 03:02:31 +00:00
ehouse
9e76871306 (conditionally) modify dicts to support getting height of platform
glyphs, pass into drawing code so can be fetched and cached, and
implement for Palm.  This is to allow drawing glyphs (like Danish's
A-with-circle) that are taller than normal without the visual padding
the rest can have.  So far works for 68K/non-highres.  Will not
compile for ARM yet.
2005-07-07 03:46:07 +00:00
ehouse
3b53363e16 Pass protocol version code with connect request, and return error if
it isn't what relay can handle.  Report error to user.
2005-07-06 01:36:52 +00:00
ehouse
77374484f8 ditch words without vowels 2005-07-06 00:58:44 +00:00
ehouse
5b3e5fbf18 name change 2005-07-06 00:58:20 +00:00
ehouse
d639e9ca45 Honor cookieID passed in connect message, falling back to cookie only
when the ID isn't set, and using it rather than assigning a new one
even if the game can't be found.
2005-07-06 00:54:38 +00:00
ehouse
f062a1f8f6 cleanup 2005-07-06 00:53:19 +00:00
ehouse
1ae6c010c9 Make cookieID a 32-bit value instead of 16-bit 2005-07-05 23:02:15 +00:00
ehouse
db6f6c258d move to using a formal table-driven state machine for each game (cref
object).  While it makes things more complex at this point, it should
make it easier in the long run to add error handling, timeouts, etc.
2005-07-05 22:05:37 +00:00
ehouse
d5858f7a21 add include file 2005-07-05 21:57:00 +00:00
ehouse
370c2f82f2 fix leak 2005-07-05 21:52:24 +00:00
ehouse
c3f5fb4639 cancel old timer before setting a new one 2005-07-05 20:59:42 +00:00
ehouse
327fb7b001 eliminate unnecessary setHeartbeatTimer call 2005-07-05 20:57:37 +00:00
ehouse
7d388c3a2a fix compile error! 2005-06-30 01:51:40 +00:00
ehouse
4f57cadd75 Refactor ce_dictionary_make so that it returns NULL rather than an
broken dict when the file's missing or corrupt.  Casts to stop
warnings.
2005-06-30 01:48:07 +00:00
ehouse
39669d9680 change dialog title when it's called from new game menuitem 2005-06-30 01:44:56 +00:00
ehouse
8fb0b4685a Refactor ce_dictionary_make so that it returns NULL rather than an
broken dict when the file's missing or corrupt.
2005-06-30 01:36:51 +00:00
ehouse
acd3bdf24b copy null byte along with rest of string 2005-06-28 04:42:08 +00:00
ehouse
4701ee8c34 update copyright year in about box 2005-06-27 06:05:14 +00:00
ehouse
978d840df7 put back functions that never should have been removed. 2005-06-27 05:45:28 +00:00
ehouse
78aefbefea fix description at user's suggestion 2005-06-27 05:23:14 +00:00
ehouse
c2fe26ec77 up version to b4 to match next tag 2005-06-27 04:01:51 +00:00
ehouse
6728862399 cast to stop warning on wince 2005-06-27 03:56:09 +00:00
ehouse
2871778cb7 remove logging 2005-06-25 05:44:30 +00:00
ehouse
e92234b324 cleanup: make module-local functions static 2005-06-25 05:43:56 +00:00
ehouse
8faf6a670c add default compile command 2005-06-25 05:43:04 +00:00
ehouse
f6a6827c59 fix compile warnings 2005-06-23 14:12:09 +00:00
ehouse
2fbfeee378 util_setTimer changes 2005-06-23 14:09:20 +00:00
ehouse
3054637842 heartbeats: send to clients in connection response; note when
heartbeat and other messages arrive; and periodically reap sockets
that haven't been active in long enough.
2005-06-23 04:26:44 +00:00
ehouse
e6b5d2d0e4 version to 4.2x 2005-06-23 04:23:06 +00:00
ehouse
fa945f74aa handle heartbeat timer and change to util_setTimer 2005-06-23 04:22:46 +00:00
ehouse
684697216d fix timer not getting drawn on highres screens; handle heartbeat timer
and change to util_setTimer
2005-06-23 04:22:27 +00:00
ehouse
3ab25c843b fix timer not getting drawn on highres screens 2005-06-23 04:21:35 +00:00
ehouse
5385c9f7dc BEYOND_IR now the default 2005-06-23 04:20:46 +00:00
ehouse
767de5a284 implement new util_setTimer, and handle heartbeat timer 2005-06-23 04:20:00 +00:00
ehouse
dfccb19667 convert util_setTimer to take procptr; remove timer call on board; add
heartbeat to comms that uses util_setTimer with new timer type.
2005-06-23 04:16:53 +00:00
ehouse
5e02ca1c86 first checked in. Seems to work. 2005-06-22 06:40:53 +00:00
ehouse
e2cbee1210 path to local copy of wordlist 2005-06-16 05:12:49 +00:00
ehouse
c57206f483 catch franklin up with recent API changes 2005-06-16 05:12:28 +00:00
ehouse
9d5ea796f3 don't draw board before it's set up 2005-06-13 14:51:21 +00:00
ehouse
001058da03 add a couple of consts to fix warnings 2005-06-13 14:34:01 +00:00
ehouse
9a09a24aab fix DEBUG compile error 2005-06-13 14:33:05 +00:00
ehouse
8eb0b50cec fix scrolling; resize board, enabling scrolling, when SIP is revealed.
And make it possible for user to reveal it.
2005-06-13 14:29:49 +00:00
ehouse
7c906a70ba add debug-version logging to catch dictionary corruption 2005-06-13 13:36:26 +00:00
ehouse
6c9caadd43 use clipping when drawing bitmaps, can center 'em. This fixes
overwriting borders when cells shrink when SIP is visible.
2005-06-13 13:32:06 +00:00
ehouse
5803496007 turn on scrolling by default 2005-06-13 13:24:15 +00:00
ehouse
b0e6ac2b7c add relay dir to -I list 2005-06-13 13:23:33 +00:00
ehouse
835f81582d fix typos 2005-06-11 15:32:34 +00:00
ehouse
69277eee0b first checkin for Danish 2005-06-11 15:32:09 +00:00
ehouse
c2297590eb fix incorrect signature that was causing all scores to be drawn as 0. 2005-06-09 14:18:55 +00:00
ehouse
cfa1a42fcd fix formatting; make board wide enough for timer. 2005-05-30 00:20:42 +00:00
ehouse
40634e33c6 add justification to draw_string_at to better position using pango. 2005-05-30 00:03:58 +00:00
ehouse
8c201ff01b give tiles a background color 2005-05-29 21:17:23 +00:00
ehouse
a83f1b46b6 Switch to GTK 2.n. 2005-05-29 20:40:38 +00:00
ehouse
3c23117a2a New fields in drawCtxt for pango-based text layout; other tweaks for
switch to GTK 2.n.
2005-05-29 20:39:01 +00:00
ehouse
7986e14d08 huge set of changes to get working with GTK 2.n. Type changes and
casts, rewrite of img-button creation, tweaks in startup ordering that
may not have been necessary.
2005-05-29 20:37:35 +00:00
ehouse
521de82234 huge set of changes to get working with GTK 2.n. Use pango for text
drawing, getting rid of all GdkFonts; get rid of clipping until I
understand why it was prevent all drawing.  Etc.
2005-05-29 20:32:48 +00:00
ehouse
2a39b6950f switch to g_signal_connect 2005-05-29 20:17:09 +00:00
ehouse
ae8a861098 formatting fixes; casts for GTK 2005-05-29 19:37:42 +00:00
ehouse
06e28770d1 make one formal param const 2005-05-29 19:31:09 +00:00
ehouse
4095acc327 casts to stop compiler warnings 2005-05-29 19:29:33 +00:00
ehouse
37dd97edf6 add NetLibGetHostByName 2005-05-01 18:23:28 +00:00
ehouse
af10fa0425 modify TARGET .prc name based on ARCH 2005-05-01 17:39:09 +00:00
ehouse
9c5971d36c implement usage() 2005-05-01 17:38:31 +00:00
ehouse
f702a75188 log incoming ip addr 2005-05-01 17:38:11 +00:00
ehouse
aef5cc3fc9 NetLibGetHostByName 2005-05-01 17:36:33 +00:00
ehouse
c56d76d743 add types for netlib funcs 2005-05-01 17:34:39 +00:00
ehouse
b1b9e96142 enable network-aware PNO build 2005-05-01 17:19:50 +00:00
ehouse
3d0530d30d fix crash by initing in right place. (modified and checked in from 9300) 2005-04-22 13:49:33 +00:00
ehouse
343e97a9ea catch up with interface change 2005-04-21 03:43:03 +00:00
ehouse
576e2ec447 finally check in bitmap drawing; tweak font selection to look better
on device.
2005-04-21 01:09:46 +00:00
ehouse
9fa68e4936 lots of little changes; cleanup and support ctrl functions 2005-04-20 12:13:20 +00:00
ehouse
df17fe4f1e reorganize; support ctrl functions 2005-04-20 12:10:05 +00:00
ehouse
d885af5386 count bytes sent 2005-04-20 12:08:33 +00:00
ehouse
92c2017cae use rwlock instead of mutex 2005-04-20 12:06:25 +00:00
ehouse
7036e53229 move to using rwlock 2005-04-20 12:03:58 +00:00
ehouse
12fc28315c more debug info 2005-04-20 11:59:08 +00:00
ehouse
40351e187b add several new commands 2005-04-20 11:57:26 +00:00
ehouse
54843e68bf fix warnings 2005-04-08 14:28:04 +00:00
ehouse
fdca4b0a88 add rwlock helper classes 2005-04-08 14:18:14 +00:00
ehouse
a809a057e4 mutex replaced by rwlock 2005-04-08 14:17:28 +00:00
ehouse
a50fe1d1be replace mutex with rwlock; move creation inside class so can be
controlled by same rwlock.
2005-04-08 14:15:23 +00:00
ehouse
7a15f44c12 move creation inside class so can be controlled by same rwlock 2005-04-08 14:13:25 +00:00
ehouse
423ff190ea turn on warnings 2005-04-08 14:11:00 +00:00
ehouse
9ee54bf8a3 don't assert after poll returns! Instead close socket on hangup. 2005-04-03 17:02:09 +00:00
ehouse
31e1a46087 separate internalization of comms from call to connect to relay since
the first must finish before the caller will have a valid reference to
comms.  call util_addrChange.
2005-04-03 17:00:59 +00:00
ehouse
0629dc5223 separate internalization of comms from call to connect to relay since
the first must finish before the caller will have a valid reference to
comms.
2005-04-03 16:58:36 +00:00
ehouse
de4af7c8ce add util_util_addrChange 2005-04-03 16:57:01 +00:00
ehouse
961ca6e256 add linux_util_addrChange (stubbed out) 2005-04-03 16:56:39 +00:00
ehouse
62b994e32e track whether running on POSE to work around NetLibSelect bug; track
whether addr needs re-resolving.
2005-04-03 16:55:38 +00:00
ehouse
b485deb357 add palm_util_addrChange; track whether running on POSE to work around
NetLibSelect bug.
2005-04-03 16:54:54 +00:00
ehouse
84cdcc8d30 remove unneeded param 2005-04-03 16:53:32 +00:00
ehouse
f5320a46bd deal with address change, esp of hostname, and separate name
resolution from socket opening.
2005-04-03 16:52:51 +00:00
ehouse
45621dffdb turn off linger on new sockets; use long enough timeout on name
resolution that can succeed on device.
2005-04-03 06:24:55 +00:00
ehouse
c5674701b9 catch up with api changes 2005-04-03 04:13:09 +00:00
ehouse
ad6de22306 add comms_getInitialAddr; protect against recursive sends 2005-04-03 02:49:04 +00:00
ehouse
3d27d0d882 add comms_getInitialAddr 2005-04-03 02:48:50 +00:00
ehouse
abc866af74 needn't open netlib from here! 2005-04-03 02:47:46 +00:00
ehouse
bf331a2805 fix for api change 2005-04-03 02:47:08 +00:00
ehouse
930b320011 first checked in. Works, but error recovery not done yet. 2005-04-03 02:46:31 +00:00
ehouse
3add8ccbf4 move generic send/receive stuff from palmir.c; tweak data structures
for relay scheme.
2005-04-03 02:00:44 +00:00
ehouse
8af072f8d9 move generic send/receive stuff from palmir.c. 2005-04-03 01:59:57 +00:00
ehouse
656bcac3aa modify ip-params dialog for new relay-based scheme, using new struct
fields and dialog objects.
2005-04-03 01:58:02 +00:00
ehouse
b6d3ad8a07 add XP_LD 2005-04-03 01:53:07 +00:00
ehouse
0839ce0337 remove ip-related stuff to new files 2005-04-03 01:47:34 +00:00
ehouse
b56b4f7b37 add palmip.c; change how upload works 2005-04-03 01:39:08 +00:00
ehouse
39185fef17 create new comms object if needed for non-first game 2005-04-03 01:36:59 +00:00
ehouse
e3151bdfe2 add command parsing and dispatch table 2005-03-31 02:20:50 +00:00
ehouse
a024c7ccd5 first checked in. works but not robust 2005-03-31 02:11:51 +00:00
ehouse
3f64d755b6 break up compile; new file 2005-03-30 02:00:15 +00:00
ehouse
db3ce42a4f this file owns thread creation now 2005-03-30 01:52:10 +00:00
ehouse
9dcec7d66c new include 2005-03-30 01:49:40 +00:00
ehouse
99d713bd8a first checked in 2005-03-30 01:47:55 +00:00
ehouse
855bc67b17 use new thread pool class 2005-03-30 01:42:28 +00:00
ehouse
64c7513867 cleanup 2005-03-30 01:32:02 +00:00
ehouse
3e476b3771 use system APIs to find stuff in app directory rather than hard coding
path.  Use system apis to find uniquie file names for games.
2005-03-26 03:25:44 +00:00
ehouse
663b3cc1a7 use c: drive, not z:, for uniformity with native version 2005-03-26 03:16:55 +00:00
ehouse
b64103ad7e don't use null comms 2005-03-25 13:41:18 +00:00
ehouse
3d40cc0e5c add cmd to lock/unlock main mutex 2005-03-25 03:24:00 +00:00
ehouse
97323636a9 use new stack-based lock 2005-03-25 03:21:16 +00:00
ehouse
a85716e8d5 first checked in. works 2005-03-25 03:19:03 +00:00
ehouse
b3432d4dfa check for null comms before using 2005-03-25 03:13:10 +00:00
ehouse
c9f60e758c don't instantiate comms unless it'll be used. Internally it has no
idea it's not supposed to connect to relay otherwise.
2005-03-25 03:11:54 +00:00
ehouse
3fd6998c2a add mutexes; general improvements 2005-03-25 02:59:44 +00:00
ehouse
120a3c1773 first checked in 2005-03-25 02:59:10 +00:00
ehouse
02c71850ee let socket server know how many connections to expect 2005-03-23 05:48:11 +00:00
ehouse
cf271c4411 fix shutdown panic by disposing fonts 2005-03-23 05:47:19 +00:00
ehouse
8b34f57bf9 don't kill socket when client connects before server 2005-03-21 05:30:55 +00:00
ehouse
dcebf5bc78 remove null-dereference when socket closed by two threads 2005-03-21 05:30:12 +00:00
ehouse
24690a2a10 too much logging 2005-03-21 05:29:37 +00:00
ehouse
f069c4c2dc "dead" is not a option for players 2005-03-21 05:29:08 +00:00
ehouse
d82f467479 load and save remote/local field 2005-03-21 05:28:27 +00:00
ehouse
f78ebee08b display remote players names in [] on scoreboard 2005-03-20 21:06:23 +00:00
ehouse
5eba6f5511 keep queue of incoming packets since new ones arrive before old can be
processed.  With this fix a complete robot-vs-robot game works between
9300 and gtk version over relay.
2005-03-20 21:05:41 +00:00