예제 #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;
        }
예제 #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;
        }
예제 #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);
 }
예제 #4
0
 public abstract void SendPrivateMessage(ChatMessage chatMessage);
예제 #5
0
 public abstract void SendChatMessage(ChatMessage chatMessage);
예제 #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);
 }
예제 #7
0
 public void SendPrivateMessage(Client destClient, ChatMessage chatMessage) { destClient.SendPrivateMessage(chatMessage); }
예제 #8
0
 public void SendChatMessage(ChatMessage chatMessage) { Server.NotifyServerGlobalMessage(this, chatMessage); }
예제 #9
0
 public override void SendPrivateMessage(ChatMessage chatMessage) { }
예제 #10
0
 public override void SendChatMessage(ChatMessage chatMessage) => Logger.Log(LogType.Chat, chatMessage.Message);
예제 #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);
        }
예제 #12
0
 public override bool MessageSend(ChatMessage chatMessage) => (bool) Hook.CallFunction("Call", "MessageSend", chatMessage)[0];