Giter Site home page Giter Site logo

scandum / tintin Goto Github PK

View Code? Open in Web Editor NEW
188.0 188.0 54.0 4.74 MB

TinTin++, aka tt++, is an extensible console MUD client.

Home Page: https://tintin.mudhalla.net

License: GNU General Public License v3.0

Makefile 0.05% C 99.95%
client mapper mud mud-client scriptable shell-scripting telnet terminal vt100

tintin's People

Contributors

beinvisible avatar dzpao avatar jrobsonchase avatar lucianposton avatar mfontani avatar rigrig avatar scandum avatar vehsamrak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tintin's Issues

Mouse tracking without pressing buttons

Currently #config MOUSE ON enables "Button-event tracking", but there is also an even more verbose mode called "Any-event mode", which reports cursor movements even when no button is pressed. (https://www.xfree86.org/current/ctlseqs.html#Mouse%20Tracking)

Changing

tintin/src/config.c

Lines 598 to 602 in b0fa433

print_stdout(0, 0, "\e[?1000h\e[?1002h\e[?1016h");
}
else
{
print_stdout(0, 0, "\e[?1000h\e[?1002h\e[?1006h");

to (i.e. 1002 to 1003)

        print_stdout(0, 0, "\e[?1000h\e[?1003h\e[?1016h");
    }
    else
    {
        print_stdout(0, 0, "\e[?1000h\e[?1003h\e[?1006h");

seems to enable things like (after I created a url MSLP link) #event {MOVED SECURE LINK url MOUSE} {#showme url: %4 -4 -30}, (or just plain #event {MOVED MOUSE}.)

Just enabling those would be nice, but I wonder if maybe we could also have some TinTin-filtered events?
something like

  • #event {ENTER LINK url MOUSE} {#showme Only fires once, when mouse enters link region}
  • #event {LEAVE LINK url MOUSE} {#showme Fires once, when mouse leaves link region}

My use case would be showing the command that will be sent on clicking when you hover the mouse over a link.
Or for a list of rooms: on left-clicking the room name currently my script speedwalks you there, while right-clicking shows the map at that location. It would be neat if I could just show the map when hovering over the link.

#break/return not working inside #regexp

Like title says, I found that #break/#return doesn't work as intended when used inside #regexp.
Example:

#foreach {{1}{2}{3}{4}{5}{6}} tmp {
    #regexp {"$tmp"} {"5"} {
        #break;
    } {
        #echo $tmp
    }
}

Output is 1 2 3 4 6 instead of 1 2 3 4.

Is this the way #regexp should be working?

Env: Debian in WSL Windows 10
Tintin: 2.02.05

Variables no longer usable for filenames passed to #history {read} and {write}

Hi,

I want to use a different command history for every game I connect to. Thus, I create a filename using #format, and then pass that formatted variable to #history {read} {$worldhistory} and also to {write} on disconnect.

However in 2.02.04, it appears the parsing of #history arguments changed. In prior versions, it used sub_arg_in_braces with options of SUB_VAR|SUB_FUN to read the second argument of {read} and {write}, but starting in 2.02.04 it started using get_arg_in_braces, removing the handling of variables.

Was this an intentional change? Or an unintentional regression?

If intentional, is it now intended to be impossible to generate a filename, rather than having it hard-coded?

If unintentional, I ask that history_read and history_write be modified to use sub_arg_in_braces on arg1, with the SUB_VAR|SUB_FUN options.

Thank you,

Undeclared identifier 'environ' in data.c in 2.02.11

I'm the maintainer of TinTin++ on FreeBSD (net/tintin++). While updating this port to latest 2.02.11, I got the following error:

cc -g -Wall  -O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -D_GNU_SOURCE -DHAVE_CONFIG_H -DBIG5   -I/usr/local/include -c data.c
data.c:1346:18: error: use of undeclared identifier 'environ'
                                                for (env = environ ; *env ; env++)
                                                           ^
data.c:1359:18: error: use of undeclared identifier 'environ'
                                                for (env = environ ; *env ; env++)
                                                           ^
2 errors generated.
gmake[1]: *** [Makefile:96: data.o] Error 1

In some cases, `$foo[%*]` and `$foo[]` are not equivalent.

