use of de.dytanic.cloudnet.lib.server.screen.ScreenInfo in project CloudNet by Dytanic.
the class ScreenLoader method run.
@Override
public void run() {
this.thread = Thread.currentThread();
String input;
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(screenable.getInstance().getInputStream(), StandardCharsets.UTF_8));
try {
while ((input = bufferedReader.readLine()) != null) {
CloudNetWrapper.getInstance().getNetworkConnection().sendPacket(new PacketOutSendScreenLine(Arrays.asList(new ScreenInfo(screenable.getServiceId(), input))));
}
} catch (IOException e) {
}
}
use of de.dytanic.cloudnet.lib.server.screen.ScreenInfo in project CloudNet by Dytanic.
the class PacketInSendScreenLine method handleInput.
@Override
public void handleInput(Document data, PacketSender packetSender) {
Collection<ScreenInfo> screenInfos = data.getObject("screenInfo", new TypeToken<Collection<ScreenInfo>>() {
}.getType());
CloudNet.getInstance().getEventManager().callEvent(new ScreenInfoEvent(screenInfos));
for (ScreenInfo screenInfo : screenInfos) {
if (CloudNet.getInstance().getScreenProvider().getMainServiceId() != null && screenInfo.getServiceId().getServerId().equalsIgnoreCase(CloudNet.getInstance().getScreenProvider().getMainServiceId().getServerId()))
System.out.println("[" + screenInfo.getServiceId().getServerId() + "] " + screenInfo.getLine());
}
CloudNet.getInstance().getNetworkManager().handleScreen(((INetworkComponent) packetSender), screenInfos);
}
Aggregations