Beispiel #1
0
        public virtual bool MessageSend(ChatMessage chatMessage)
        {
            if (!Subscription.ContainsKey(chatMessage.Sender) || Subscription[chatMessage.Sender] != this)
                return false;

            History.Add(chatMessage);

            foreach (var subscriber in Subscribers)
                subscriber.SendChatMessage(chatMessage);

            return true;
        }
Beispiel #2
0
        public override bool MessageSend(ChatMessage chatMessage)
        {
            if (!ClientInLocation.ContainsKey(chatMessage.Sender))
                return false;

            var sender = chatMessage.Sender;
            var location = sender.LevelFile;
            CheckLocation(sender);

            foreach (var client in ClientsInLocation[location])
                client.SendChatMessage(chatMessage);

            return true;
        }
Beispiel #3
0
 private void ChatClientSentMessage(ChatMessage chatMessage)
 {
     foreach (var chatChannel in ChatChannelManager.ChatChannels)
         if(chatChannel.MessageSend(chatMessage))
             Logger.LogChatMessage(chatMessage.Sender.Name, chatChannel.Name, chatMessage.Message);
 }
Beispiel #4
0
 public abstract void SendPrivateMessage(ChatMessage chatMessage);
Beispiel #5
0
 public abstract void SendChatMessage(ChatMessage chatMessage);
 /// <summary>
 /// Notify every <see cref="ServerModule"/> about the <see cref="Client"/> global message.
 /// </summary>
 public void NotifyServerGlobalMessage(ServerModule caller, ChatMessage chatMessage)
 {
     ChatClientSentMessage(chatMessage);
 }
Beispiel #7
0
 public void SendPrivateMessage(Client destClient, ChatMessage chatMessage) { destClient.SendPrivateMessage(chatMessage); }
Beispiel #8
0
 public void SendChatMessage(ChatMessage chatMessage) { Server.NotifyServerGlobalMessage(this, chatMessage); }
Beispiel #9
0
 public override void SendPrivateMessage(ChatMessage chatMessage) { }
Beispiel #10
0
 public override void SendChatMessage(ChatMessage chatMessage) => Logger.Log(LogType.Chat, chatMessage.Message);
Beispiel #11
0
        private void HandleChatMessage(ChatMessageGlobalPacket packet)
        {
            var message = new ChatMessage(this, packet.Message);
            if (packet.Message.StartsWith("/"))
            {
                // Do not show login command
                if (!packet.Message.ToLower().StartsWith("/login"))
                    SendChatMessage(message);

                if (Module.ExecuteClientCommand(this, packet.Message))
                    return;

                if (ExecuteCommand(packet.Message))
                    return;

                SendServerMessage("Invalid command!");
            }
            else if(IsInitialized)
                Module.SendChatMessage(message);
        }
Beispiel #12
0
 public override bool MessageSend(ChatMessage chatMessage) => (bool) Hook.CallFunction("Call", "MessageSend", chatMessage)[0];