2023-01-14 18:01:03 INPUT: #var foo {{dzp}{{id}{dzp}{level}{18}}{xgg}{{id}{xgg}{level}{33}}}
#OK. VARIABLE {foo} HAS BEEN SET TO {{dzp}{{id}{dzp}{level}{18}}{xgg}{{id}{xgg}{level}{33}}}.
2023-01-14 18:01:05 INPUT: #var foo
#VARIABLE {foo}
{
    {dzp}
    {
        {id} {dzp}
        {level} {18}
    }
    {xgg}
    {
        {id} {xgg}
        {level} {33}
    }
}
2023-01-14 18:01:08 INPUT: #echo {VALUES: %s} {$foo[%*]}
VALUES: {{id}{dzp}{level}{18}}{{id}{xgg}{level}{33}}
2023-01-14 18:01:12 INPUT: #echo {VALUES: %s} {$foo[]}
VALUES: {}{}

CJK Character Display BUG

image

As you can see above, there is not enough space left at the right end of that line to display a full character, but tintin doesn't seem to know that and still tries to display the next character 未 or 也, so iTerm2 displays it on the next line, and after that, tintin creates a new line, so that there is a single character all by itself.

I'm optimistically guessing that this is due to the width calculation.

cursor_check_line_modified2 error while editing unicode input

To reproduce with the current HEAD of master (4518ea5),

  1. Input #showme São Paulo (don't press enter)
  2. Hit esc-backspace (or control-w) twice to delete "São Paulo"
    • Note that the cursor lands one position earlier than expected
  3. Press space

I observe the error cursor_check_line_modified2: str: 8 vs 9 after #showme.

Simpler still: input São Paulo and delete two words to the left. The following stacktrace is immediately printed,

debug: goto_pos(68,0)                                                                                               
DEBUG_STACK[000] [000] = mainloop()
DEBUG_STACK[001] [000] = process_input(void)
DEBUG_STACK[002] [001] = check_key(%p,%d)
DEBUG_STACK[003] [001] = cursor_redraw_line(%p,%p)

Pressing space triggers cursor_check_line_modified2 errors as before.

Difficult to understand `#regex` control flow in `#func`.

2023-02-16 00:05:16 INPUT: #func foo {#regex {foo} {foo} {#echo OK; #return ok} {#echo ERROR; #return error}; #return what???}; #show @foo{}
#OK. FUNCTION {foo} NOW TRIGGERS {#regex {foo} {foo} {#echo OK; #return ok} {#echo ERROR; #return error}; #return what???}.
OK
what???

#cursor get and curly braces

Using #CURSOR GET has some odd behavior with curly braces. It basically seems like it's not escaping them, so when the variable is later used, they're treated as code braces rather than characters.

For example:

#macro {X} {
	#cursor {get} {t};
	#if {{$t} == {}} {
		#echo {nothing};
	};
	#else {
		#echo {something: %s} {$t};
	};
}

