use of net.runelite.http.api.ws.messages.Handshake in project runelite by runelite.
the class WSService method onMessage.
@OnMessage
public void onMessage(Session session, String text) {
WebsocketMessage message = gson.fromJson(text, WebsocketMessage.class);
logger.info("Got message: {}", message);
if (message instanceof Handshake) {
Handshake hs = (Handshake) message;
uuid = hs.getSession();
}
}
use of net.runelite.http.api.ws.messages.Handshake in project runelite by runelite.
the class WSClient method connect.
void connect() {
Request request = new Request.Builder().url(RuneLiteAPI.getWsEndpoint()).build();
webSocket = client.newWebSocket(request, this);
Handshake handshake = new Handshake();
handshake.setSession(session.getUuid());
send(handshake);
}
Aggregations