You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
733 B
33 lines
733 B
4 years ago
|
package com.jotuntech.sketcher.client.command;
|
||
|
|
||
|
import java.nio.ByteBuffer;
|
||
|
|
||
|
import com.jotuntech.sketcher.client.Client;
|
||
|
import com.jotuntech.sketcher.client.Command;
|
||
|
import com.jotuntech.sketcher.client.Connection;
|
||
|
import com.jotuntech.sketcher.common.User;
|
||
|
|
||
|
public class PingCommand implements Command {
|
||
|
private long timestamp;
|
||
|
|
||
|
public PingCommand() {
|
||
|
this.timestamp = System.currentTimeMillis();
|
||
|
}
|
||
|
|
||
|
public PingCommand(long timestamp) {
|
||
|
this.timestamp = timestamp;
|
||
|
}
|
||
|
|
||
|
public int perform(Client client, User user) {
|
||
|
return Connection.SEND_NONE;
|
||
|
}
|
||
|
|
||
|
public void decode(ByteBuffer in) {
|
||
|
timestamp = in.getLong();
|
||
|
}
|
||
|
|
||
|
public void encode(ByteBuffer out) {
|
||
|
out.putLong(timestamp);
|
||
|
}
|
||
|
}
|