Ejemplo n.º 1
0
 private void handleSendPm(Player player, Packet packet)
 {
     long name = packet.readLong();
     byte[] privateMsgPacked = packet.getRemainingData();
     string privateMsg = Misc.textUnpack(privateMsgPacked);
     if (privateMsg != null && name > 0)
     {
         player.getFriends().sendMessage(name, privateMsg, privateMsgPacked);
     }
 }
Ejemplo n.º 2
0
        private void handlePublicChat(Player player, Packet packet)
        {
            int colour = packet.readByte();
            int effects = packet.readByte();
            byte[] packedChatData = packet.getRemainingData();
            string unpacked = Misc.textUnpack(packedChatData);
            ChatMessage message;

            if (unpacked.StartsWith("/") && player.getClan() != null)
            {
                packedChatData = Misc.textPack(unpacked.Substring(1));
                message = new ChatMessage(colour, unpacked.Substring(1), effects, player, packedChatData);
                Server.getClanManager().newClanMessage(player.getClan(), message);
                return;
            }
            message = new ChatMessage(colour, unpacked, effects, player, packedChatData);
            player.setLastChatMessage(message);
        }