Created a validateAndSend method to validate packets against the access rights prior to sending them.

This commit is contained in:
ProfMobius committed 2014-03-22 18:29:15 +01:00
1 parent 58cb0d9e23
commit 009eee3fca
5 files changed
+36 -9

No files matched your search

@@ -32,10 +32,10 @@ public class Packet_DataValue {
} catch (IOException e){}
}
public static Packet250CustomPayload create(DataReq dataReq, ISerializable data){
Packet250CustomPayload packet = new Packet250CustomPayload();
public static Packet250Metadata create(DataReq dataReq, ISerializable data){
Packet250Metadata packet = new Packet250Metadata();
ByteArrayOutputStream bos = new ByteArrayOutputStream(1);
DataOutputStream ostream = new DataOutputStream(bos);
DataOutputStream ostream = new DataOutputStream(bos);
try{
ostream.writeByte(Packets.DATA_VALUE_GENERAL);
@@ -45,6 +45,9 @@ public class Packet_DataValue {
}catch(IOException e){}
packet.dataReq = dataReq;
packet.dataValue = data;
packet.channel = "Opis";
packet.data = bos.toByteArray();
packet.length = bos.size();