Ajout d'un nouveau packet pour PandacubeCore

This commit is contained in:
Marc Baloup 2016-10-16 19:28:40 +02:00
parent d9d5e77105
commit 4ae06be523
2 changed files with 78 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import fr.pandacube.java.util.network.packet.packets.core_slave.PacketServerProc
import fr.pandacube.java.util.network.packet.packets.core_slave.PacketServerProcessInput;
import fr.pandacube.java.util.network.packet.packets.core_slave.PacketServerProcessQuery;
import fr.pandacube.java.util.network.packet.packets.global.PacketClientAuthenticate;
import fr.pandacube.java.util.network.packet.packets.global.PacketClientLogRecord;
import fr.pandacube.java.util.network.packet.packets.global.PacketServerCantAuthenticate;
import fr.pandacube.java.util.network.packet.packets.global.PacketServerException;
import fr.pandacube.java.util.network.packet.packets.web.PacketClientWebRequest;
@ -105,6 +106,7 @@ public abstract class Packet implements ByteSerializable {
addPacket(PacketServerProcessQuery.class);
addPacket(PacketClientAuthenticate.class);
addPacket(PacketClientLogRecord.class);
addPacket(PacketServerCantAuthenticate.class);
addPacket(PacketServerException.class);

View File

@ -0,0 +1,76 @@
package fr.pandacube.java.util.network.packet.packets.global;
import fr.pandacube.java.util.network.packet.PacketClient;
import fr.pandacube.java.util.network.packet.bytebuffer.ByteBuffer;
public class PacketClientLogRecord extends PacketClient {
private long time;
private String level;
private String threadName;
private String message;
private String throwable;
public PacketClientLogRecord() {
super((byte)0x51);
}
@Override
public void deserializeFromByteBuffer(ByteBuffer buffer) {
time = buffer.getLong();
level = buffer.getString();
threadName = buffer.getString();
message = buffer.getString();
throwable = buffer.getString();
}
@Override
public void serializeToByteBuffer(ByteBuffer buffer) {
buffer.putLong(time);
buffer.putString(level);
buffer.putString(threadName);
buffer.putString(message);
buffer.putString(throwable);
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getThreadName() {
return threadName;
}
public void setThreadName(String threadName) {
this.threadName = threadName;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getThrowable() {
return throwable;
}
public void setThrowable(String throwable) {
this.throwable = throwable;
}
}