-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTODO
More file actions
375 lines (366 loc) · 19.8 KB
/
TODO
File metadata and controls
375 lines (366 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
TODO before release:
-----
rename directories: h -> include, o -> .libs
h/String.h -> STL string
h/List.h -> libstdc++
install should ignore CVS/ directories.
Rewrite terminal handling, use TERMIOS
-> Split screen scrollback
-> /window, /exec interface
-> Handle SIGWINCH
-> Use multiple input lines/status bar (multiple line status bar)
-> Replace all TTY stuff with ncurses stuff (man ncurses)
Repeat -> C++, with inverse last command a la zmud.
Commands -> static autocomplete
Perl eval: %
Evaluating commands ('/') in send
finish removing one_argument, convert to OptionParser.
Make all keys in InputLine.cc be KEYPRESS hooks.
#ifndef BLAH_H protect all header files.
Uniform way of handling errors. report() and error() should be used in the code,
and configurable so that they are printed to the screen (w/attribs?) or displayed
in the status bar.
/config command to handle what used to be /disable and /enable.
Error when 'sudo su - bob' and then run dirt (tty permissions)
Config.cc needs to be rewritten
Keys in Hotkey.cc, should be rewritten as individual hooks.
Remove restart via alt-t? Seems such a kludge.
Chat subcommands in Chat.cc: handleUserCommand should all be hooks.
Where did this message come from: @@ Dumping %Config to file
when running dirt as 'bob'?
Where does this message come from: read -1 bytes from socket 8, errno: (0)...
when running more than one copy of dirt on the same machine.
Seems that the second copy read()'s in a loop, spamming the CPU.
Commands to easily open a connection to a new mud, add a new mud, etc.
Editing hooks/aliases/triggers could simply copy the /trig (etc) line to the command line.
for instance, when you hit 'e' from the window listing all triggers.
Change Session.cc so there are less string copies (triggerCheck, in particular)
merge triggerCheck() with inputReady?
Retromud prompts are not grabbed. Does retromud use Telnet GA?
prompt seems to work for Abandoned Reality, but prompt is not removed from mud output.
*^H style prompts.
Titles, top/bottom messages for windows.
after a /clear, text appears at *bottom* of a window.
Window is not painted in background color -- tab, end of lines are unpainted. (when scrolling)
Use hash_map to store Windows by name for fast access (keypress hook)
Option to 'croak()' on perl errors?
When output is redirected to a file, screen (even more) badly corrupted. Could be an indicator
of which drawing routines are depending on tty, and which ones are using "print".
Write Python exception handler a la SIG{__WARN__} in perl.
Rearrange StackedInterpreter, so everything doesn't fail...what to do if both interpreters
define a given function? What to do if only one does?
/eval for python doesn't return values: /eval -rLpython 1+2
Make sure in all circumstances, only ONE embedded interpreter attempts to run a command
(re: /hook -f tries both...)
/hook -t"^(.*)$" -TOUTPUT -F printuncolored = /eval print "\$1\n";
generates an error, as more output is received, dirt starts disabling *other* hooks,
but not this one!
Perl warnings from hooks should print the hook name.
/hook -t"^(.*)$" -TOUTPUT -F printuncolored = /eval print "$asdfasdf\n";
/eval -- print $Trigger::Triggers{'zsays'}->{'t'}
doesn't work...
Key: alt-n, alt-p for next, previous match (alt-/)
Is ProxyWindow used at all? (remove it)
Lines that wrap are missing the first character on the wrapped line.
Auto-hook disabler seems to disable the next hook run after an error (which is not always
the same hook!) i.e. make a bad /trig and then type something -- it will disable tab_complete.
Consider a "gag" attribute: will still allow all hooks to match (and modify!) the line,
but when it gets to the end, it will not be written to the screen.
Error parsing init script (i.e. trigger.pl) causes obscure error with no backtrace.
error in parsing gag.pl generated NO message AT ALL.
Killing help window causes help to misbehave. Check for window and recreate it if necessary?
/delay, /repeat, or /run command that will let me schedule something to be sent.
Should Window::focused be static?
/input, /inputline like command to set input line.
xterm doesn't send alt- key sequences properly...
/gag -Ft'^\\s*$' blankline
doesn't work...because the string to be matched is "", and when it is gagged it is
replaced with "" -- and dirt detects that they are the same. Need another way to do
gagging since "" is a valid mud output line. (after crlf stripped -- maybe leave in
crlf for triggers?)
See Session.cc:693 (Session::triggerCheck)
Try to initiate a ytalk with the dirt terminal...hang? no...just fucks up the screen.
Turn mesg n on dirt startup...
Make a perl class to do a scrollable text box (/help) and one to do a selection
list box (/alias, /trig, /gag, etc)
Add options to /group to do most /hook operations, on the WHOLE GROUP.
Do the same with hook? If no =, then try to change the attributes of a hook?
Focus mechanism:
Keypresses which go with a "focused" window should grab higher priority when active.
Should not be able to pull up command history while in scrollback
Keypresses for modal windows (/help) should have higher priority than
background keys (scrollback)
What about /help, history combo? Who should get up/dn pgup/pgdn?
help should trap up/dn to prevent history from popping up.
Option to use favorite language for /echo? (i.e. /echo -> /eval print
"<args>\n" so variable expansions work)
Saved.pl should not be clobbered if it has been modified since last loading.
/alias crap = crap $2 $1
hangs dirt.
Hooks without a matcher will not have RHS expanded as a quoted string. Is this bad?
Numpad doesn't work in xterm.
up/down doesn't work in eterm.
/paste /nopaste commands (when /paste is active, all user-typed commands have the
argument to /paste prepended)
/help doesn't behave so well if window is too small.
SEND, COMMAND hooks: rather than using regexes, grab first argument and then
look in hash_map to see if it is a command (/hook -C)
problem with multiple hooks with same name?
Convert usage of "Sprintf"...or not?
http://www.bero.org/clap/classString.html
child of string that adds useful routines (like sprintf)
/aliases should be added to static autocomplete list.
/aliases should be mud-specific. Mud name is in $mud. Modify config.pl
Define keypad-walking hooks in C++, with group "numpad"
Write script to convert existing mclrc files
/set command to set config variables. (stuff in dirtrc)
/set debug command to turn on debugging. For instance, print which hook catches
a line of output. See Hook.cc:199 (Hook::run).
Also, print ${color_code} rather than colors, so people can write regexes that match.
/enable blah;/hook -l blah
-- semicolon parsing should come before command parsing.
Recursion counter like tf has.
How about this:
Allow perl regex like syntax on the command line:
/hook -t /this is a regex/ -F blah = blah
/hook -t /this: (\w+) will match any word/ -F word = /echo $1
/hook -t /this: won't give a warning about unmatched quotes/ noquotes = /echo woo!
Quoted regexes are subject to normal parsing rules.
Denote some regex delmiters and find the end the same way as in FilterProxy.
From perl: &run should take arguments:
&run("/hook myhook = /echo shit", '-t' => qr/this is a regex/);
any option given in the hash that follows will be transposed onto the command line
with the proper escaping.
Is this possible:
&run("/hook -t'" . /my regex/ . "' -F shit = /echo shit");
prompts terminated by an empty packet? (Some Diku's, apparently...try
duntroon.xidus.net:7000) How to detect this? Seems to be a TCP Ack.
Consider putting things on the prompt line if nothing has been received in
a few ms.
So for these kinds of muds use these options:
showprompt=0
undelim_prompt=1
Mud-specific options: showprompt, undelim_prompt, echoinput.
Or do things like TinyFugue with DIKU, LP, Telnet-style muds?
echosend option (mud-specific)
Print to screen commands as they're sent (as if you had typed them in telnet)
stuff into input buffer, as undelim_prompt does now.
when creating a /command, give option -A to create an anonymouse perl function.
the anonymous perl function should call getopt and create $opt_.. variables
for any args, and split args into @_ so commands can use positional arguments.
command parser seems to be grabbing the wrong equals sign:
/command -F repeat = /eval -Lperl '@ARG = split(/\\\\w+/,$_); run("/echo found repeat $_")'
or not...why doesn't this work when the equal sign is in there?
/command -F repeat = /eval -Lperl \@ARG = split(/\\s+/,"$_"); for(\$i=0;\$i<\$ARG[1];\$i++) { run(\$ARG[2]); }
Instead of escaping *everything* treat the RHS of /eval as a quoted string
and generate a function like this:
sub { $_ = "$_"; eval "$command"; }
Grab Portal mud information:
http://www.gameaxle.com/PortalMIP8-0.pdf
Note howto get key name: key_name(key) (see old Screen:keypress)
/enable -T repg does not tell me that there is no trigger named 'repg'!
Keypress hooks really need to be passed the cursor position.
Other hooks really need to be passed the parenthesized subexpression matches.
...consider adding another parameter to HookStub::operator()...
History::loadHistory does not deal well with long lines in history file (segfault)
autocomplete does not move cursor to end of line (again, perl needs to see cursor_pos)
How about 2nd arg to operator() being a struct union?
struct {
int key; // KEYPRESS
int cursor_pos; // KEYPRESS
string& mudname; // CONNECT
void* subex; // pointer to a perl list of ($1, $2, $3...) what about python?
// can we count '(' to determine how many subexpressions? How about string[] instead?
// $#+ returns number of subgroups in last successful match
// Need to store ($1...${$#+}, $&, $', $`, @-, @+)
// or just store mud line and trigger regex, and re-do matching just before
// calling the perl function.
string& data;
} hook_args;
Hook::run(HookType type, string& data, hook_args arg)
How to pass this to perl? (as arguments?)
Can save regex results with @shit = ($line =~ /$regex/) plus %&, $', $`
The command stack needs another void*.
dequeue<pair<string,void*> > commands; // Interpreter.h:39
Is one extra piece of data enough?
string void*
COMMAND = 0, // /command string& re
USERINPUT = 1, // what she typed string& re
SEND = 2, // c-ogres string& re
OUTPUT = 3, // The small box sh... string& re
LOSELINK = 4, // mud name
PROMPT = 5, // > string& re
INIT = 6, //
DONE = 7, //
KEYPRESS = 8, // input line key, cursor_pos (make cursor_pos global?)
CONNECT = 9, // mud name
IDLE = 10 // time
Provide PerlEmbeddedInterpreter::submatch(int n) that returns $n.
Evaluate string as perl quoted expression in writeMUD. (end of SEND hooks)
make a config option for this for people that want to send [$@%&] to their mud.
Hook argument: -q evaluate RHS as a quoted expression. :)
The RHS of a hook will be evaluated as a quoted string UNLESS the first
char is a '/'. If it is a '/' then the mud line and matcher will be saved
for the point at which the RHS is evaluated.
Add note in docs that you can't combine /commands and mud commands with semicolons:
drool;/echo $foo;fart
I don't think I like Saved.pl. Make a stream-out and stream-in so that .dirt/Aliases,
.dirt/Triggers, etc. have same format as people type them (/alias blah = blah).
/bell;/bell doesn't work. Also need /beep that is same as /bell.
Comment out Option.cc:194? Not needed? Is s_nonopt already unquoted?
For COMMAND hooks, -t should ignore leading / (so that switching cmdChar doesn't
hose all your perl scripts).
Place arguments in @ARGV to discourage people from doing:
/hook -T COMMAND -t'/mycmd ([a-z]+) ([a-z]+)' twoargs = /run mycmd
Make -t mutually exclusive with COMMAND
Remove dirtCommand
Tokenizer (use in Option.cc?) http://www.boost.org/libs/tokenizer/index.htm
PerlEmbeddedInterpreter::match determines if the match was successful by grabbing $_
and seeing if it is empty. This will FAIL if commands is empty...
/hook -t'shit' myshit = /run myshit
doesn't work because if the RHS modifies the mud string and is fallthrough,
hooks of lower priority won't see the modified string. Why did I decide
not to evaluate the RHS immediately?
because of the interaction between /command RHS' and mudstring RHS'.
if the RHS is '/run crap' and a higher priority hook is just 'foo',
any mud commands generated by the perl func &crap will be sent to the
mud before 'foo'.
run("foo") goes to interpreter.add("foo") via InterpreterPipe::inputReady()
so running things will get done in the correct order even if the RHS is
evaluated immediately for /commands. Printing things will not. Consider:
/hook -Ft 'shit' -p 10 myshit = /eval print "found some shit\n"
/hook -Ft 'shit' -p 0 myshit2 = /echo found some shit2
Upon seeing 'shit' in the mud output, the second version will print first,
despite having a lower priority.
/echo sends data directly to outputWindow->printf()
perl's print() sends it to the output pipe which is read with
Selectable::select()
>> Changed /echo to use cout, make sure it works...
It is desirable to modify the mud string, consider the prompt case. A naive
regex like "/hook -Ft'shit'" would match twice if the prompt string sent the
mud line through twice.
Debug mode for hooks. Dump everything that matches.
/debug <HookType> -- dump the names of hooks that matched the HookType
/hook -lt 'adsf' -- list the hooks that will match the string 'adsf'
/hook -l -T COMMAND -t 'asdf' -- etc.
Print an error message if a /command isn't caught by any hook.
/asdf -> unknown command: '/asdf'
Directly calling C++ (instead of interpreterPipe):
http://www-106.ibm.com/developerworks/linux/library/l-inline
use C-Inline library?
Swig?
aaahhh seems to work well. Now need to deal with removing Interpreter and
getting return values back from /run.
For most purposes "caught" (return value from hook.run) is equivalent
to the /run return value.
Python: exactly:
http://www.python.org/doc/current/ext/extending-with-embedding.html
Investigate removing Interpreter, or making Interpreter not have a command stack.
Replace with just direct calling. Can also remove savedmatch in this case (i think).
Investigate removing Interpreter::mark
When in scrollback, put "(N new lines)" in the status bar.
/telnet command, or expand /open to take host/port arguments
Prompt detection: look at the size of the packets we receive. If it is equal
to the default packet size (1536?), then do not consider it a prompt until
after some timeout.
MTU discovery is a bitch and is variable.
Why do I get two prompts on the prompt line at materiamagica.com?
Because we never add a \n to the input and neither do they...
echoinput should add your typing to the input.
--- currently prompt gets printed twice (why?)
Get rid of showprompt option?
opposite of snarf_prompt?
Prompt help file: explain various options
Why does "/eval foo" give me an error on line 2? But /eval foo;boo; give me an
error on line 1.
gags broken...
Sometimes the first character on a line is missing...
Perl evaluation:
/hook -Ft'A tall street light' lightgag = /eval $_=""
/hook -Ft'A tall street light' lightgag = /eval $_="";
the former generates:
@ [Perl ERROR] Can't find string terminator '"' anywhere before EOF at (eval 1388) line 1.
/hook -t'follows Zathras into the room(.*)' followers = /eval print("Got after followers: '$1'\n");
prints: 'ot after followers: '.
/hook -t'follows Zathras into the room(.*)' followers = /eval $foo=$1; print("Got after followers: ,$foo,\n");
prints ,ot after followers: ,.
/run -Lperl save_configuration prints:
@ Dumping perl > /run -Lperl save_configuration
may just be command echoing overwriting the line. (but it shouldn't, the
dumping... line has a \n at the end)
This appears to be a python interaction:
@ Dumping perl @ [ERROR] Python could not find function 'save_configuration' anywhere (args: )
When using autorepeat and echo command line, blank is echoed.
After typing one character, the cursor bounces back to the beginning of the line?
Consumes a bunch of CPU too...
Only when connected.
autorepeat only works if length of command is less than 4.
After /exec the window doesn't close on esc.
Segfault seems to occur in conjunction with autocomplete (and weird
autocomplete results) -- try to autocomplete in the middle of an
autocompleted word.
autocomplete, backspace. (is repeatable)
hmm now I can't reproduce
/eval \$ThreeKingdoms::enemy="chinchilla"
@ [Perl ERROR] Can't find string terminator '"' anywhere before EOF at (eval 2209) line 1, <FILE> line 46.
adding a semicolon gets rid of the error message.
Putting things on the screen fails for large xterms (128x90)
Hook:
-----
Why doesn't old grab_prompt work? (no while loop -- i.e. recursive grabbing)
Inconsistency: perl stuff gets executed *after* the received buffer is printed,
C++ stuff gets executed *before*.
fallthrough with perl functions doesn't actually work since we don't collect
the return value -- we don't know if it was caught. See TriggerHookStub::operator()
FIXME CHECK THIS!!
KEYPRESS hooks: key is an int. Convert it to a string (itoa) and pass it to hooks?
/complete hook needs input line to do its thing (when tab is pressed).
if -t is specified, checks for key and passes input line.
if -t NOT specified, just passes key.
-- or --
-k parameter to /hook: implies -T KEYPRESS. If specified, key must match. Input
line will be passed to hookstub. (Need KeypressHookStub class)
Keypresses should be associated with a window. How to do that? /hook -W?
put list of keys on window's status bar? How about keys for open/alias/trig
windows?
Should print every line received: /hook -T OUTPUT -F tester = /eval print "got: $_"
how to do this?
Scripts:
--------
convert:
auto/gag
alt-g to bring up gags?
auto/highlight
alt-h to bring up highlights?
auto/mudftp
Converted, needs to be tested.
auto/repeat
bind KEYPRESS to clear line and place new text on command line. Inverse last command.
auto/trigger
'/trig -e' to edit a trigger (copy it to the command line)
Add '/trig -r' to run a named trigger.
make alt-t bring up window with triggers in it. Pressing enter on one
should copy it to the command line for modification.
sys/idle
sys/keys
Continue converting commands in Interpreter.cc
Message if command not found...
/help, alt-h should bring up help window. bind pgup/pgdn to help window.
tell, soul, chatline, etc. windows.
Window:
-------
scroll down a line
scroll up a line
scroll down a page
scroll up a page
write message on top bar
write message on bottom bar
Do all this with /status? Extend /window?
list bound keys on status line (right justified).
Screen:
-------
Ncurses seems well suited to all this.
Screen.cc, Window.cc use memset on canvas to draw to screen, Screen::refresh redraws.
curses has panel (info panel) to do overlapping windows. (info curses)
stdscr is below all panels (for mud output)
must use panel(3X) library for overlapping windows. (cannot use stdscr)