This throw error messages if the buffer contains { but will work if it contains other stuff, such as blah{.

The error message: #ERROR: GET BRACED ARGUMENT: UNMATCHED BRACE.

However, using it as an index to another variable (whether using $ or &), even blah{ will spam the above error message:

#var {lookup} {{a}{alpha}}
#macro {Z} {
	#cursor {get} {t};
	#echo {%s} {${lookup[$t]}};
}

#help log missing argument <OFF>

The argument <OFF> are missing in the official documentation and the instructions given in #help log.

Some people will be confused by this problem.

The `%W` width calculation standard and `%-30s` seem to be inconsistent

The %W width calculation standard and %-30s seem to be inconsistent. The former can exclude mslp metacharacters, but %-30s does not.

2023-01-18 19:47:37 INPUT: #var foo {\e]68;1;SEND;bow\a\e[4mbow\e[24m}
#OK. VARIABLE {foo} HAS BEEN SET TO {\e]68;1;SEND;bow\a\e[4mbow\e[24m}.
2023-01-18 19:47:38 INPUT: #echo {width: %W} {$foo}
width: 3
2023-01-18 19:47:51 INPUT: #echo {width: [%-30s]} {$foo}
width: [bow  ]

Spoof prevention?

I'm looking for ideas on how to configure tt++ or otherwise create a workaround with actions so that muds that break long lines (such as player chats), so that the next line doesn't trigger an action. Here's an example:

John OOC: blah blah long line eventually will break to the next line (not wordwrap)
and now this is a new line but it's still John talking

How could you work around the above so that #ACTION {^and now} {} would not be triggered?

A savvy player could try to exploit this behavior and trigger actions falsely by forcing their text to wrap onto a new line.

Debug telnet lies with NAWS and split

When #config {debug telnet} {on} is enabled, and NAWS messages are being sent, it echos to the user the window size ignoring things like #split.

The actual sizes sent subtract the area taken up by #split.

So for example, if the window size is 151x40 prior to running #split, then after typing #split, it'll still print SENT IAC SB NAWS 0 151 0 40 though the server will actually receive IAC SB NAWS 0 151 0 38 IAC SE.

The actual value sent seems reasonable to me, the only issue is that the debugging echo doesn't match it.

Variable containing { in #if clause causes unmatched brace

Using TinTin 2.02.12b, I'm trying to filter key presses, but now typing { causes an error.

Debug log of

  1. setting up #event {RECEIVED KEYPRESS} { #if {"%0" === " "} {#showme space}},
  2. pressing spacebar and
  3. pressing {:
#event {RECEIVED KEYPRESS} { #if {"%0" === " "} {#showme space}}
    #event {RECEIVED KEYPRESS} { #if {"%0" === " "} {#showme space}}
#EVENT {RECEIVED KEYPRESS} HAS BEEN SET TO { #if {"%0" === " "} {#showme space}}.
#DEBUG EVENT {RECEIVED KEYPRESS} { #if {"%0" === " "} {#showme space}}
    #if {" " === " "}
        #showme space
space
    #endif
 #DEBUG EVENT {RECEIVED KEYPRESS} { #if {"%0" === " "} {#showme space}}
#ERROR: GET BRACED ARGUMENT: UNMATCHED BRACE.
    #if {"{" === " "} {#showme space}}
#MATH EXP: UNKNOWN OPERATOR: }
    #endif
{

(Using braces instead of quotes made no difference: #event {RECEIVED KEYPRESS} { #if {{%0} === {}} {#showme space}})

Workaround:

Filtering by unicode index (%1) instead works.

#draw segfault

Doing the following command causes a segmentation fault:
#draw bar 1 1 2 2

This is due to draw_hbar() passing in two floats to a show_error() that expects them as integers. This could either be solved by casting them as such, or changing the show_error() format to use a long double. Since it meaningfully uses double values, I went with the latter personally.

Mouse tracking issues

OS: Mac OS X
Terminal used: iTerm2
Tintin version: 2.02.05

If you set #config mouse_tracking on, it suddenly behaves as if ALL mouse events are being CATCHed and are no longer fired, even if there are no event triggers configured at all — it is no longer possible to select text, scroll in terminal, etc.

If you then set #config mouse_tracking off after that, mouse begins to act even more strangely: instead of acting as it supposed to, it begins adding escape codes to client input area:
Screenshot 2021-02-24 at 10 19 22

And at that point only fully restarting the tintin helps fixes this... state.

I was trying to set up #buffer scrolling with mouse, since I use #split 0 4

inconsequential typo: igr.mods

Line 900: trigger.c Named delays are now automatically converted to one shot
triggers. #undelay will use #untick if the argument begins
with a letter.

Believe "triggers" should be "tickers". (lest some poor soul be confused)

Update CHARSET REQUEST handling per rfc2066

Please consider updating TinTin's handling of CHARSET per rfc2066 such that it includes the separator (space, semicolon, etc.), like: IAC SB CHARSET REQUEST SEPARATOR ENCODING IAC SE. This will help it align with the rfc and some other game clients.

Screen Shot 2020-07-19 at 9 03 58 PM

Documentation needs work

Hi everyone,

I know this is a FOSS project and I'm in no position to make demands, so please understand that it is not my intention to be antagonistic, but I need to make some criticism and I believe that being objective is in the best interest of the project.

Although I know some Python and a bit of Emacs Lisp, I am by no means a programmer, just a dedicated computer nerd. I am a Linux user, a shell user, a somewhat advanced Vim/Emacs (my init.rel currently has 1400 lines, down from 4000 lines). I have also used Tmux for a time as well.

I say this to convey that I am no stranger to large and complex programs, and I am very familiar with the documentation.

Nevertheless, I couldn't figure out how to configure and customize TinTin++ for my needs.

I wanted to use Tintin++ because it felt like a very customizable program that reminded me of the freedom I have on Emacs. However, the documentation seems to be targeted at those that already know how to use the program, which kinda defeats the purpose. I gotta be very honest here: I don't think I ever saw documentation as cryptic and lacking as TinTin's. The program seems great, but it's a black box and I ultimately gave up.

I know there is additional documentation, but I'm not finding the link at this moment. In any case, I can tell that the additional documentation is short and insufficient as well.

Someone recommended asking on Discord, but doing so would become annoying for everyone since I would be asking dozens of questions every day, basically forcing people to write the documentation for me message by message.

So I would like to make an earnest question here: is this project solely for the use of computer programmers? If the answer is "yes", then no change must be made. However, if the answer is "no", I strongly advise a concerted effort toward creating user-friendly documentation.

By "user-friendly documentation" I mean something more than a list of commands, classes, etc. There must be some indication of how to put the pieces together and accomplish whatever Tintin is able to accomplish.

Thanks.

Bad printfs

I found a couple bad printfs.

mapper.c:7143 is passing an integer to a %8.3f, causing an issue whenever this code was reached, I changed -1 to -1.0 on my local to fix it:

tintin_printf2(ses, "vnum: %5d  dist: %8.3f  x: %4s  y: %4s  z: %4s  name: %s", room->vnum, -1, "?", "?", "?", room->name);

mapper.c:3422 has more arguments than tokens, I haven't tested this one but found it while looking into the above issue:

cat_sprintf(buf, "%s%5.1f", ses->map->color[MAP_COLOR_USER], room->length, ses->map->color[MAP_COLOR_EXIT]);

Extra space back in Telnet CHARSET 'accept' message and bogus charset string in 'reject' message

It looks like #83 has been reintroduced or not done after all.

Also, according to RFC2066 the rejection message does NOT contain a character set name - I think the following changes are needed:

 if (accept)
 {
-    telnet_printf(ses, -1, "%c%c%c%c %s%c%c", IAC, SB, TELOPT_CHARSET, CHARSET_ACCEPTED, var, IAC, SE);
+    telnet_printf(ses, -1, "%c%c%c%c%s%c%c", IAC, SB, TELOPT_CHARSET, CHARSET_ACCEPTED, var, IAC, SE);
     client_telopt_debug(ses, "SENT IAC SB CHARSET ACCEPTED %s", var);
 }
 else
 {
-    telnet_printf(ses, -1, "%c%c%c%c %s%c%c", IAC, SB, TELOPT_CHARSET, CHARSET_REJECTED, var, IAC, SE);
+    telnet_printf(ses, -1, "%c%c%c%c%c%c", IAC, SB, TELOPT_CHARSET, CHARSET_REJECTED, IAC, SE);
     client_telopt_debug(ses, "SENT IAC SB CHARSET REJECTED %s", var);
 }

[REQUEST] Adding a `#info` option such as `#info output save` can be used to get the output text in raw format when the action is triggered.

Adding a #info option such as #info output save can be used to get the output text in raw format when the action is triggered.

One problem we often encounter when writing bots is that some text is so colorful that it is difficult to write a color trigger, but it is easy to write a plain text trigger. But we want to use that line of text for some processing (such as sorting logs), so it would be helpful to have a way to get the text in its raw format.

I have a little patch here that does this, maybe it doesn't do it right, but I think it at least illustrates what I want.

diff --git a/src/data.c b/src/data.c
index 5045079..ff72a46 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1641,6 +1641,24 @@ DO_COMMAND(do_info)
 				}
 				break;
 
+			case CTRL_O:
+				if (is_abbrev(arg1, "OUTPUT"))
+				{
+					if (is_abbrev(arg2, "SAVE"))
+					{
+						set_nest_node_ses(ses, "info[OUTPUT]", "{BUFFER}{%s}", gtd->mud_output_buf);
+						add_nest_node_ses(ses, "info[OUTPUT]", "{BUFLEN}{%d}", gtd->mud_output_len);
+						add_nest_node_ses(ses, "info[OUTPUT]", "{LINE}{%s}", gtd->mud_output_line);
+                    }
+					else
+					{
+						tintin_printf2(ses, "#INFO OUTPUT: BUFFER: %s", gtd->mud_output_buf);
+						tintin_printf2(ses, "#INFO OUTPUT: BUFLEN: %d", gtd->mud_output_len);
+						tintin_printf2(ses, "#INFO OUTPUT: LINE: %s", gtd->mud_output_line);
+					}
+                }
+                break;
+
 			case CTRL_S:
 				if (is_abbrev(arg1, "SESSION"))
 				{
diff --git a/src/net.c b/src/net.c
index be1341b..74ec471 100644
--- a/src/net.c
+++ b/src/net.c
@@ -557,6 +557,7 @@ void readmud(struct session *ses)
 
 		if (ses->check_output)
 		{
+			gtd->mud_output_line = line;
 			process_more_output(ses, line, next_line == NULL);
 
 			continue;
@@ -570,6 +571,7 @@ void readmud(struct session *ses)
 		{
 			strcpy(linebuf, line);
 		}
+		gtd->mud_output_line = line;
 		process_mud_output(ses, linebuf, next_line == NULL);
 	}
 	DEL_BIT(cts->flags, SES_FLAG_READMUD);
diff --git a/src/tintin.h b/src/tintin.h
index 60933ec..3402daf 100644
--- a/src/tintin.h
+++ b/src/tintin.h
@@ -1133,6 +1133,7 @@ struct tintin_data
 	char                  * mud_output_buf;
 	int                     mud_output_max;
 	int                     mud_output_len;
+	char                  * mud_output_line;
 	unsigned char         * mccp_buf;
 	int                     mccp_len;
 	char                    macro_buf[BUFFER_SIZE];

core dump in #math

#math foo {922337203685477580 * 98 / ( 100 - 101 )}
Arithmetic exception (core dumped)

This problem exists in both master and beta versions.

Can't output a string with a semicolon in it with #echo. Is this a bug?

I've tried various methods and can't output a string with a semicolon in it with #echo. So is this a bug?

All commands except #echo accept semicolons as part of the string normally.

zsh ❯ ./tt-master -G -e "#echo {FOO: %s} {hello;world}; #end {\}"
FOO: hello
zsh ❮ ./tt-master -G -e '#var foo {hello;world}; #echo {FOO: %s} {$foo}; #end {\}'
FOO: hello
zsh ❯ ./tt-master -G -e '#var foo {hello;world}; #replace foo {;} {:}; #echo {FOO: %s} {$foo}; #end {\}'
FOO: hello:world

#split looks weird in #action

I found a trivial bug, if I use #split in #action, I find that the line of text that causes the trigger will appear on the input line, which often messes up my screen.
like this:

image

This is the test script:

#split;
#session cf carrionfields.net 4449;
#action {^By what name do you wish to be mourned? } {
    #nop has bug;
    #split;
    #nop has not bug;
    #nop #delay 0 #split;
};

If I use #delay 0 #split then I don't get this.

Not super clear that the tintin++ apt-get package installs tt++

Thanks for making this awesome tool!

Currently when installing tintin++ from apt-get the package is named tintin++ but the actual executable and man pages are for tt++. This can be very confusing to someone using it for the first time, I ended up having to look into the file list of the package to see what exactly I should be looking for. Options that might solve this are:

  • The package is renamed to tt++
  • A post-install script informs the user of the name tt++
  • tt++ is renamed to tintin++ and users can alias it as needed
  • an alias is created by default
  • there are two executables: tt++ and tintin++ but the man page stays as tintin++
  • Documentation is updated to make it clear that the executable is tt++ (low effort but will likely still lead to confusion)

There are definitely other options I'm not thinking of as well and this is possibly a minor issue but it does require some knowledge of Linux systems to figure it out so for some less tech savvy Windows users it might be a blocker.

Anyway, thanks for the amazing work!

Typo, help.c

help.c:819: "<278> The cat command will concatinate the argument to the given variable.\n"

should be concatenate

#SSL ALERT not printing filename

Hi,

If you try to connect via #SSL and the remote server's certificate changed, you can get a message like this:

#SSL ERROR: SERVER CERTIFICATE IS DIFFERENT FROM THE SAVED ONE.
#SSL ALERT: THE SERVER'S SETTINGS WERE CHANGED IN AN UNEXPECTED WAY.
#SSL ALERT: YOU MAY BE VULNERABLE TO MAN-IN-THE-MIDDLE ATTACKS.
#SSL ALERT: TO CONTINUE, PLEASE DELETE THE FILE:
#SSL ALERT: 
#SSL ERROR: ABORTING CONNECTION.

The trouble is that the last #SSL ALERT line is supposed to print the filename, but instead prints RAM garbage because the filename is not actually captured for this message.

This is the filename variable in ssl.c function ssl_check_cert().

Though perhaps not the most elegant solution (as the filename is already gathered in another function call within this one), it can nevertheless be resolved by adding get_cert_file(ses, filename); before the filename variable is used. Another solution might be to pass the filename buffer to that other function and have it use that instead of its own local buffer, but this is a rare enough error that I went with the first one locally.

tt++ does not handle SIGCHLD causing zombie processes to appear.

#system {ps -aef | grep lua}
#OK: EXECUTING 'ps -aef | grep lua'
  501 50594 50094   0  7:56AM ttys007    0:00.00 sh -c ps -aef | grep lua
  501 50596 50594   0  7:56AM ttys007    0:00.00 grep lua
#run lua {lua}
#TRYING TO LAUNCH 'lua' RUNNING 'lua'.
Lua 5.4.4  Copyright (C) 1994-2022 Lua.org, PUC-Rio
>
>

#ZZZZZZZAAAAAAAAPPPP!!!!!!!!! LET'S GET OUTTA HERE!!!!!!!!
#SESSION 'lua' DIED.
#SESSION 'gts' ACTIVATED.
#system {ps -aef | grep lua}
#OK: EXECUTING 'ps -aef | grep lua'
  501 50793 50094   0  7:56AM ??         0:00.00 (lua)
  501 50883 50094   0  7:57AM ttys007    0:00.00 sh -c ps -aef | grep lua
  501 50885 50883   0  7:57AM ttys007    0:00.00 grep lua

Charset Negotiation Issues: Rejecting a Charset

  1. Regarding
    telnet_printf(ses, -1, "%c%c%c%c %s%c%c", IAC, SB, TELOPT_CHARSET, CHARSET_REJECTED, var, IAC, SE);

Why does Tintin send the Charset it is rejecting? This behavior doesn't exist in RFC 2066. Is there a particular RFC that I am missing?

Edit: The reason I ask, is because I am working on creating a telnet / MUD negotiation library in C#, and this is standing out.
Edit: This behavior is made worse by seemingly treating a delimited list of offered charsets as being a series of separate offerings, and sending Accepted and Rejected as if it's multiple negotiations.

Client debug:
image

Server actually sent:
IAC SB CHARSET SEND ";utf-8;iso-8859-1;utf-16;utf-16BE;utf-32;utf-32BE;us-ascii;utf-7" IAC SE
(Quotation marks just indicate where it sends a byte string, instead of individual bytes)

RFE: Porting to PCRE2

As far as I understand, PCRE is now deprecated upstream in favor of PCRE2, and distributions will be dropping it in their upcoming releases. I'm filing this issue in the hope TinTin++ could be ported to the new library.

I'll try to come up with a patch but if you manage to do it before me, all the better ;)

Disable semicolon command stringing outside of tintin commands

when typing a semicolon outside of a tintin command, it is interpreted as a command split, however many mushes also use ; as a command split, and while you can escape it to send it to the server, there should be a way to disable it in messages sent to the server

#echo doesn't work right in {SEND OUTPUT} event. (TinTin++ 2.02.20)

#event {SEND OUTPUT}
#EVENT {SEND OUTPUT}
{
#format {lineout} {%p} {%0};
#echo {<199>SENT:<099> %s} {$lineout} ;
#unvariable {lineout}
}
/* expected behavior: */
look
SENT: look

#EVENT {SEND OUTPUT}
{
#format {lineout} {%p} {%0};
#echo {<199>SENT:<099> %s <199>MORE TEXT<099>} {$lineout} ;
#unvariable {lineout}
}

/* unexpected behavior: /
look
MORE TEXT
/
expected behavior would have been: */
look
SENT: look MORE TEXT

/* outside of the event, #echo works as expected */
#echo {<199>SENT:<099> %s <199>MORE TEXT<099>} {testing output}
SENT: testing output MORE TEXT

Android compile

your project has a android tag, how i compile android client?

When #class save/clear/load and tables are combined, a bug occurs

Minimal reproducible example:

#alias {bug1} {
    #class foo open;
    #function foo {
        #local str {hello};
        #return {{text}{$str}};
    };
    #class foo close;

    #class foo;
    test-bug;

    #class foo save;
    #class foo clear;
    #class foo load;

    #class foo;
    test-bug;
};

#alias {test-bug} {
    #local r {@foo{}};
    #if { "$r[text]" != "" } {
        #echo {OK};
    };
    #else {
        #echo {Found BUG};
    };
};
bug1
##################################### foo ######################################
#FUNCTION {foo} {#local str {hello};#return {{text}{$str}};}
OK
##################################### foo ######################################
#FUNCTION {foo} {#local str {hello};#return {text}{$str}}
Found BUG

