diff --git a/CHANGELOG.md b/CHANGELOG.md index 84b5bab8..4dd02128 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ Unreleased ### Breaking: -- Change return type of `Structure::destroy` from `i8` to `Result<(), ErrorCode>`. +- Change return type of `Structure::destroy` from `i8` to `Result<(), ErrorCode>` +- Change inner u8 of `RoomCoordinate` to private +- Use `f64` instead of `u64` to work around bindgen expecting `BigInt` return values 0.22.0 (2024-08-27) =================== diff --git a/src/game/cpu.rs b/src/game/cpu.rs index 5120e354..6a733b82 100644 --- a/src/game/cpu.rs +++ b/src/game/cpu.rs @@ -32,7 +32,7 @@ extern "C" { #[cfg(feature = "mmo")] #[wasm_bindgen(js_namespace = ["Game"], js_class = "cpu", static_method_of = Cpu, getter, js_name = unlockedTime)] - fn unlocked_time() -> Option; + fn unlocked_time() -> Option; #[wasm_bindgen(js_namespace = ["Game"], js_class = "cpu", static_method_of = Cpu, js_name = getHeapStatistics)] fn get_heap_statistics() -> HeapStatistics; @@ -90,10 +90,11 @@ pub fn unlocked() -> bool { Cpu::unlocked() } +// note: f64 due to https://github.com/rustwasm/wasm-bindgen/issues/4113 /// If your account has been unlocked for a limited time, contains the time /// it's unlocked until in milliseconds since epoch. #[cfg(feature = "mmo")] -pub fn unlocked_time() -> Option { +pub fn unlocked_time() -> Option { Cpu::unlocked_time() } diff --git a/src/game/market.rs b/src/game/market.rs index 3f100d9c..6d63faff 100644 --- a/src/game/market.rs +++ b/src/game/market.rs @@ -210,7 +210,7 @@ extern "C" { /// Tick of order creation, `None` for intershard orders. #[wasm_bindgen(method, getter)] pub fn created(this: &Order) -> Option; - // todo should be u64 but seems to panic at the moment, follow up + // note: f64 due to https://github.com/rustwasm/wasm-bindgen/issues/4113 /// Timestamp of order creation in milliseconds since epoch. #[wasm_bindgen(method, getter = createdTimestamp)] pub fn created_timestamp(this: &Order) -> f64; @@ -307,9 +307,10 @@ extern "C" { /// Tick of order creation, `None` for intershard orders #[wasm_bindgen(method, getter)] pub fn created(this: &MyOrder) -> Option; + // note: f64 due to https://github.com/rustwasm/wasm-bindgen/issues/4113 /// Timestamp of order creation in milliseconds since epoch #[wasm_bindgen(method, getter = createdTimestamp)] - pub fn created_timestamp(this: &MyOrder) -> u64; + pub fn created_timestamp(this: &MyOrder) -> f64; #[wasm_bindgen(method, getter)] pub fn active(this: &MyOrder) -> bool; #[wasm_bindgen(method, getter = type)]