Git Product home page Git Product logo

Comments (8)

paullessing avatar paullessing commented on May 23, 2024

I have the same issue in 0.7.9; the "lightly encumbered" and "heavily encumbered" effects keep getting added and never removed, so I end up with tens of stacked "encumbered" effects.

from variantencumbrance.

VanirDev avatar VanirDev commented on May 23, 2024

Known issue with the current implementation. I'm working on a fix but the holidays have kept me busy unfortunately.

from variantencumbrance.

paullessing avatar paullessing commented on May 23, 2024

I've confirmed that this is a race condition caused when there are multiple clients open at the same time (which happens when there are multiple users logged in).

When an item is updated or added/removed, all clients simultaneously attempt to set the encumbrance, which causes them to stack. Because the current logic removes all previous effects and then adds its own, the stacking always happens whenever there are multiple clients open.

I attempted to fix this by updating the first found existing effect instead, but that does not solve the race condition that occurs when multiple clients try to create the effect at the same time, for the first time, or when switching between unencumbered and encumbered.

@VanirDev do you want to have a chat about how to solve this? I'm happy to have a stab at it on my own, but I'm new to Foundry development and you may have some insight that I don't. Contact me at paul@<myusername>.com if you're interested, otherwise I'll open another pull request once I've got a solution.

from variantencumbrance.

paullessing avatar paullessing commented on May 23, 2024

I've got a solution, and will be raising a pull request early this week once I've cleaned up my code.

from variantencumbrance.

VanirDev avatar VanirDev commented on May 23, 2024

I've got a solution, and will be raising a pull request early this week once I've cleaned up my code.

Great work! I'd love to see how you resolved the race condition. I've been frustratingly trying to find a way to execute code from the server's perspective instead of on a per-client basis, alas that doesn't seem possible.

from variantencumbrance.

VanirDev avatar VanirDev commented on May 23, 2024

I've confirmed that this is a race condition caused when there are multiple clients open at the same time (which happens when there are multiple users logged in).

When an item is updated or added/removed, all clients simultaneously attempt to set the encumbrance, which causes them to stack. Because the current logic removes all previous effects and then adds its own, the stacking always happens whenever there are multiple clients open.

This is the same behaviour that is causing the error notifications that people are seeing such as this #20, as when a client doesn't have permission to update the actor, it'll attempt to do so anyway and produce the error.

from variantencumbrance.

paullessing avatar paullessing commented on May 23, 2024

PR is open; I've got a game tomorrow night where I will be testing this.

from variantencumbrance.

VanirDev avatar VanirDev commented on May 23, 2024

PR is open; I've got a game tomorrow night where I will be testing this.

Thanks for this, I'll review it tomorrow when I have a chance. Let me know how your session goes, I'll probably use my own players as guinea pigs come Wednesday.

from variantencumbrance.

Related Issues (20)

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.