It looks a little strange. If we replace the table with a plain string, this issue does not occur.

Starting with user interface (-g) crashes

Running tt++ -g crashes:
After printing the welcome banner, it shows free(): double free detected in tcache 2

Screenshot

image

and exits with

DEBUG_STACK[000] [000] = command(%p,%p,%p,...)

syserr_fatal(crashed) 

TinTin++ version: 2.02.30 (master, compiled from source)
It works fine with the previous commit (2.02.21b)

Running tt++ ~/.tintin/gui.tin does work, showing the world chooser.

How can I avoid the same line being gagged twice by `#line gag` and `#gag`?

How can I avoid the same line being gagged twice by #line gag and #gag?

I may not have made my question clear. Please see the following example:

#gag {hello test}
#action {hello test} {#sh HELLO TEST; #line gag}
#sh hello test; #sh LINE 2222; #sh LINE 3333; #sh LINE 4444
HELLO TEST
LINE 3333
LINE 4444

What happened was that I did a retouching of some lines in one place, replacing the initial text with an edited replacement, so I would think of using #show to output the new replacement, and #line gag to suppress the initial text.

Unfortunately, however, the initial text also triggers another #gag rule, which causes it to be gagged twice, with the actual result that the line of text after it is incorrectly gagged.

I haven't thought of any way to avoid this yet, so I'm sending this issue for help.

