Commit graph

73 commits

Author SHA1 Message Date
John "Elwin" Edwards
c7cb905b29 RLG-Web: delay removing TermSessions until the client is informed.
Add a TermSession.sendq flag that indicates whether a type q message
has been sent to the client.  Don't immediately destroy the TermSession
on child exit if the message hasn't been sent.

This is an ugly hack until the TermSession class is separated into an
EventEmitter to handle the PTY and a listening object that handles
communication with the client.  That will also allow other clients to
watch the game.
2012-06-11 09:15:33 -07:00
John "Elwin" Edwards
20d72fc066 RLG-Web: make login sessions time out.
After enough inactivity, log the user out automatically.
2012-06-09 21:20:14 -07:00
John "Elwin" Edwards
a00bd32552 rlgwebd.js: remove some debugging.
Remove some residual debugging lines.
2012-06-09 13:04:46 -07:00
John "Elwin" Edwards
43f30438ed rlgwebd.js: add a player status interface.
Give information on a player's current status at "/pstatus/<name>".
Also fix some shift()/unshift() confusion in checkprogress().
2012-06-09 11:46:58 -07:00
John "Elwin" Edwards
e0a70e4b0e rlgwebd.js: refactor some game-starting code.
Separate things like checking for games in progress, starting a new
game, and figuring out where the lockfile and ttyrec should go.  This
allows e.g. the games-in-progress check to be used to create status
messages.  It also keeps the argument list for the TermSession
constructor to a sensible size.
2012-06-08 18:11:47 -07:00
John "Elwin" Edwards
012c86faa8 RLG-Web: separate logging in and starting a game.
The user now logs in with a username and password, receiving a token
which is then used for any actions requiring authentication.  Starting
a game is one such action.  Games use a different set of id keys.
This allows users to supply their passwords once and then play any
number of successive games.  Also, newly registered users do not need
to supply their passwords again.
2012-06-07 15:43:06 -07:00
John "Elwin" Edwards
fbc86e7e12 rlgwebd.js: remove dead code.
Remove functions that dealt with HTML forms and other obsolete code.
2012-06-06 10:08:31 -07:00
John "Elwin" Edwards
07c7ea3515 RLG-Web: autosave idle games.
If a game has been idle for too long, close it.
2012-06-06 10:01:18 -07:00
John "Elwin" Edwards
dec7bc108a rlgwebd.js: handle HTTP HEAD properly.
Prevent a message body from being sent in response to HTTP HEAD.
2012-06-05 20:13:47 -07:00
John "Elwin" Edwards
e0bbee0242 rlgwebd.js: add a status interface.
The RLG-Web server now makes its status and the list of current games
available to a GET on /status.
2012-06-05 14:51:42 -07:00
John "Elwin" Edwards
37e6447094 rlgwebd.js: improve MIME types.
Respond with the proper MIME type for JSON, and identify HTML as using
the UTF-8 charset.
2012-06-05 09:31:49 -07:00
John "Elwin" Edwards
6b209976d6 rlgwebd.js: listen on any address
The RLG-Web server now binds to any address instead of 127.0.0.1 only.
2012-06-05 09:22:17 -07:00
John "Elwin" Edwards
7e352fcc20 rlgwebd.js: fix reference error
httpServer needs to be in the global scope so shutdown() can find it.
2012-06-04 21:34:57 -07:00
John "Elwin" Edwards
bb17dd58a2 rlgwebd.js: become a real daemon.
The RLG-Web server now forks off, writes to a logfile, and reads from a
control socket.  Unfortunately it can't handle the problem of another
rlgwebd process already running.  Maybe a lockfile would help.
2012-06-04 20:45:27 -07:00
John "Elwin" Edwards
d0e3b1da2f rlgwebd.js: read commands from the console
The RLG-Web server can now be controlled with commands sent to stdin.
Currently, the only one implemented is "quit".  Some improvements to
the shutdown process were also made.
2012-06-04 14:21:41 -07:00
John "Elwin" Edwards
8599ec081d rlgwebd.js: add timestamps to log messages.
Wrap console.log() with the tslog() function, which prepends timestamps.
Clean up some of the messages as well.
2012-06-04 10:19:36 -07:00
John "Elwin" Edwards
53d5e7dd0d Implement message order correction on the server side.
rlgwebd can now correct for the client's messages arriving in the wrong
order, in theory.  I haven't found a good way of testing it yet.
2012-05-24 11:36:57 -07:00
John "Elwin" Edwards
c1856a6184 Fix some typos.
Some code copied and pasted without updating the variable names was
causing crashes.
2012-05-23 14:28:47 -07:00
John "Elwin" Edwards
2d86b63c98 RLG-Web: set up user directories on registration
Have RLG-Web create various user directories when a new user registers,
as dgamelaunch does.  Also add some debugging messages if registration
fails.
2012-05-22 21:44:38 -07:00
John "Elwin" Edwards
e36f058daf RLG-Web: add user registration
Update the server and client sides of RLG-Web to make use of the new
registration feature of sqlickrypt.
2012-05-22 20:54:33 -07:00
John "Elwin" Edwards
e7bcd4be4a rlgwebd: switch to dgamelaunch's SQLite database.
The quickrypt utility is replaced with sqlickrypt, which takes a username
and password pair and checks them against the SQLite password database
used by dgamelaunch.  This will be more extensible to using rlgwebd to
register, change passwords, etc.
2012-05-20 15:52:07 -07:00
John "Elwin" Edwards
94f8630eb4 RLGWeb: switch to JSON protocol.
Port the JSON communication from WebTTY to RLGWeb.  Fixing out-of-order
messages is still not implemented on the server side.  Terminal size is
still hard-coded.  Unused code is still lying around.
2012-05-17 09:32:19 -07:00
John "Elwin" Edwards
5b0be4c820 Call the dgl replacement rlgwebd instead of webttyd. 2012-05-07 16:08:59 -07:00
Renamed from webttyd.js (Browse further)