mirror of
https://github.com/iv-org/inv_sig_helper.git
synced 2024-11-26 23:50:32 +00:00
Added size in response for convenience
This commit is contained in:
parent
fda0eeb863
commit
9784fdbafe
@ -14,6 +14,7 @@ The data afterwards depends on the supplied opcode, Please consult the **Operati
|
||||
| Name | Size (bytes) | Description |
|
||||
|------------|--------------|---------------------------------------|
|
||||
|request_id | 4 | The ID for the request that this response is meant for |
|
||||
|size | 4 | Size of the response (excluding size of request id)|
|
||||
|
||||
The data afterwards depends on the supplied opcode, Please consult the **Operations** chapter for more information.
|
||||
|
||||
|
@ -96,18 +96,23 @@ impl Encoder<OpcodeResponse> for OpcodeDecoder {
|
||||
) -> Result<(), Self::Error> {
|
||||
dst.put_u32(item.request_id);
|
||||
match item.opcode {
|
||||
JobOpcode::ForceUpdate => match item.update_status {
|
||||
Ok(_x) => dst.put_u16(0xF44F),
|
||||
Err(FetchUpdateStatus::PlayerAlreadyUpdated) => dst.put_u16(0xFFFF),
|
||||
Err(_x) => dst.put_u16(0x0000),
|
||||
},
|
||||
JobOpcode::ForceUpdate => {
|
||||
dst.put_u32(2);
|
||||
match item.update_status {
|
||||
Ok(_x) => dst.put_u16(0xF44F),
|
||||
Err(FetchUpdateStatus::PlayerAlreadyUpdated) => dst.put_u16(0xFFFF),
|
||||
Err(_x) => dst.put_u16(0x0000),
|
||||
}
|
||||
}
|
||||
JobOpcode::DecryptSignature | JobOpcode::DecryptNSignature => {
|
||||
dst.put_u32(2 + u32::try_from(item.signature.len()).unwrap());
|
||||
dst.put_u16(u16::try_from(item.signature.len()).unwrap());
|
||||
if !item.signature.is_empty() {
|
||||
dst.put_slice(item.signature.as_bytes());
|
||||
}
|
||||
}
|
||||
JobOpcode::GetSignatureTimestamp => {
|
||||
dst.put_u32(8);
|
||||
dst.put_u64(item.signature_timestamp);
|
||||
}
|
||||
_ => {}
|
||||
|
Loading…
Reference in New Issue
Block a user