Tickers queue up during startup session and then don't start upon connection

I'm trying to use the script at https://tintin.mudhalla.net/scripts/gmcp.php with 2.02.11, but it appears some kind of behavior changed with tickers between 2.02.05 and 2.02.10, so the status bar part isn't working.

If I start it by giving the file name on the command line on 2.02.05 then the ticker produces error messages until I connect (the screen hasn't split yet, plus it doesn't have the data), which shows that the ticker is running even during the startup session. Then I connect to game, tell it to send me tailored GMCP message, and it works fine. I'm not sure if this is the correct behavior or not because the help for tickers in .05 also says that they did not run during the startup session back then either.

If I do the same thing with 2.02.11, the status bar doesn't run even after connecting. I am able to get it to start working if I manually start a second ticker.

Then as a troubleshooting step removing whatever complexity of the gmcp and map and all that, I tried just starting the program without the script and just pasting 2 lines in...

  • #TICKER {demo1} { #line ignore #showme {demo1} } {1}
  • (wait a few seconds)
  • (start session)
  • (wait a little)
  • #TICKER {demo2} { #line ignore #showme {demo2} } {1}.

On old version (2.02.05), it gives me "demo1" every second starting when I typed it even though I'm in the startup session. On new version (2.02.11 or .10), it gives me neither message until I start the demo2 ticker, at that point it gives me a bunch of demo1 messages and a few demo2 messages, around 10:1 and then become 1:1 alternating after a while. I assume this means that the demo1 ticks were queued up during the time that I was in the startup session and the time after I connected but before starting the second ticker, but only started happening once creating the second ticker got it going.

