Пример #1
0
        private object OnUserChat(IPlayer player, string message)
        {
#endif
            if (message.Length > _instance._config.MaxMessageLength)
            {
                message = message.Substring(0, _instance._config.MaxMessageLength);
            }

            BetterChatMessage chatMessage = ChatGroup.PrepareMessage(player, message);

            if (chatMessage == null)
            {
                return(null);
            }

#if RUST
            BetterChatMessage.CancelOptions result = SendBetterChatMessage(chatMessage, chatchannel);
#else
            BetterChatMessage.CancelOptions result = SendBetterChatMessage(chatMessage);
#endif

            switch (result)
            {
            case BetterChatMessage.CancelOptions.None:
            case BetterChatMessage.CancelOptions.BetterChatAndDefault:
                return(true);
            }

            return(null);
        }
Пример #2
0
        private string API_GetFormattedMessage(IPlayer player, string message, bool console = false)
        {
            var output = ChatGroup.PrepareMessage(player, message).GetOutput();

            return(console ? output.Console : output.Chat);
        }
Пример #3
0
 private Dictionary <string, object> API_GetMessageData(IPlayer player, string message) => ChatGroup.PrepareMessage(player, message).ToDictionary();