lilypad.client.connect.api.request.impl.MessageRequest Java Examples
The following examples show how to use
lilypad.client.connect.api.request.impl.MessageRequest.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HelperLilyPad.java From helper with MIT License | 6 votes |
@Override public void run() { this.attempts++; try { this.connect.request(new MessageRequest(Collections.emptyList(), this.channel, this.message)); } catch (RequestException e) { if (e.getMessage().equals("Not open") || e.getMessage().equals("Not connected")) { // attempt to resend later - try 3 times. if (this.attempts < 3) { Schedulers.async().runLater(this, 2, TimeUnit.SECONDS); } } else { e.printStackTrace(); } } }
Example #2
Source File: LilyPadMessenger.java From LuckPerms with MIT License | 5 votes |
@Override public void sendOutgoingMessage(@NonNull OutgoingMessage outgoingMessage) { MessageRequest request = new MessageRequest(Collections.emptyList(), CHANNEL, outgoingMessage.asEncodedString().getBytes(StandardCharsets.UTF_8)); try { this.connect.request(request); } catch (RequestException e) { e.printStackTrace(); } }
Example #3
Source File: MessageRequestEncoder.java From JLilyPad with GNU General Public License v3.0 | 5 votes |
public void encode(MessageRequest request, ByteBuf buffer) { buffer.writeShort(request.getRecipients().size()); for(String username : request.getRecipients()) { BufferUtils.writeString(buffer, username); } BufferUtils.writeString(buffer, request.getChannel()); buffer.writeShort(request.getMessage().length); buffer.writeBytes(request.getMessage()); }
Example #4
Source File: MessageRequestEncoder.java From JLilyPad with GNU General Public License v3.0 | 4 votes |
public Class<MessageRequest> getRequest() { return MessageRequest.class; }