Limit chat message length

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Limit chat message length

by Wuzzy » Thu Jun 04, 2015 12:13

Recently on GunshipPenguin's Hungry Games server:

https://i.imgur.com/zRDdczp.jpg

The image shows some user posting an extremely long message repeating the word “DAY” over and over again. The message is so long, it fills the entire screen. It is very annoying.
The client-side workaround is easy: Hit [F2] and you hide the chat log. But this is not a real solution, because you also hide the legitimate chat.

The problem is not that some user spams the chat, but that stuff like this is possible in the first place.

I therefore suggest to add a length limit to chat messages on the server side. Messages which exceed a certain length are simply rejected.
On the client side, the client may simply not allow to type further characters at a certain point, because they would be rejected by the server anyways. Maybe the server first “tells” the clients the maximum allowed message length, so the client can apply this limit as well. But it is important that the real message length limit is applied by the server.
I think that 256 characters might be a good start, probably nobody wants to write legit messages which are so long. 256 characters are approximately needed to fill 2 lines in chat.

But this limit should be configurable in minetest.conf (just to be sure), even possible to disable it altogether (for whatever reason).

I want this to be part of the engine, and not just a mod. This is core behavior IMO.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Limit chat message length

by rubenwardy » Thu Jun 04, 2015 12:24

The chat dialog's text dialog should also be limited so they don't type too long a message and get it wasted. Having a setting for this isn't really necessary, and over complicates things - you'd need to send the setting to the client.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Limit chat message length

by Wuzzy » Thu Jun 04, 2015 12:27

I basically wrote about all that client stuff, except that you disagree with me on that there should be a setting.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Limit chat message length

by rubenwardy » Thu Jun 04, 2015 12:29

Oh, my eyes skipped that line. :P
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: Limit chat message length

by ABJ » Thu Jun 04, 2015 13:06

I disapprove. I've had enough of this crap >:(.

But that's just my opinion
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Limit chat message length

by rubenwardy » Thu Jun 04, 2015 16:22

ABJ wrote:I disapprove. I've had enough of this crap >:(.

But that's just my opinion


Do you disapprove of limiting chat message length?
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: Limit chat message length

by ABJ » Thu Jun 04, 2015 18:08

Yes that's what I was disapproving of. Sorry for the foggy post.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Limit chat message length

by Wuzzy » Thu Jun 04, 2015 18:26

Does that mean you are in favor of this?:

Image

Haha, just kidding. But seriously, can you give me a legitimite use case of writing a single (!) chat message with more than 500 characters?
Just for comparison, this is how 500 characters (or 504 bytes, because of the IPA notation) look like:
Mese Blocks (pronounciation: [ˈmɛˌsɛ]) are the rarest mineral and the third rarest blocks and start appearing very deep underground, under 1024 node lengths below sea level. Mese blocks are rarer than diamond ores but not even remotely rare as Nyan Cats. Mese Blocks usually appear in small clusters of three. A mese ore cluster is much more common. A single Mese block can be crafted to nine Mese Crystals. Quote from the Developer Wiki: The origin of the block is just plain random. In the early da


Remember: This is just a chat, not a webforum, e-mail or the Usenet.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Limit chat message length

by Hybrid Dog » Thu Jun 04, 2015 19:51

With /r you can begin a new line in chat.
You can ctrl+c that (after putting it onto a sign with lua). So if you type e.g. hello, everybody<ctrl+v>*** Server shutting down. people think that the server is shutting down.
/n makes a new line, too, but the playername is shown at the beginning of this line
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Limit chat message length

by kaeza » Thu Jun 04, 2015 20:49

It's worse on Android on small devices. Due to poor vision have to increase the font size a bit, and the chat ends taking up almost half the screen on my 4 inch phone.

My suggestion is to add a button to show the console (like F10 does on PC), and making only a couple lines of chat visible (preferably a client-configurable number of lines).
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Limit chat message length

by Wuzzy » Thu Jun 04, 2015 21:22

Hybrid Dog, that sounds weird, but I don't quite understand how to reproduce it. Also, if you have to put text into a sign with Lua, that would mean you would have to be pretty privileged on the server already, and even then, the server needs to have some mod like luacmd installed.

The idea of limiting the chat length only on client side is also interesting. However, I still think that a server accepting any arbitrary length of data could be problematic for other reasons.
What if someone floods the server not with just one screen full of text, but mebibytes full of garbage (maybe caused by a modified client or own code)? Could a server even be theoretically brought to a crash with something like that?
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Limit chat message length

by Hybrid Dog » Fri Jun 05, 2015 09:06

Wuzzy wrote:Hybrid Dog, that sounds weird, but I don't quite understand how to reproduce it. Also, if you have to put text into a sign with Lua, that would mean you would have to be pretty privileged on the server already, and even then, the server needs to have some mod like luacmd installed.

You can leave singleplayer and join a server and ctrl+v still works.
1. make the sign in your world have this \r:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua
index 3441c80..3f75850 100644
--- a/mods/default/nodes.lua
+++ b/mods/default/nodes.lua
@@ -1515,6 +1515,7 @@ minetest.register_node("default:sign_wall", {
                --local n = minetest.get_node(pos)
                local meta = minetest.get_meta(pos)
                meta:set_string("formspec", "field[text;;${text}]")
+               meta:set_string("text", "\r")
                meta:set_string("infotext", "\"\"")
        end,
        on_receive_fields = function(pos, formname, fields, sender)

2. join a singleplayer world, place a sign, rightclick it, type ctrl+a, then ctrl+c, then exit the sign fromspec
3. test it: type t, hi, ctrl+v, ** l left the game., enter
4. leave your world, join a server and do it there
5. put it somewhere onto a sign on the server that you don't need to get it from singleplayer every time


Wuzzy wrote:The idea of limiting the chat length […]

maybe use a string instead of a wstring
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: Limit chat message length

by ABJ » Fri Jun 05, 2015 16:59

I'm still against it. You could always condense chat into a single GUI of it's own like MC and use F10 for long chat messages. And this would not happen. This is just *. And for flooders, you can always scroll or if it's that bad, kick/ban/whatever.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 5 guests

cron