GithubHelp home page GithubHelp logo

screepsmod-market's People

Contributors

alinanova21 avatar dependabot[bot] avatar magnusesp avatar marvin-bitterlich avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

magnusesp

screepsmod-market's Issues

Orders are added to the database but none appear in game

This mod appears to be adding orders but none of them show up in the game. Is there something else that needs to be done? Any tips on how to debug this?

Also, I'm a bit confused about whether this mod is needed or not. There's a builtin recreateNpcOrders cron job which runs and also creates orders, but without this mod the credits indicator never shows in the client and the market pages are not accessible?

Bug: old orders (that no longer function) are still returned by Game.market.getAllOrders()

Bug situation:

There are orders that do not work (Game.market.deal returns OK, but the resources/credits never exchange). I tested some of these broken IDs one by one, making sure that the terminal had enough energy, there were enough credits, and no other deals were going on that tick.

What I think happened:

I had changed market.yml to sell only 200,000 of each resource instead of 1,000,000 of each resource (and also used admin-utils to wipe and re-spawn NPC Terminals), and the broken orders are all the old 1,000,000 ones, which still show in the in-client market UI and are returned by Game.market.getAllOrders(). Again, Game.market.deal on these orders returns OK but does not successfully complete.

I think the bug stems from the mod code not removing orders if the original terminals don't exist anymore, or some other variation of a dangling/orphan issue.

How I figured it out:

I added a blacklist array to my code that order IDs were added to after attempting them, and suddenly all my rooms were trading again after a few ticks (they swam through all the fake/busted orders). I have it temporarily fixed by filtering for orders <= 200000 amount, since all the 1000000 orders are the broken ones.

Cheers,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.