Code Monkey home page Code Monkey logo

Comments (7)

agoodnap avatar agoodnap commented on May 20, 2024

I think holding the banDuration as an int (seconds) would be nicer, together with DateInfracted we could always get the exact end-date of a ban by adding the seconds to the DateInfracted date (a method the DateTime class provides)

So when we handle a user login we could check if they have any infractions where this calculated date is still in the future - > ergo they're still banned.

This way we wouldn't need isBan, since we can simply check if banDuration is 0. (I mentioned this in #23 too) If it is, the infraction was just a warning. (this would also work if we keep it a string(check for null or empty) , so if you don't agree with the above change still consider this one)

from smashhub.

Breadkenty avatar Breadkenty commented on May 20, 2024

I definitely like that approach better, I'll fix it on the issue here. Thanks!

from smashhub.

agoodnap avatar agoodnap commented on May 20, 2024

One issue that we would need to think about is permanent bans, since we cant represent those this way... (unless we just set the ban duration to int.MaxValue, but that doesn't seem too clean) Just thought of this, any ideas for that?

I guess we could also add a boolean isPermanent... Or just delete the User on perman bans and add their email to a blacklist? Seems a bit excessive though, since they may have submitted good combos even though they got banned and then those would be deleted. Or we set the banDuration to a negative value (-1) if its permanent and check for that, but that feels a bit hack-y... Just throwing ideas around here.

from smashhub.

skittlz444 avatar skittlz444 commented on May 20, 2024

I don't think you could have combo and comment id on report. You'll be able to access the report from the combo or comment respectively. This will stop the report object from getting unnecessarily bloated with ids.

from smashhub.

Breadkenty avatar Breadkenty commented on May 20, 2024

Yeah I was starting to feel that these models are looking messy with IDs that way. I'll remove it here. I wonder if we can just set the perma-bans to something unnecessarily long?

from smashhub.

agoodnap avatar agoodnap commented on May 20, 2024

We could set them to int.MaxValue and check for that, longer is impossible unless we change the data type, unless we treat the banTime not as seconds but days or something, that would work too.

from smashhub.

agoodnap avatar agoodnap commented on May 20, 2024

Anyway, I'll get started on this now and have a pull request up soon for review.

from smashhub.

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.