35 Commits

Author SHA1 Message Date
Auke Kok
3099dd6228 Attempt to allow empty lines in telex/files.
These were previously filtered out. Unfortunately now there's some
awkward emtpy lines in various places, but, I prefer having empty
lines show since that makes typing much simpler.
2019-10-04 22:15:06 -07:00
Auke Kok
7a69c6c733 Convert telex to store mesages in a more scalable way.
I was severely worried about `mbox` and `spool` becoming way
too large way too quick - We just can't store the entire array
of full messages in there all the time.

Instead, both those arrays become simple string arrays of `msgid`
objects, which are nothing more but simple numeric strings. Each
message can now live in mod_storage which should scale a lot better
and make player mboxes a lot smaller - it can now easily hold a few
hundred messages without growing much.

This means all the messages are in mod_storage. We can at a later
point perhaps consider compression.

There's compat code to read old mbox formats, but not spool. Thus
the server spool must be empty when this code is deployed.
2019-08-21 22:47:57 -07:00
Auke Kok
139dd7a2af Make sure telex + random command doesn't crash the server. 2019-08-07 22:21:17 -07:00
Auke Kok
4838ebec5c Don't error out when arrow keys used.
Fix the logging here so we can figure out which events are
causing the messages.
2019-08-07 22:14:18 -07:00
Auke Kok
702639ea56 Add telex reply n.
This allows players to quickly respond to an existing message
and send a quoted reply to the original user. The reply is
a new draft that has the message quoted and subject prepended
with "Re: ".
2019-08-07 21:32:42 -07:00
Auke Kok
a1f484a2f2 Fix terminal destroying context.
After a draft or edit, the terminal always left the context in an
invalid state. I finally found this terrible bug that's been making
the terminal difficult to work with... `button_exit` can _not_ be
used if the context is to be preserved. Of course we also forgot to
properly store the output for the context.
2019-08-07 21:31:16 -07:00
Auke Kok
89e86ba692 Add some logging to the telex mod. 2019-07-31 17:41:04 -07:00
Auke Kok
66f71baaec Telex mod and terminal integration.
This is a simple backend `telex` mod that takes care of encoding,
storing, spooling and handling mail delivery for players.

Everything is in StorageRef objects. The spool is global and contains
undelivered msgs. Each user has an mbox. These can likely grow
out of bounds and may need size checking to prevent corruption.

The Terminal mod provides the UI. a `telex` command exists and it
has subcommands for send/read/list and working with drafts. The
draft is stored in the player StorageRef and is persistent. This
makes editing and sending messages to more people doable, and you
can re-edit your message later.

There is no SENT folder or anything like it.

There is no REPLY subcommand, but I do intend to include it.

Messages do NOT get delivered to offline players. Those remain
in the spool for 3 days. If the player does not log on, the mail
is RETURNED UNDELIVERABLE. If the returning does not succeed within
30 days, the message is DROPPED.
2019-07-30 23:19:04 -07:00
Wuzzy
aa7ab7b0ff Missing or wrong node sounds
A couple of nodes have missing or wrong node sounds:

    nodes:hardened_clay*: Plays no sound (suggested sound: stone sound)
    nodes:chest_with_*: No sound (suggested: wood sound)
    nodes:flowerpot*: Plays wood sound (suggested: stone sound)
    nodes:vine*: Wood sound when climbing (suggested: leaves sound)
    terminal:terminal: No sound (suggested: metal sound)
    nodes:tnt: No sound (suggested: wood sound)
    signs:bg: No sound (suggested: stone sound)
    All doors and fence gates: No sounds for placing/digging
    frame:*: No sound (suggested: wood sound)
    signs:sign_wall: No sound (suggested: wood sound)