Extra leading whitespace in Charset accepted/rejected

TinTin++ has a bug and adds a leading space in the accepted or rejected message: " UTF-8" rather than "UTF-8"

tintin/src/telopt_client.c

Lines 1391 to 1401 in b0fa433

{
telnet_printf(ses, -1, "%c%c%c%c %s%c%c", IAC, SB, TELOPT_CHARSET, CHARSET_ACCEPTED, var, IAC, SE);
client_telopt_debug(ses, "SENT IAC SB CHARSET ACCEPTED %s", var);
}
else
{
telnet_printf(ses, -1, "%c%c%c%c %s%c%c", IAC, SB, TELOPT_CHARSET, CHARSET_REJECTED, var, IAC, SE);
client_telopt_debug(ses, "SENT IAC SB CHARSET REJECTED %s", var);
}

Solution seems to be changing "%c%c%c%c %s%c%c" to "%c%c%c%c%s%c%c"

Substitute "~" for home directory in #READ command

Hello!

It would be helpful to be able to reference a user's home directory to make it easier to load scripts inside of a script. For example, a user could do something like this without having to hardcode a specific home directory:

#read ~/.config/tintin/movement.tintin
#read ~/.config/tintin/logging.tintin

I've made a very rudimentary patch that performs a substitution in file.c before the file is read: master...prg318:expand-tilde
I didn't submit this as a PR because I doubt this is the most elegant solution, but it seems to work OK as a patch.

