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; }
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; }
private void ChatClientSentMessage(ChatMessage chatMessage) { foreach (var chatChannel in ChatChannelManager.ChatChannels) if(chatChannel.MessageSend(chatMessage)) Logger.LogChatMessage(chatMessage.Sender.Name, chatChannel.Name, chatMessage.Message); }
public abstract void SendPrivateMessage(ChatMessage chatMessage);
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); }
public void SendPrivateMessage(Client destClient, ChatMessage chatMessage) { destClient.SendPrivateMessage(chatMessage); }
public void SendChatMessage(ChatMessage chatMessage) { Server.NotifyServerGlobalMessage(this, chatMessage); }
public override void SendPrivateMessage(ChatMessage chatMessage) { }
public override void SendChatMessage(ChatMessage chatMessage) => Logger.Log(LogType.Chat, chatMessage.Message);
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); }
public override bool MessageSend(ChatMessage chatMessage) => (bool) Hook.CallFunction("Call", "MessageSend", chatMessage)[0];