Author Topic: Chat - filtering some messages  (Read 2939 times)

0 Members and 1 Guest are viewing this topic.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Chat - filtering some messages
« on: April 18, 2014, 01:55:54 am »
Hi,

This is not a big change and it would be GREAT improvement for Soldat scripting :)

Currently we have commands and chat. Many people accidentaly use chat instead of command and then we can see: /adminlog blabla123 on the chat...

If there was possibility to use something like:
Code: [Select]
function FilterChatMessages(SpeakerID: integer; ChatMsg : string) : boolean;
which should return true when the message should appear on the chat, and false when it shouldn't.
SpeakerID = 0 could be used when the origin of the message is the script and SpeakerID = -1 when this is admin message sent by client (/say ...).

Also it would be useful for implementing private chats (muting for all and then sending msg to the particular player).

Please, add this function in the nearest release.

Best regards,
Szaman.
« Last Edit: April 18, 2014, 02:01:45 am by Szaman »

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Chat - filtering some messages
« Reply #1 on: April 18, 2014, 02:45:57 am »
Quote
Also it would be useful for implementing private chats (muting for all and then sending msg to the particular player).

/pm id text

Im chill like that

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Chat - filtering some messages
« Reply #2 on: April 18, 2014, 02:54:07 am »
Yeah... that is very simple solution ;)
But I am talking about:
- private chat of all spectators without any prefixes
- private chat in form of:
Code: [Select]
/startpm Bonecrusher
hi
bla bla bla
ok, let's go back to the normal discussion...
/endpm
(all above messages went only to Bonecrusher)

And still... the most important case is to prevent showing commands written in chat...
« Last Edit: April 18, 2014, 02:55:38 am by Szaman »

Offline Akinaro

  • Flagrunner
  • ****
  • Posts: 749
Re: Chat - filtering some messages
« Reply #3 on: April 18, 2014, 02:58:37 am »
its a bit bad idea, because if you want to say something to all people you need to end private conversation say it and then start pm again. Its nothing hard to write /pm 2 before you say something its less than 1sec

But I like idea of filtering commands, so if player type in normal chat "/"(before text) it should write it as a command, and when you type in command text with no / it should be written as a chat text

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl

Im chill like that

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Chat - filtering some messages
« Reply #5 on: April 18, 2014, 03:03:50 am »
OK, dudes... the idea about private chats was only an additional feature.

The main feature I am talking about is to give the scripter ability to filter messages (in any way he wants to).
Not only built-in filtering: if text starts with / then treat it as command (but it would be useful also :) ).

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Chat - filtering some messages
« Reply #6 on: April 18, 2014, 03:08:58 am »
I'm almost certain I once saw a script which would change your message depending on the input. It would use black list of words and change it to something else without displaying first message.

Ex. major typing "noob"

message being displayed: 'im such a noob"

Im chill like that

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Chat - filtering some messages
« Reply #7 on: April 18, 2014, 03:10:33 am »
Ok, if it is possible - great :) But how ? ;)

Offline Akinaro

  • Flagrunner
  • ****
  • Posts: 749
Re: Chat - filtering some messages
« Reply #8 on: April 18, 2014, 03:10:52 am »
Well it would be better if it would be implemented to the game, not in external script. Its basic of the basic. It should be there all the time

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Chat - filtering some messages
« Reply #9 on: April 18, 2014, 03:11:50 am »
We will have to wait for scripting experts messages.

Im chill like that

Offline dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
Re: Chat - filtering some messages
« Reply #10 on: April 18, 2014, 03:42:18 am »
This chat is possible to do right now. Do not forget delete(text, .. , ..)

EDIT:
SpeakerID: integer change to byte.
« Last Edit: April 18, 2014, 04:12:19 am by dominikkk26 »

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Chat - filtering some messages
« Reply #11 on: April 18, 2014, 03:53:36 am »
@dominik: so changing parameter "text" will change the chat message ? And what will happen when you set it to empty string?

@akinaro: +1

Offline kicikici

  • Soldier
  • **
  • Posts: 180
Re: Chat - filtering some messages
« Reply #12 on: April 18, 2014, 06:08:48 am »
@Szaman, u weren't first peron who proposed this changes. This topic should explain everything: http://forums.soldat.pl/index.php?topic=37394.0
In last 4 years nothing was changed, so I doubt that something will change in nearest future.

Ex. major typing "noob"

message being displayed: 'im such a noob"

It's not possible using vanilia scriptcore abilities.

But I like idea of filtering commands, so if player type in normal chat "/"(before text) it should write it as a command, and when you type in command text with no / it should be written as a chat text

... or be ignored.
Classic banana

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Chat - filtering some messages
« Reply #13 on: April 18, 2014, 06:20:34 am »
Nice to know that there were such initiatives in the past.

So... does anyone knows why devs don't do anything about that? It's not so hard to implement it... :(

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Chat - filtering some messages
« Reply #14 on: April 18, 2014, 06:42:17 am »
I suppose that the easiest API for that would be to make OnPlayerSpeak return boolean, just like On(Player)Command. Or string (new message).
The reason it's not yet implemented is because it requires protocol change which i rather not touch if i don't have to. The thing here is, that every chat message must be confirmed by the server (or rather, send back to client) or otherwise the client will re-send it. This can be noticed if you have high latency or generally crappy connection. The filtered messages would have to add some kind of exception here.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Szaman

  • Soldier
  • **
  • Posts: 145
Re: Chat - filtering some messages
« Reply #15 on: April 18, 2014, 07:18:17 am »
OK. So add one byte/char on the beggining of the message - if server will send:
Code: [Select]
xThis is the message
then it will be shown to the others and if
Code: [Select]
zThis is the message
then client will ignore it and not display.

And the for example if OnPlayerSpeak returns something that is not an empty string then this returned message will be displayed (sent back with "x" on the begining), if empty string - sent whatever with "z" on the begining (ignored message).

Or does the client verifies the content of the message?

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Chat - filtering some messages
« Reply #16 on: April 18, 2014, 07:42:24 am »
Honestly, i have no idea how exactly it's handled. My point was to explain why protocol change is required.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Akinaro

  • Flagrunner
  • ****
  • Posts: 749
Re: Chat - filtering some messages
« Reply #17 on: April 18, 2014, 08:48:17 am »
But in the "future"(5-10 year :P )we could have simple system that would automatically set player text to command if in front of it is "/"?

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Chat - filtering some messages
« Reply #18 on: April 18, 2014, 09:20:52 am »
No. What if you want to tell somebody what the command is? I can already see all the frustration comming from "Gah, i forgot to prefix it with 'insert random prefix here'!"
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline darDar

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 794
    • #Soldat Gather - Community on Discord
Re: Chat - filtering some messages
« Reply #19 on: April 18, 2014, 09:34:26 am »
I press 'shift' + '/' (Numpad) to create /cmd
The best would be if we had a console in my opinion + Shoozzas Chat Mod.

Soldat Gather 'Matchmaking Community on Discord'

gather.soldat.pl

| My Maps: ctf_Pyramid, ctf_Replay, ctf_Blako, ctf_R6, ctf_Ntex, ctf_Caro, ctf_Bizar & vs_mode mappack |