fix #47 and fix #48

This commit is contained in:
shenjack 2023-07-24 09:56:52 +08:00
parent 2ad60e398c
commit 893872c012
Signed by: shenjack
GPG Key ID: 7B1134A979775551
5 changed files with 33 additions and 6 deletions

View File

@ -3,7 +3,31 @@
- 最新版本号
- DR game: 0.3.2.0
- DR rs: 0.2.19.0
- DR rs: 0.2.20.1
## 20230724 DR rs 0.2.20.1
### Fix
- [#48](https://github.com/shenjackyuanjie/Difficult-Rocket/issues/48)
- `missing field version`
- SR1 says: `version` field is NOT Required
- make them happy
- SR1 说: `version` 字段也是可选的
- 让他们开心
- 我谢谢您啊 Jundroo
- 我就看看我能发多少个 issue
## 20230724 DR rs 0.2.20.0
### Fix
- [#47](https://github.com/shenjackyuanjie/Difficult-Rocket/issues/47)
- `editorAngle field is Option<i32>`
- SR1 says: `editorAngle` field is Optional
- make them happy
- SR1 说: `editorAngle` 字段是可选的
- 让他们开心
## 20230721 DR rs 0.2.19.0

View File

@ -24,7 +24,7 @@ enum LoadState {
}
#[pyfunction]
fn get_version_str() -> String { "0.2.20.0".to_string() }
fn get_version_str() -> String { "0.2.20.1".to_string() }
#[pyfunction]
fn test_call(py_obj: &PyAny) -> PyResult<bool> {

View File

@ -387,7 +387,9 @@ pub mod ship {
pub parts: Parts,
#[serde(rename = "Connections")]
pub connects: Connections,
pub version: i32,
pub version: Option<i32>, // Option for https://github.com/shenjackyuanjie/Difficult-Rocket/issues/48
// SR1 says version is also optional, let them happy
// it's always 1
#[serde(rename = "liftedOff")]
pub lift_off: i8,
#[serde(rename = "touchingGround")]
@ -423,6 +425,7 @@ pub mod ship {
pub y: f64,
#[serde(rename = "editorAngle")]
pub editor_angle: Option<i32>, // Option for https://github.com/shenjackyuanjie/Difficult-Rocket/issues/47
// SR1 says it's optional, let them happy
pub angle: f64,
#[serde(rename = "angleV")]
pub angle_v: f64,
@ -570,7 +573,7 @@ pub mod ship {
SR1Ship {
name: name.unwrap_or("NewShip".to_string()),
description: "".to_string(),
version: self.version,
version: self.version.unwrap_or(1_i32),
parts,
connections,
lift_off: i8_to_bool(self.lift_off.to_owned()),

View File

@ -977,7 +977,7 @@ pub mod sr1 {
RawShip {
parts: RawParts { parts },
connects: connections,
version: self.version,
version: Some(self.version),
lift_off: bool_to_i8(self.lift_off),
touch_ground: bool_to_i8(self.touch_ground),
disconnected,

View File

@ -16,7 +16,7 @@ from Difficult_Rocket.api.mod import ModInfo
from Difficult_Rocket.client import ClientWindow
from Difficult_Rocket.api.types import Options, Version
DR_rust_version = Version("0.2.20.0") # DR_mod 的 Rust 编写部分的兼容版本
DR_rust_version = Version("0.2.20.1") # DR_mod 的 Rust 编写部分的兼容版本
logger = logging.getLogger('client.dr_game')