Commit graph

171 commits

Author SHA1 Message Date
John "Elwin" Edwards
6373e70361 RLGWebD: fix simultaneous player bug.
Multiple games can now run at the same time, and data will be sent to
the proper place.  The interaction of multiple players with watchers
has not yet been tested.
2015-01-09 13:06:41 -05:00
John "Elwin" Edwards
ef4cb9ac8d rlgwebd.js: clean up TermSession parameters.
Use the player name instead of a login key that has already been
verified and resolved to a player name.
2015-01-09 09:43:21 -05:00
John "Elwin" Edwards
ee8782bbf4 Remove the TermSession 'open' event.
Failure is now signaled with a TermSession.failed flag.

Playing two games at the same time no longer causes crashes, but it
does send the same output to both players.
2015-01-09 08:55:38 -05:00
John "Elwin" Edwards
2369fa45d4 Rename watcher to dglwatcher. 2015-01-07 13:49:37 -05:00
John "Elwin" Edwards
537c227f87 watcher: exit if errors occur. 2015-01-07 13:22:05 -05:00
John "Elwin" Edwards
3c88c233b4 rlgwebd.js: prevent races when reading ttyrecs.
DglSession objects read a 12-byte TTYREC header, extract therefrom the
length of the data chunk, and then read the data.  In between these two
reads, the file watcher could trigger another readchunk() invocation,
which might attempt to read a header from the beginning of the data
chunk.  This usually results in expecting a data chunk of several GB
and failing to create a Buffer for it.

The race is remedied by setting a flag on the DglSession object
whenever readchunk() is called, clearing it when both reads complete,
and refusing to read if it is already set.
2015-01-07 13:18:35 -05:00
John "Elwin" Edwards
547387846f rlgwebd.js: read ttyrecs created by dgamelaunch.
TTYREC files created by dgamelaunch are tracked by DglSession objects,
as a first step toward making them watchable.
2015-01-06 16:59:12 -05:00
John "Elwin" Edwards
2064d2a9e6 RLGWebD: overhaul the list of current games.
The /status WebSocket now only sends a complete list when opened.  At
40-second intervals, it sends a list of games that have been updated in
the last minute.  The client now uses this to keep its own list.
2015-01-04 16:55:57 -05:00
John "Elwin" Edwards
7e294b2136 Properly print session tags in the log.
They are Strings and should not be formatted with %d.
2015-01-03 20:07:42 -05:00
John "Elwin" Edwards
b7eb9ef98a RLGWebD client: fix watching. 2015-01-03 20:03:49 -05:00
John "Elwin" Edwards
abb4ba8f31 RLGWebD: Clean up code related to session timestamps.
TermSessions now store the timestamp of the latest data.  This removes
the need to use fstat() to calculate idle times.

The reaper() function is removed.  It may be useful to find another way
to remove old login keys.
2015-01-03 17:39:15 -05:00
John "Elwin" Edwards
c7fc6418ff RLGWebD: excise polling.
WebSockets are supported nearly everywhere now.

Listing current games and watching them are still broken.
2015-01-03 15:23:04 -05:00
John "Elwin" Edwards
920c6e8829 rlgwebd.js: get rid of numerical game identifiers.
Games will be indentified by gamename/username pairs.  This will allow
better interoperability with dgamelaunch.

