public int compareChat(String chatpack, String rlcharname, boolean whisper, boolean isgm)
    {
        try
        {
            byte[] stringbyte = chatpack.getBytes("ISO8859-1");
            if (whisper == false){
                if (stringbyte[4] != 0x00 || stringbyte[6] != 0x5B && !isgm)
                {
                    return -1;
                }
            }
            int a = 0;
            while (stringbyte[a] != 0x5B)
            {
                a++;
            }

            int b = a;
            int chstart = b + 1;
            int c = 0;
            while (stringbyte[b] != 0x5D)
            {
                if (c>16)
                {
                    return -1;
                }
                b++;
                c++;
            }

            int chende = b;
            String chname = chatpack.substring(chstart, chende);
            debug(chname + "-  -" + rlcharname);
            if (chname.equals(rlcharname))
            {
                return a;
            }
            else
            {
                return -1;
            }
        } catch (Exception e)
        {
        }
        return 0;
    }