public void BroadcastChatMessage(string message, bool isError = false, string sender = "System") { var msg = new LobbyChatPacket() { Message = message, Sender = sender, IsError = isError }; Broadcast(MessageHelper.Create((short)MsfMessageCodes.LobbyChatMessage, msg.ToBytes())); }
public void SendChatMessage(LobbyMember member, string message, bool isError = false, string sender = "System") { var packet = new LobbyChatPacket() { Message = message, Sender = sender, IsError = isError }; var msg = MessageHelper.Create((short)MsfMessageCodes.LobbyChatMessage, packet.ToBytes()); member.Extension.Peer.SendMessage(msg, DeliveryMethod.Reliable); }
public void HandleChatMessage(LobbyMember member, IIncommingMessage message) { var text = message.AsString(); var messagePacket = new LobbyChatPacket() { Message = text, Sender = member.Username }; var msg = MessageHelper.Create((short)MsfMessageCodes.LobbyChatMessage, messagePacket.ToBytes()); Broadcast(msg); }