rustyscreeps/screeps-starter-rust

Unable to run loop on screeps server

Closed this issue · 2 comments

Builds and deploys fine to a custom branch, but once uploaded, errors every game tick with following.

Running
cargo-web 0.6.25
cargo-screeps 0.3.2

[9:16:00 PM]
[shard3]
Encountered a panic!
[9:16:00 PM]
[shard3]
Panic error message: js_unwrap_ref at 97 in /home/nathan/.cargo/registry/src/github.com-1ecc6299db9ec823/screeps-game-api-0.3.0/src/objects/impls/room.rs: Custom("reference is of a different type")
[9:16:00 PM]
[shard3]
Panic location: src/libcore/result.rs:999
[9:16:00 PM]
[shard3]
caught exception: RuntimeError: unreachable
[9:16:00 PM]
[shard3]
stack trace: RuntimeError: unreachable
    at rust_panic (wasm-function[302]:1)
    at _ZN3std9panicking20rust_panic_with_hook17hb28be2a997d5ba6bE (wasm-function[146]:295)
    at _ZN3std9panicking18continue_panic_fmt17hbaf4784add2a20d6E (wasm-function[317]:75)
    at rust_begin_unwind (wasm-function[358]:3)
    at _ZN4core9panicking9panic_fmt17h397a7cc335e27a97E (wasm-function[139]:70)
    at _ZN4core6result13unwrap_failed17h6d22ccea19cf2bb3E (wasm-function[68]:104)
    at _ZN20screeps_starter_rust9game_loop17h7efde4684b3fabf1E (wasm-function[56]:16842)
    at _ZN188_$LT$stdweb..webcore..newtype..Newtype$LT$$LP$stdweb..webcore..serialization..FunctionTag$C$$u20$$LP$$RP$$RP$$C$F$GT$$u20$as$u20$stdweb..webcore..serialization..FuncallAdapter$LT$F$GT$$GT$15funcall_adapter17hd83e4b7304ed801dE (wasm-function[54]:438)
    at Object.Module.STDWEB_PRIVATE.dyncall (main:452:40)
    at output (main:151:39)
[9:16:00 PM]
[shard3]
resetting VM next tick.
[9:16:02 PM]
[shard3]
Encountered a panic!
[9:16:02 PM]
[shard3]
Panic error message: js_unwrap_ref at 97 in /home/nathan/.cargo/registry/src/github.com-1ecc6299db9ec823/screeps-game-api-0.3.0/src/objects/impls/room.rs: Custom("reference is of a different type")
[9:16:02 PM]
[shard3]
Panic location: src/libcore/result.rs:999
[9:16:02 PM]
[shard3]
caught exception: RuntimeError: unreachable
[9:16:02 PM]
[shard3]
stack trace: RuntimeError: unreachable
    at rust_panic (wasm-function[302]:1)
    at _ZN3std9panicking20rust_panic_with_hook17hb28be2a997d5ba6bE (wasm-function[146]:295)
    at _ZN3std9panicking18continue_panic_fmt17hbaf4784add2a20d6E (wasm-function[317]:75)
    at rust_begin_unwind (wasm-function[358]:3)
    at _ZN4core9panicking9panic_fmt17h397a7cc335e27a97E (wasm-function[139]:70)
    at _ZN4core6result13unwrap_failed17h6d22ccea19cf2bb3E (wasm-function[68]:104)
    at _ZN20screeps_starter_rust9game_loop17h7efde4684b3fabf1E (wasm-function[56]:16842)
    at _ZN188_$LT$stdweb..webcore..newtype..Newtype$LT$$LP$stdweb..webcore..serialization..FunctionTag$C$$u20$$LP$$RP$$RP$$C$F$GT$$u20$as$u20$stdweb..webcore..serialization..FuncallAdapter$LT$F$GT$$GT$15funcall_adapter17hd83e4b7304ed801dE (wasm-function[54]:438)
    at Object.Module.STDWEB_PRIVATE.dyncall (main:452:40)
    at output (main:151:39)
[9:16:02 PM]
[shard3]
resetting VM next tick.
[9:16:05 PM]
[shard3]
main:825
                $0 = Module.STDWEB_PRIVATE.to_js($0);var game_loop=($0);module.exports.loop=function(){try{game_loop();}catch(error){console_error("caught exception:",error);if(error.stack){console_error("stack trace:",error.stack);}console_error("resetting VM next tick.");module.exports.loop=function(){__initialize(new WebAssembly.Module(require("compiled")),false);module.exports.loop();}}}
                                                                                                                                                                                                                                                                                                                 ^

ReferenceError: __initialize is not defined
    at Object.module.exports.loop (main:825:306)
    at __mainLoop:1:52
    at sigintHandlersWrap (vm.js:98:15)

@NathanielPerkins is it fixed? I ran the starter code yesterday without problem.

@NathanielPerkins My apologies that we didn't respond to this at an earlier time, when it was probably still applicable.

Since this issue, we've had a number of fixes which may or may not have fixed this.

If you're still having problems with the current version, feel free to reply under here or open a new issue. Thanks!