Search in sources :

Example 1 with MessageOutput

use of com.sedmelluq.discord.lavaplayer.node.message.MessageOutput in project lavaplayer by sedmelluq.

the class NodeController method handeTick.

@RequestMapping("/tick")
public void handeTick(HttpServletRequest request, HttpServletResponse response) throws IOException {
    DataInputStream input = new DataInputStream(request.getInputStream());
    DataOutputStream output = new DataOutputStream(response.getOutputStream());
    MessageOutput messageOutput = new MessageOutput(mapper, output);
    RemoteMessage message;
    while ((message = mapper.decode(input)) != null) {
        messageHandlerRegistry.processMessage(message, messageOutput);
    }
    messageOutput.send(statisticsManager.getStatistics());
    mapper.endOutput(output);
}
Also used : RemoteMessage(com.sedmelluq.discord.lavaplayer.remote.message.RemoteMessage) MessageOutput(com.sedmelluq.discord.lavaplayer.node.message.MessageOutput) DataOutputStream(java.io.DataOutputStream) DataInputStream(java.io.DataInputStream) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

MessageOutput (com.sedmelluq.discord.lavaplayer.node.message.MessageOutput)1 RemoteMessage (com.sedmelluq.discord.lavaplayer.remote.message.RemoteMessage)1 DataInputStream (java.io.DataInputStream)1 DataOutputStream (java.io.DataOutputStream)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1