stack dump when use `#cat`

It's okay to do this:

#var foo {{a}{AAA}{b}{BBB}}
#OK. VARIABLE {foo} HAS BEEN SET TO {{a}{AAA}{b}{BBB}}.
#cat foo {{c}{CCC}}
#CAT: VARIABLE {foo} HAS BEEN SET TO {{a}{AAA}{b}{BBB}{c}{CCC}}.
#var foo
#VARIABLE {foo}
{
    {a} {AAA}
    {b} {BBB}
    {c} {CCC}
}

But this can lead to stack dump:

#var bar[x] {{a}{AAA}{b}{BBB}}
#OK. VARIABLE {bar[x]} HAS BEEN SET TO {{a}{AAA}{b}{BBB}}.
#var bar[x]
#VARIABLE {bar[x]}
{
    {a} {AAA}
    {b} {BBB}
}
#cat bar[x] {{c}{CCC}}
(stack_dump)
DEBUG_STACK[000] [000] = mainloop()
DEBUG_STACK[001] [000] = process_input(void)
DEBUG_STACK[002] [001] = script_driver(%p,%d,%p)
DEBUG_STACK[003] [001] = do_cat(gts,0x7fd83340b210)
DEBUG_STACK[004] [003] = add_nest_node(%p,%s,%p,...)

