09-22-2011, 12:46 AM
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:
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.
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.