Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public abstract void SendPrivateMessage(ChatMessage chatMessage);
Exemplo n.º 5
0
 public abstract void SendChatMessage(ChatMessage chatMessage);
Exemplo n.º 6
0
 /// <summary>
 /// Notify every <see cref="ServerModule"/> about the <see cref="Client"/> global message.
 /// </summary>
 public void NotifyServerGlobalMessage(ServerModule caller, ChatMessage chatMessage)
 {
     ChatClientSentMessage(chatMessage);
 }
Exemplo n.º 7
0
 public void SendPrivateMessage(Client destClient, ChatMessage chatMessage) { destClient.SendPrivateMessage(chatMessage); }
Exemplo n.º 8
0
 public void SendChatMessage(ChatMessage chatMessage) { Server.NotifyServerGlobalMessage(this, chatMessage); }
Exemplo n.º 9
0
 public override void SendPrivateMessage(ChatMessage chatMessage) { }
Exemplo n.º 10
0
 public override void SendChatMessage(ChatMessage chatMessage) => Logger.Log(LogType.Chat, chatMessage.Message);
Exemplo n.º 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);
        }
Exemplo n.º 12
0
 public override bool MessageSend(ChatMessage chatMessage) => (bool) Hook.CallFunction("Call", "MessageSend", chatMessage)[0];