A Project for Chronicle 4 based on L2JServer.


    Core buffer

    Share

    execcfg

    Posts : 11
    Join date : 2015-03-01

    Core buffer

    Post  execcfg on 1st March 2015, 21:39

    Code here http://pastebin.com/ZZiyDv7j

    After started game server

    Code:
    Error on: /root/l2j/gameserver/data/scripts/custom/q912_buffe/__init__.py.error.log
    Line: -1 - Column: -1

    Traceback (innermost last):
      (no code object) at line 0
    ValueError: Strings added to sha hashes must not contain characters with value > 255

    Someone help me)?

    execcfg

    Posts : 11
    Join date : 2015-03-01

    Re: Core buffer

    Post  execcfg on 2nd March 2015, 01:42

    Give an example of working code buffer please

    execcfg

    Posts : 11
    Join date : 2015-03-01

    Re: Core buffer

    Post  execcfg on 2nd March 2015, 01:43

    execcfg wrote:Code here http://pastebin.com/ZZiyDv7j

    After started game server

    Code:
    Error on: /root/l2j/gameserver/data/scripts/custom/q912_buffe/__init__.py.error.log
    Line: -1 - Column: -1

    Traceback (innermost last):
      (no code object) at line 0
    ValueError: Strings added to sha hashes must not contain characters with value > 255

    Someone help me)?



    this error encoding of the file. You need to change to UTF-8

    execcfg

    Posts : 11
    Join date : 2015-03-01

    Re: Core buffer

    Post  execcfg on 4th March 2015, 06:12

    Where is the error?
    http://pastebin.com/cpHzevgw

    ProDev

    Posts : 26
    Join date : 2014-11-12

    Re: Core buffer

    Post  ProDev on 4th March 2015, 22:25

    You should look at PyString class (python lib).

    There is something like:

    Code:

        private byte[] getBytes() {
            return to_bytes(this.string);
        }

        public static byte[] to_bytes(String var0) {
            byte[] var1 = new byte[var0.length()];

            for(int var2 = 0; var2 < var1.length; ++var2) {
                char var3 = var0.charAt(var2);
                if(var3 >= 256) {
                    throw Py.ValueError("Strings added to sha hashes must not contain characters with value > 255");
                }

                var1[var2] = (byte)var3;
            }

            return var1;
        }

    and to_bytes called here:
    Code:

        public Object __tojava__(Class var1) {
            if(var1.isAssignableFrom(String.class)) {
                return this.string;
            } else if((var1 == Character.TYPE || var1 == Character.class) && this.string.length() == 1) {
                return new Character(this.string.charAt(0));
            } else {
                if(var1.isArray()) {
                    if(var1.getComponentType() == Byte.TYPE) {
                        return this.getBytes();
                    }

                    if(var1.getComponentType() == Character.TYPE) {
                        return this.string.toCharArray();
                    }
                }

                return var1.isInstance(this)?this:Py.NoConversion;
            }
        }

    You should debug there.

    Try to check your encoding, it depends on jython version (old versions didn't have such validation), try to remove all cyrillic letters (russian) and restart your server.

    execcfg

    Posts : 11
    Join date : 2015-03-01

    Re: Core buffer

    Post  execcfg on 4th March 2015, 22:38

    ProDev wrote:You should look at PyString class (python lib).

    There is something like:

    Code:

        private byte[] getBytes() {
            return to_bytes(this.string);
        }

        public static byte[] to_bytes(String var0) {
            byte[] var1 = new byte[var0.length()];

            for(int var2 = 0; var2 < var1.length; ++var2) {
                char var3 = var0.charAt(var2);
                if(var3 >= 256) {
                    throw Py.ValueError("Strings added to sha hashes must not contain characters with value > 255");
                }

                var1[var2] = (byte)var3;
            }

            return var1;
        }

    and to_bytes called here:
    Code:

        public Object __tojava__(Class var1) {
            if(var1.isAssignableFrom(String.class)) {
                return this.string;
            } else if((var1 == Character.TYPE || var1 == Character.class) && this.string.length() == 1) {
                return new Character(this.string.charAt(0));
            } else {
                if(var1.isArray()) {
                    if(var1.getComponentType() == Byte.TYPE) {
                        return this.getBytes();
                    }

                    if(var1.getComponentType() == Character.TYPE) {
                        return this.string.toCharArray();
                    }
                }

                return var1.isInstance(this)?this:Py.NoConversion;
            }
        }

    You should debug there.

    Try to check your encoding, it depends on jython version (old versions didn't have such validation), try to remove all cyrillic letters (russian) and restart your server.



    Thanks for the reply. Already double checked,loaded without problems.But there are pads in use within the game.

    Над этим пыхчу во все Smile ... пока безуспешно..

    http://pastebin.com/b4287cHB

    ProDev

    Posts : 26
    Join date : 2014-11-12

    Re: Core buffer

    Post  ProDev on 4th March 2015, 22:48

    And what error do you have now? You should put a breakpoint inside the method:

    Code:

    public static byte[] to_bytes(String var0)

    and check what character causes the fail.

    RU: В общем, нужно запуститься под дебаггером и посмотреть что именно не нравится из строки в методе to_bytes - ставим breakpoint на строку с генерацией Exception. Тогда сразу будет понятно что смотреть.


    execcfg

    Posts : 11
    Join date : 2015-03-01

    Re: Core buffer

    Post  execcfg on 4th March 2015, 23:42

    ProDev wrote:And what error do you have now?  You should put a breakpoint inside the method:

    Code:

    public static byte[] to_bytes(String var0)

    and check what character causes the fail.

    RU: В общем, нужно запуститься под дебаггером и посмотреть что именно не нравится из строки в методе to_bytes - ставим breakpoint на строку с генерацией Exception. Тогда сразу будет понятно что смотреть.




    How to do it?

    Sponsored content

    Re: Core buffer

    Post  Sponsored content

      Similar topics

      -

      Current date/time is 26th September 2017, 13:58