Commit graph

214 commits

Author SHA1 Message Date
John "Elwin" Edwards
4c27e44ef8 RLG-Web client: adjust polling for watching.
The ajaxterm state machine assumed data appears in response to user
actions, which is not true when watching.  It now uses different sets
of parameters for playing and watching.
2012-06-20 07:41:59 -07:00
John "Elwin" Edwards
674f570b63 rlgwebd.js: fix failure to respond.
The codepath for a watcher requesting to quit did not lead to any
response being sent.
2012-06-20 07:37:15 -07:00
John "Elwin" Edwards
0e31c3a3b7 RLG-Web client: initialize and restore the terminal when watching.
Since watchers might not get the curses initialization and ending
sequences, the terminal emulator needs to be set up for and restored
after watching.
2012-06-19 20:08:05 -07:00
John "Elwin" Edwards
5f914901d1 Make sure watchers start with completely drawn screens.
TermSessions now buffer all data since the last screen clear, so new
Watchers can start with complete screens.
2012-06-19 19:11:59 -07:00
John "Elwin" Edwards
67f187700c RLG-Web client: implement watching.
It is now possible to watch games currently being played through
RLG-Web, but not dgamelaunch.  Also, there are some deficiencies, like
getting chaos until an absolute cursor addressing happens.
2012-06-19 16:19:50 -07:00
John "Elwin" Edwards
553f07360c Move credentials into the drivers.
The session id, or whether the session is currently active on the
server, are better handled in the drivers than in termemu.js.
2012-06-19 13:40:30 -07:00
John "Elwin" Edwards
ceed48eee5 RLG-Web client: explain when there are no games to watch
If no games are available for watching, display a message saying so
instead of showing an empty table.
2012-06-18 16:53:44 -07:00
John "Elwin" Edwards
2bdd26b2f4 RLG-Web client: display a list of current games.
Incorporate information from /status to create a list of ongoing games.
Eventually these will be watchable.
2012-06-18 14:30:05 -07:00
John "Elwin" Edwards
1ffb72866a RLG-Web: make multiple watchers possible.
Split the TermSession class into the new TermSession, which handles the
PTY, and client classes, which handle HTTP sessions.  These are Player
and Watcher.  This allows multiple watchers per game, and other
improvements.
2012-06-18 13:43:51 -07:00
John "Elwin" Edwards
41b3389ec0 termemu.js: don't warn on certain control sequences.
Don't print a debug message for some control sequences that technically
are unimplemented, but would just put the terminal into the only mode
yet implemented.  CSI 4l and CSI ?7h are like this.
2012-06-15 16:23:57 -07:00
John "Elwin" Edwards
e57cafa5e0 Added tag beta1 for changeset ab82ae1ba793 2012-06-11 14:11:27 -07:00
John "Elwin" Edwards
76dd2ff70b RLG-Web: indicate beta status.
Due to the various improvements and testing, the project's status has
been promoted.
2012-06-11 14:09:54 -07:00
John "Elwin" Edwards
17159bf823 rlgterm.js: don't make nonfunctional button.
The "Game in progress" text shouldn't look like a button, because
clicking it doesn't do anything.
2012-06-11 14:04:35 -07:00
John "Elwin" Edwards
b24bf3b972 RLG-Web client: improve the forms.
Put the forms into CSS tables so they look nicer.  Also remove the
<form> elements so they won't be submitted as forms.
2012-06-11 12:00:44 -07:00
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
74ee771a72 RLG-Web client: visual improvements.
Switch some buttons to span.ibutton style.
2012-06-09 21:42:24 -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
aba0a4b7da rlgterm.js: make the options table functional.
Enable launching games from the options table, and replace the old
select dialog.
2012-06-09 17:00:25 -07:00
John "Elwin" Edwards
d3abfbcea9 RLG-Web: put the game options into a table.
Create a nice table of options when the player logs in.
2012-06-09 15:22:56 -07:00
John "Elwin" Edwards
2e35e55925 rlgterm.js: present game options to the player.
Use the new player-status interface to display the state of any ongoing
games when the player logs in.
2012-06-09 14:13:07 -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
7e88c7cdc3 rlgterm.js: fix failure to recognize end of game
The RLG-Web client was failing to realize the game was over, because
a test was checking against the entire response instead of the proper
field in the response.
2012-06-09 10:44:11 -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
94e9fa330c RLG-Web: reduce polling further.
The ajaxstate object now reduces polling to 15-second intervals and
stops entirely after one minute.
2012-06-06 10:53:29 -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
520226a343 rglterm.js: reduce the server polling.
For roguelike games, most output will directly result from and follow
immediately after input from the user.  In other situations, data
should not be expected.
2012-06-05 22:33:41 -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
44ccfd87a3 RLG-Web: indicate alpha status.
Add some alpha glyphs to index-rlg.html.
2012-06-05 14:55:33 -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
6ed3b7c2ce sqlickrypt.c: finish switching to parametrized queries.
sqlickrypt should now be injection-resistant.
2012-06-03 18:26:11 -07:00
John "Elwin" Edwards
41c84bcd40 sqlickrypt.c: begin converting to parametrized queries.
Switch the check() function to use parametrized SQL queries instead of
contructing statements with strcat(), for obvious reasons.
2012-06-03 17:08:40 -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
018adf9acf RLG-Web client: some cleanup
Separate RLG-specific CSS into its own file, fix some typos.
2012-05-23 07:46:08 -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
dfbd2a71d0 sqlickrypt.c: add the ability to register new users.
When sqlickrypt is run with the option "register", it expects a
username, password, and email, and adds them to the database if the
username is not already in use.
2012-05-21 21:40:56 -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
db55f3f83c webtty.js: check message order.
Implement checking the numbers of the client's messages on the server.
Fixing out-of-ordering isn't implemented because the problem hasn't
been observed yet, though it likely will once actual network transit
is involved.
2012-05-15 16:26:28 -07:00
John "Elwin" Edwards
c7995adad5 shterm.js: Client-side message ordering
Make sure data from the server is written to the terminal emulator in
the correct order.  Out-of-order messages are stored in a queue until
their turn comes.
2012-05-15 09:30:12 -07:00