private void HandleTopicMessage(MessagePacket packet) { string topicName = packet.Data[0]; string topicMessage = packet.Data[1]; if (TopicManagerInstance.SendMessage(ConnectionID, topicName, topicMessage)) { SendMessage(new MessagePacket(PacketTypes.PrintData, new string[] { $"You have published the message '{topicMessage}' to the topic '{topicName}'" })); Console.WriteLine($"Publisher '{ConnectionID}' has sent the message '{topicMessage}' to the topic '{topicName}'"); } else { SendMessage(new MessagePacket(PacketTypes.PrintData, new string[] { $"Could not send a message to the topic '{topicName}'. Either it doesn't exist or you do not own the topic." })); Console.WriteLine($"Publisher '{ConnectionID}' tried to send a message to '{topicName}', but it failed"); } }