Polling clients are no longer supported; the code remnants need to be
removed.  The reaper() function will likely crash.  Unexpectedly, the
WebSocket client still works well enough to play.  Watching and listing
current games are probably broken.
2015-01-01 15:56:22 -05:00
John "Elwin" Edwards
0a0f754135 Use posix.getpwnam() to look up UID/GID to drop to.
This is more reliable than hardcoding the numbers.
2014-05-12 08:59:47 -07:00
John "Elwin" Edwards
2e5e5d02da Keep a list of dgamelaunch games and put it in the /status message. 2014-04-01 16:43:35 -07:00
John "Elwin" Edwards
f605244ae6 Begin support for watching dgamelaunch games.
watcher.c is a subprocess which uses inotify to watch the inprogress
directories.  A C program is used because node's fs.watch() can't tell
the difference between creation and deletion.
2014-04-01 11:23:25 -07:00
John "Elwin" Edwards
e855ba2f58 Merge with poll-removal. 2014-04-01 09:20:11 -07:00
John "Elwin" Edwards
c818646ef6 Increase max username length to 20.
Length is now enforced by sqlickrypt.
2014-03-30 20:42:48 -07:00
John "Elwin" Edwards
0c75cdca4a Mostly finish README.txt. 2014-03-09 16:15:42 -07:00
John "Elwin" Edwards
64d9d8cd54 WebTTY: remove polling.
Communication now uses WebSockets only.
2014-01-27 16:02:27 -08:00
John "Elwin" Edwards
de69f47fc1 termemu.js: implement cursor hiding. 2014-01-26 19:56:02 -08:00
John "Elwin" Edwards
d5b4cb5de0 Implement another control sequence.
CSI c queries terminal attributes.
2014-01-25 22:10:01 -08:00
John "Elwin" Edwards
668f6d246d Check that the ttyrec stream has an fd before passing it to fstat.
The stream might not have an fd, presumably if the open isn't complete.
Calling fstat then causes crashes.
2014-01-06 09:11:35 -05:00
John "Elwin" Edwards
bc69ffcd64 Remove ptyhelper.c because the pty module has replaced it. 2014-01-01 14:13:10 -05:00
John "Elwin" Edwards
2708beece7 Add a README though it's still incomplete. 2014-01-01 14:11:40 -05:00
John "Elwin" Edwards
d1ed2c911a Use SVG for the bell icon instead of PNG.
Browsers that support WebSockets tend to support SVG too.  This also
removes the need to install Inkscape to convert the file to PNG.
2013-10-31 20:44:35 -07:00
John "Elwin" Edwards
cf4fd96592 RLGWebD: game binaries have moved to /usr/bin. 2013-10-28 22:11:14 -07:00
John "Elwin" Edwards
29edae364e sqlickrypt: add support for salted SHA-512 passwords, and fix NULL bug.
Passwords will now be securely encrypted with random salt.  Also avoid
storing NULL in the database, because that makes dgamelaunch segfault.
2013-10-20 21:19:13 -07:00
John "Elwin" Edwards
b760c1d444 RLGWebD: inprogress dirs have moved 2013-10-20 19:26:39 -07:00
John "Elwin" Edwards
49640d131e RLGWebD: use NODE_PATH to find modules. 2013-08-14 08:04:36 -07:00
John "Elwin" Edwards
d7df88f3cf WebTTY: use WebSockets when possible. 2013-07-22 07:51:53 -07:00
John "Elwin" Edwards
fabaea6849 Replace the daemon module with posix.
The daemon module doesn't include chroot() anymore, so a replacement
is needed.  Detaching a daemon keeps getting harder to do in Node, so
some setup has been moved into a shell script.
2013-07-20 12:23:53 -07:00
John "Elwin" Edwards
95fddfb788 termemu.js: handle some tmux-produced control sequences. 2013-07-18 10:43:41 -07:00
John "Elwin" Edwards
5b85a979e0 webtty: don't hardcode paths. 2013-07-18 10:36:58 -07:00
John "Elwin" Edwards
e0b1aa3668 Added tag beta6 for changeset e4f27a093d1e 2012-09-12 17:34:27 -07:00
John "Elwin" Edwards
b73bb2de18 Bump the version number. 2012-09-12 17:33:27 -07:00
John "Elwin" Edwards
ae626f11a9 Update the documentation. 2012-09-12 17:31:21 -07:00
John "Elwin" Edwards
b343678129 Options-related UI improvements.
Hide as-yet-unnecessary elements on the options page, and link the
home and options pages from each other.
2012-09-12 16:03:09 -07:00
John "Elwin" Edwards
363c88f00f Logins don't time out anymore.
No more login timestamps either.
2012-09-12 15:48:41 -07:00
John "Elwin" Edwards
75db6d0f73 Options page: improve some CSS. 2012-08-29 15:31:13 -07:00
John "Elwin" Edwards
a1f56007d0 Options page: handle not being logged in.
The options page now displays whether or not the user is logged in.
2012-08-29 07:55:26 -07:00
John "Elwin" Edwards
eb2e44e13e Make the options page functional.
The options page now uses the /uinfo interface to change e-mail and
password values.
2012-08-28 17:38:25 -07:00
John "Elwin" Edwards
0f71a90f8b Initial layout of the options page.
Now that login keys persist, the options can be put on a separate
page.  An as-yet nonfunctional layout for options.html has been added.
2012-08-27 21:28:10 -07:00
John "Elwin" Edwards
16e66858c0 RLG-Web client: store login key in DOM Storage.
Keep the login key in sessionStorage.  This lets the user navigate
away and return without needing to log in again.
2012-08-27 13:43:12 -07:00
John "Elwin" Edwards
47cc4d29b6 RLG-Web server: allow changing e-mail and password.
Logged-in users can change their e-mail addresses and passwords with a
POST to the /uinfo interface.
2012-08-26 19:04:57 -07:00
John "Elwin" Edwards
48b5b5d32a Improve the /uinfo interface.
Change the URL scheme to /uinfo/<property>?key=<key> because that makes
more sense.
2012-08-25 19:33:31 -07:00
John "Elwin" Edwards
81e772545a Add a user information interface at /uinfo.
User information can be retrieved at /uinfo?key=<login key>&<prop>.
The only property currently retrievable is email; eventually these will
also be settable via POST.
2012-08-13 09:07:28 -07:00
John "Elwin" Edwards
acae714a6b sqlickrypt: fix typo in database filename. 2012-08-13 08:53:46 -07:00
John "Elwin" Edwards
1bb3671a58 Improve the probability of detecting numpad 5.
Firefox now, in some circumstances, thinks numpad 5 is the clear key,
with keycode 12.  This makes it detectable.
2012-08-12 08:22:55 -07:00
John "Elwin" Edwards
51978efd4e Correct the clear sequence for srogue.
rlgwebd sets TERM to xterm-256color, which uses CSI H CSI 2J to clear
the screen.  The description of srogue had been CSI H CSI J, which is
the sequence for screen.
2012-08-11 21:30:12 -07:00