Exemplo n.º 1
0
        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()));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }