mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-28 07:55:49 +00:00
Created a validateAndSend method to validate packets against the access rights prior to sending them.
This commit is contained in:
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();
|
||||
|
||||
Reference in new issue
Block a user