mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
new: custom cmds (#313)
This commit is contained in:
@@ -17,9 +17,9 @@ class ServerCustomAdapter extends TypeAdapter<ServerCustom> {
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return ServerCustom(
|
||||
temperature: fields[0] as String?,
|
||||
pveAddr: fields[1] as String?,
|
||||
pveIgnoreCert: fields[2] as bool?,
|
||||
pveIgnoreCert: fields[2] == null ? false : fields[2] as bool,
|
||||
cmds: (fields[3] as Map?)?.cast<String, String>(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@ class ServerCustomAdapter extends TypeAdapter<ServerCustom> {
|
||||
void write(BinaryWriter writer, ServerCustom obj) {
|
||||
writer
|
||||
..writeByte(3)
|
||||
..writeByte(0)
|
||||
..write(obj.temperature)
|
||||
..writeByte(1)
|
||||
..write(obj.pveAddr)
|
||||
..writeByte(2)
|
||||
..write(obj.pveIgnoreCert);
|
||||
..write(obj.pveIgnoreCert)
|
||||
..writeByte(3)
|
||||
..write(obj.cmds);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user