Las Venturas Playground
Chatting on LVP - Printable Version

+- Las Venturas Playground (https://forum.sa-mp.nl)
+-- Forum: Main Talk (https://forum.sa-mp.nl/forum-3.html)
+--- Forum: Development (https://forum.sa-mp.nl/forum-16.html)
+--- Thread: Chatting on LVP (/thread-28091.html)



Chatting on LVP - Peter - 09-22-2011

I'm going to completely re-write the chat system on Las Venturas Playground, which will be the first system switching to a new directory layout and class and test-based interface. Initially, it will be following this algorithm:

Code:
1) If the announcement mode is enabled and the [player] is not an
    administrator, block the message. Else: globally distribute.
2) If the [player] is not logged in yet, block the message.
3) If the [player] is completely muted, block the message.
4) If a chat game is active, check if the player tries to answer it.
5) Determine the scope of the message:
    1) If an administrator is speaking and the announcement mode is enabled,
       let the visibility be GlobalTextVisibility.
    2) Check whether the player is in a phone call [PrivateTextVisibility]
    3) Check whether the player is replying to a pm [PrivateTextVisibility]
    4) Check whether the player is chatting in a channel [ChannelTextVisibility]
       1) Prefixed with '@': AdministrationTextChannel
       2) Prefixed with '#': VIPTextChannel
       3) Prefixed with ';': RegularTextChannel
       4) Prefixed with '!': GroupTextChannel
       5) If the TextChannel is not PublicTextChannel and the message is
          prefixed with an '$', let the TextChannel be PublicTextChannel.
    5) If chat is be limited to the World scope, WorldTextVisibility
    6) If chat is limited to the Environment scope, EnvironmentTextVisibility
6) If the player is muted for the TextVisibility, block the message.
7) If the message is originating from a command, check whether command-
    messages from the player are muted. If so, block the message.
8) Apply filters and limitations over the message.
9) Apply formatting to the message.
10) Distribute the message to the recipients in the scope.
11) Broadcast the message to external services, such as IRC.

The first commit just landed. All associated code will be rewritten. If you have feature or enhancement requests or want to discuss behavior of certain features, please reply to this topic.


Re: Chatting on LVP - Rien - 09-22-2011

"1) If the announcement mode is enabled and the [player] is not an
    administrator, block the message. Else: globally distribute."

Why not moderator?


Re: Chatting on LVP - Peter - 09-22-2011

(09-22-2011, 01:10 AM)Rien J. Clyde link Wrote: "1) If the announcement mode is enabled and the [player] is not an
    administrator, block the message. Else: globally distribute."

Why not moderator?

Do you think we should change announcement mode to allow moderators to give them as well?  If so, I'll change that from the current behavior.


Re: Chatting on LVP - Rien - 09-22-2011

I'd be fine with giving moderators that ability as well. Can't see it do any harm, at any rate. :+


Re: Chatting on LVP - Peter - 09-22-2011

(09-22-2011, 01:30 AM)Rien J. Clyde link Wrote: I'd be fine with giving moderators that ability as well. Can't see it do any harm, at any rate. :+

Ok. Landed.


Re: Chatting on LVP - Peter - 09-22-2011

Steps 1, 2 and 3 have now landed. Pending are the tests. Available functionality right now:

- A toggle-able announcement mode which will block all messages from non-crew players, and automatically globalize the said texts making sure that everyone receives them.
- A check to make sure that the user is logged in if they're registered. If not, the message will be blocked.
- A simple mute-manager which manages muting on a per-component, per-player basis.