forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

New function [leaveChannel]

Open moviebr opened this issue 2 years ago • 5 comments

Pull Request Prelude

  • [x] I have followed [proper The Forgotten Server code styling][code].
  • [x] I have read and understood the [contribution guidelines][cont] before making this PR.
  • [x] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.

Changes Proposed

This function allows the player to close an open chat.

moviebr avatar Apr 08 '23 23:04 moviebr

What's the use case?

ranisalt avatar Apr 10 '23 19:04 ranisalt

What's the use case?

It will be possible to create custom systems with the option to open and close chats via scripts.

Honestly, I thought of using it in a system that I developed using AntiBot, in which it opens its own chat to verify this. Without this new function, the chat could remain open there forever.

Here is the link to view the system: click here

In the case of the link above, the new function is not placed, and that would be a choice to use.

moviebr avatar Apr 10 '23 21:04 moviebr

Honestly, I thought of using it in a system that I developed using AntiBot, in which it opens its own chat to verify this. Without this new function, the chat could remain open there forever.

Ah, super cool!

ranisalt avatar Apr 11 '23 08:04 ranisalt

The name of the method is quite weird for what it actually does. I don't know, but it bothers me that the method is called "close", and in reality all it does is trigger the "onLeave" event of the chat, but the channel remains open.

This method was created for the client to call it when the chat is really closed physically from the client side.

to make a player unable to write in the chat, u can be controlled through a Lua variable. Apparently, Cip's client does not need to close channels from the server side. Or does it? How?

maybe call it player:leaveChannel()?

MillhioreBT avatar Apr 12 '23 08:04 MillhioreBT

The name of the method is quite weird for what it actually does. I don't know, but it bothers me that the method is called "close", and in reality all it does is trigger the "onLeave" event of the chat, but the channel remains open.

This method was created for the client to call it when the chat is really closed physically from the client side.

to make a player unable to write in the chat, u can be controlled through a Lua variable. Apparently, Cip's client does not need to close channels from the server side. Or does it? How?

maybe call it player:leaveChannel()?

indeed we need a better and more descriptive name

EPuncker avatar Apr 13 '23 18:04 EPuncker