Special cases:

    Trampoline: Wood sound
    Waterlily: No change, still no sound (leaves sound would be too odd here)
    Lava: Sound removed
    boxes:nexus: No change, I have no good idea
    Sponge: Dirt sound
    Rope: Sound removed (other sounds just don't fit well)
2019-04-15 21:08:52 -07:00
Wuzzy
c72d0ecba9 Consistent writing style of item descriptions
- Fix capitalization
- Fix ungrammatical word order (like “Wood dark”)
2019-04-13 23:52:11 -07:00
Auke Kok
80cbd6d34a Add license headers to all lua files.
Some of these are copies from the respective origins from mtg,
to make sure we have headers everywhere listing the proper code.

I've relicensed spectator_mode from WT*PL to LGPL-2.1. No other
licenses were changed.
2018-06-21 22:56:48 -07:00
Auke Kok
44e0ef1647 fsc: secure formspec code.
Implemented for terminal, and signs, rules, inspector and creator interface code.

Also, fix a bazillion usability bugs in here.
2017-12-27 17:46:00 -08:00
Auke Kok
6c05073103 Mark a bunch of node meta private.
These are all the bulky ones that the client never needs.
2017-11-25 15:04:14 -08:00
Auke Kok
6755a45f91 Add creator rules. 2017-11-25 00:07:19 -08:00
Auke Kok
c1947cb5f9 Rules: Dynamic 'rules' file. Easier editing. API. 2017-11-24 22:59:09 -08:00
Auke Kok
a292bb7ffa Don't hardcode help lists. 2017-11-19 17:48:32 -08:00
Auke Kok
b99b365e62 Add a small log helper mod so all mods can use log.fs_data() 2017-10-24 10:29:11 -07:00
Auke Kok
b063c584ab Terminal: edit function.
opens a normal text editor window, allowing anyone to edit a text
file in the normal way one edits a file. After saving, the view of
the terminal is restored.
2017-10-19 23:12:44 -07:00
Auke Kok
8d11dccd91 Make terminal error and help much more verbose. 2017-10-09 16:22:00 -07:00
Auke Kok
a01fb5c7db Validate at least a valid context for the terminal. 2017-09-18 21:32:17 -07:00
Ekdohibs
d80181f86a Add trigger = 1 group to all nodes that can send triggers or untriggers. 2017-09-10 21:45:41 +02:00
Auke Kok
47b8ebff8c Try and guard against terminal delete & rewrite bugs.
Always make sure the parse_json() nil is caught.
2017-09-03 23:43:16 -07:00
Auke Kok
70f069f1eb nil check for files in the terminal write code. 2017-09-02 23:58:03 -07:00
Auke Kok
003cc38c21 Sounds: move them into sounds mod, add electric humm for mech.
Most of the active mech nodes now make the humming sound, which
is very low key but still audible.
2017-03-28 21:35:24 -07:00
Auke Kok
5743835081 Add "try help" after syntax error. 2017-03-22 20:58:20 -07:00
Auke Kok
6e0bead595 Prevent terminal from locking if no write access. 2017-03-22 20:54:36 -07:00
Auke Kok
3cacb18596 Locked terminals can't send triggers. 2017-02-24 12:03:45 -08:00
Auke Kok
3fea5bdfc5 Terminal sounds.
- power on/off. Also heard when locking and unlocking.
- keyboard clicks, several samples play when tying commands.
2017-02-23 11:23:28 -08:00
Auke Kok
3398247039 Opening a terminal sends a signal. 2017-02-22 23:21:45 -08:00
Auke Kok
bbac6ab47d Forgot to rename one context. 2017-02-20 11:32:38 -08:00
Auke Kok
b8df93c540 Fix shadowing luacheck warnings. 2017-02-19 21:26:07 -08:00
Auke Kok
18ac41f5f1 Small fix for rw terminal access. 2017-02-19 17:49:12 -08:00
Auke Kok
a7f00b8b41 Check for rw/ro access where needed.
Prevents write access to box players. Only server privs
allow editing boxes outside boxes.
2017-02-19 11:38:27 -08:00
Auke Kok
59b90ff23d Fully functional terminal.
- read/write/append text files
- list files, remove files
- lock and unlock terminal with mech triggers
2017-02-18 23:33:17 -08:00
Auke Kok
38a1f4e904 Proto terminal interface.
Still doesn't do much yet, but the terminal code is somewhat
working. Need to limit output to ~16-18 lines. Implement locking
with triggers unlocking, input of text files, file/folder structure?
2017-02-18 00:14:20 -08:00