FATAL ERROR trap_handler (signal 11: Segmentation fault: 11)
syserr_fatal(crashed)%

Can't send Chinese characters to server in GBK1 encoding

I just got a test data to explain what happened after TinTin 2.02 sent Chinese characters to the server during GBK1 encoding. In order to eliminate the factors of my local terminal settings and input method settings, I intentionally echoed the captured server text to the server. At the same time I used Wireshark to capture network packets.

Here is the output I observed on the screen and the resulting capture file:

tintin-mud-pkuxkx-gbk1.pcapng.zip

#config {charset} {gbk1}; #class xx kill; #read xx.tin; #class xx list; look
#CONFIG {CHARSET} HAS BEEN SET TO {GBK1TOUTF8}.
#CLASS {xx} HAS BEEN CLEARED.
#CLASS {xx} HAS BEEN KILLED.
#OK:   1 ACTION LOADED.
#OK:   1 CLASS LOADED.
############################################################# xx ##############################################################
#ACTION {^%s{这里唯一的出口有.*}$} {#local words {%2};#send {say $words};}
库房 -
                 荣宝斋-----库房
    这里是荣宝斋的库房。最近荣宝斋经过扩容升级,以前的一些客户未赎回东西转到了库房里面,客
户可以查看(list)还在以前典当的物品,也可以赎回(shu)自己的东西,但是这个库房不再接受新的典
当。

    这里唯一的出口有 west。
>
你说道:「这櫪飳唯粈的劤龊口S袎 west。」
>

I tried to analyze it myself. It should be that every GBK Chinese character sent to the server has become a three-byte sequence. The first two bytes are the correct GBK encoding, and the third byte seems redundant.

I continued to track the law of the value of the third byte and found that it is the third byte of the UTF-8 encoding of this Chinese character, so I guess it should be that the buffer pointer control was wrong during the UTF8 to GBK1 encoding conversion.

Just for your reference.

Request a new syntax to declare multiple `#local` variables at once.

Request a new syntax to declare multiple #local variables at once.

I like to keep my code's runtime space clean with the #local syntax. But if I have multiple #local variables to declare in a block, then I need to write many lines of #local, which makes the code look a bit bloated. So I'd like to be able to declare multiple #local at once.

#map list crashes since 2.02.30

Hi,

Since I upgraded to 2.02.30, map function

#map list {roomnote} <anything_to_search>

doesn't work properly anymore, and the client crashes...
Working under an up-to-date AWS Amazon linux vm.

I tried #CONFIG {VERBOSE} HAS BEEN SET TO {ON}, but I don't get any message before tintin++ stop/crash.

weird vt behaviour tintin++ 2.02.05

Related tintin++ version: 2.02.05

The status line for characters names starting with Z on Lowlands mud (lolamud.net 6969) doesn't show correctly

How to reproduce

#sess zimo lolamud.net 6969
new
zimo
password123
password123
y
y
m
ran
hum
y
y
#cr
tact top

image

NOTE: confirmed to be working with 2.01.92

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.