Example #1
0
        private static void SendMessageOfType(string title, string message, ChatBase.MessageType messageType, User user)
        {
            switch (messageType)
            {
            case ChatBase.MessageType.Temporary:
            case ChatBase.MessageType.Permanent:
            case ChatBase.MessageType.Popup:
                if (user == null)
                {
                    ChatBase.Send(new ChatBase.Message(message, messageType));
                }
                else
                {
                    ChatBase.Send(new ChatBase.Message(message, user, messageType));
                }
                break;

            case ChatBase.MessageType.Announcement:
                if (user == null)
                {
                    ChatBase.Send(new ChatBase.Message(title, message));
                }
                else
                {
                    ChatBase.Send(new ChatBase.Message(title, message, user));
                }
                break;
            }
        }
Example #2
0
 public static void SendServerMessage(string message, bool permanent = false, User user = null)
 {
     ChatBase.MessageType messageType = permanent ? ChatBase.MessageType.Permanent : ChatBase.MessageType.Temporary;
     SendMessageOfType(null, message, messageType, user);
 }