Code Monkey home page Code Monkey logo

Comments (6)

XePeleato avatar XePeleato commented on August 20, 2024 1

That's because you're using a HashSupport to send the packet. It takes as the first argument the name or the hash of the packet.

If you want to use the header id, then don't use the HashSupport, or remove the header from the packet and add the hash/name as the first argument of the function.

from g-earth.

XePeleato avatar XePeleato commented on August 20, 2024 1

RoomUserTalk: {l}{u:830}{i:6313}{s:whatever}{i:0}{i:0}{i:0}{i:-1}

Don't you see that the string is in the second position?
do:

HPacket packet = message.getPacket();
        packet.readInteger(); // ADD THIS
        String speechtext = packet.readString();

from g-earth.

sep1 avatar sep1 commented on August 20, 2024

Thanks! There is another problem. This is the code:

protected void initExtension() {
        hashSupport = new HashSupport(this);
        hashSupport.intercept(HMessage.Side.TOCLIENT, "RoomUserTalk", this::goSendMessage);
    }
private void goSendMessage(HMessage message) {
    	HPacket packet = message.getPacket();
        String speechtext = packet.readString();
        sendToServer(new HPacket("{l}{u:280}{s:"+speechtext+"}{i:0}{i:0}"));
    }

the speechtext variable return empty. What is the reason?

from g-earth.

XePeleato avatar XePeleato commented on August 20, 2024

Check RoomUserTalk's structure, it doesn't start with a string, so it can't read it or it reads a corrupted one

from g-earth.

sep1 avatar sep1 commented on August 20, 2024

mmm, i'm still trying but i dont get it...

from g-earth.

sep1 avatar sep1 commented on August 20, 2024

Now it's clear! Thank you very much. I appreciate it. ;)

from g-earth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.