TADS 3 Chat extension for the webui by Tomas Blaha
==================================================

This is a very simple and rather uncomplete chat extension for TADS. I've
put it together as a learning exercise just after Mike released the Web UI
support in TADS, but didn't have the time to finish it so keep in mind
that this is rather a study material than a complete extension.

It basically works, but lacks an UI to change player's nick names.

How to use
----------

Just copy webuires folder, extensionChat.t and extensionChat.tl into your
game's folder. Then add "-lib extensionChat" into your Makefile.t3m. Your
Makefile.t3m should look similar to this:

  -DLANGUAGE=en_us
  -DMESSAGESTYLE=neu
  -DINSTRUCTIONS_MENU
  -DTADS_INCLUDE_NET
  -FC -Fy obj -Fo obj
  -o your_game_binary.t3
  -lib system
  -lib adv3/adv3web
  -lib webui
  -lib extensionChat
  -source tadsnet
  -source your_game_source

After you run your game, you'll find command "open chat window" under the
little triangle in top right corner.

How it is working internally
----------------------------

Don't forget this is a quick hack born as an exercise to learn about the
new web UI. I didn't need to program much, almost all of the source code
is just a copy of Mike's library code with few little tweaks.

Chat windows is the same WebCommandWin used for gameplay, just it didn't
pass player input to the interpreter. That's the only thing missing in
receiveInput() method, otherwise is the same as in command window.

Additionaly there are two resources on virtual path to open and close chat
window and the last part is initDisplay() which is again the same as in
the library only tweaked to create different layout on the screen.

How to connect guest players to a running game
----------------------------------------------

This is probably not documented anywhere but when you start webplay game
session, you can connect additional human players to it and play one game
cooperatively together. Once the game is started and hosting player
connected, do a request to virtual resource /webui/guestConnect appending
session id and you will receive a new URL (with different session id) for
guest to connect.

For example when your game runs on:

  http://tads.cz:56695/?TADS_session=d2be49ec-d7d6-4245-016e0270eb36-7f72

then make a request on:

  http://tads.cz:56695/webui/guestConnect?TADS_session=d2be49ec-d7d6-4245-016e0270eb36-7f72

to obtain guest connect URL.
