You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
I want to get a users name by their ID. As far as I understand all this it should be as follows:
Bot has an ID and sends packet "PacketRequestUserInfo" containing the user ID
Bot recieves a packet "PacketUserInfo" but it does not contain anything.
In this repository there is actually a different packet named "PacketUserPresence" with the methods I need but it does not seem to be implemented in the bancho-api.jar.
Any ideas on how to fix this or get the username differently?
Edit: Looking at the releases source code, I see the values from "PacketUserInfo" are stored in the object but aren't visible. Can I get them in any other way? (Sorry, I am not really experienced with streams and stuff)
The text was updated successfully, but these errors were encountered:
I really wouldn't recommend using the release jar as library anymore. What you should do is clone this repository and use it as an exernal library.
I've made effort to handle user presence packets within the new API. I don't have any documentations on how to use the new api, so here's a quick tutorial:
BanchoClient bancho = new BanchoClientBuilder(username, password).build();
bancho.addPacketHandler((packet) -> {
if (packet instanceof PacketReceivingFinished) {
bancho.getClientManager().changeStatus()
.setStatus(UserState.TESTING)
.setBeatmap(new Beatmap(" the bot!"))
.send();
}
});
bancho.addEventHandler((event) -> {
if (event instanceof EventMessage) {
EventMessage message = (EventMessage) event;
System.out.println(message.toString());
}
});
With this to get the user by ID you can do:
User user = bancho.getChannelManager().getUserById(userId);
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to get a users name by their ID. As far as I understand all this it should be as follows:
In this repository there is actually a different packet named "PacketUserPresence" with the methods I need but it does not seem to be implemented in the bancho-api.jar.
Any ideas on how to fix this or get the username differently?
Edit: Looking at the releases source code, I see the values from "PacketUserInfo" are stored in the object but aren't visible. Can I get them in any other way? (Sorry, I am not really experienced with streams and stuff)
The text was updated successfully, but these errors were encountered: