ScreepsMods / screepsmod-mongo

Replace LokiJS with MongoDB and Redis
MIT License
24 stars 9 forks source link

Market broken #4

Closed JestDotty closed 6 years ago

JestDotty commented 6 years ago
TypeError: Cannot create property 'price' on string '{'
    at _getOrders (E:\servers\screeps-server\node_modules\@screeps\engine\dist\game\market.js:27:53)
    at Object. (E:\servers\screeps-server\node_modules\@screeps\engine\dist\game\market.js:41:26)
    at Object.getAllOrders (evalmachine.:1:72)

on v: "screepsmod-mongo": "^2.1.4"

all data is new, and there are NPC terminal orders in the market already...

AlinaNova21 commented 6 years ago

Is this with npm or docker container? that is all within the engine code and shouldn't be affected by screepsmod-mongo

JestDotty commented 6 years ago

Npm

Without mongodb it is not an issue (but then I have eperm db.json~ on rewrites/randomly)

On Nov 12, 2017 4:08 PM, "ags131" notifications@github.com wrote:

Is this with npm or docker container? that is all within the engine code and shouldn't be affected by screepsmod-mongo

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ScreepsMods/screepsmod-mongo/issues/4#issuecomment-343767884, or mute the thread https://github.com/notifications/unsubscribe-auth/AEgscOUy7gzt0HPf0-0QDxwLmGwBtsgmks5s115hgaJpZM4Qa_Aj .

AlinaNova21 commented 6 years ago

Hmm, windows or linux? NPC terminals? Is there orders returned from db['market.orders'].find()?

On Sun, Nov 12, 2017 at 4:23 PM JestDotty notifications@github.com wrote:

Npm

Without mongodb it is not an issue (but then I have eperm db.json~ on rewrites/randomly)

On Nov 12, 2017 4:08 PM, "ags131" notifications@github.com wrote:

Is this with npm or docker container? that is all within the engine code and shouldn't be affected by screepsmod-mongo

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/ScreepsMods/screepsmod-mongo/issues/4#issuecomment-343767884 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AEgscOUy7gzt0HPf0-0QDxwLmGwBtsgmks5s115hgaJpZM4Qa_Aj

.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ScreepsMods/screepsmod-mongo/issues/4#issuecomment-343773128, or mute the thread https://github.com/notifications/unsubscribe-auth/AA93D5wyR4udrYpGaKB39N21o0zp2MdUks5s12_FgaJpZM4Qa_Aj .

JestDotty commented 6 years ago

windows 8.1

there are 4*5+2=22 npc terminals all on the outside of the map and a bunch of orders:

image

seems it doesn't know what db is?

E:\servers\screeps-server>npm run cli

> screeps-server@1.0.0 cli E:\servers\screeps-server
> screeps cli

Screeps CLI connected on localhost:21026.
-----------------------------------------
Screeps server v2.10.4 running on port 21025.
This CLI interface contains a virtual JavaScript machine which you can use to invoke internal server commands. Any valid JavaS
cript code is allowed. Type "help()" to learn more about commands.
> db['market.orders'].find()
ReferenceError: db is not defined

however, storage.db['market.orders'].find() returns several: image

AlinaNova21 commented 6 years ago

Hmm, weird, I'll try to look into it on my side, it shouldn't ever be getting a string there, and screepsmod-mongo doesn't specifically touch market at all IIRC

AlinaNova21 commented 6 years ago

It looks like there was a bug fixed in the screeps code back in september but it may not have been published to npm yet. https://github.com/screeps/engine/commit/f67f8ff784b7df305a193864e5f3811deef11e8c#diff-a1e6b02db4d5d95fc63d922c782c32bf

JestDotty commented 6 years ago

issue does not happen if screepsmod-mongo is removed from mods.json

however, applying the hotfix in the linked commit did fix it O-o

AlinaNova21 commented 6 years ago

I'll have to poke at it some, i may be something done slightly different in the runtimeData population or something. I have posted an issue at https://github.com/screeps/engine/issues/69 to hopefully get updated in npm