Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow only limited number of areas per player #20

Open
madmaxoft opened this issue Jan 20, 2014 · 2 comments
Open

Allow only limited number of areas per player #20

madmaxoft opened this issue Jan 20, 2014 · 2 comments

Comments

@madmaxoft
Copy link
Member

To help battle abuse, the plugin should allow players to claim only a limited number of areas. Once they hit the limit, they will not be allowed to claim new areas. Admins can enlarge the limit for individual players.
Questions:

  • global limit, or per-gallery limit?
  • total limit, or time-based limit (5 areas per hour) ?
  • default limit dependent on user's group (how? what with multiple groups?)

Can we detect if the player has modified an area "enough" to consider it a unique area? That way, normal happy users won't ever reach the limit, because once they build something, it is excluded from their limit, yet it would still eliminate malicious abusers trying to claim too many areas.

@NiLSPACE
Copy link
Member

One way to detect differences is simply checking each block.

local GalleryTemplate = -- cBlockArea template used in this gallery
local GalleryArea     = -- cBlockArea with all the blocks in the users gallery
local NumChanges = 0
for x = 0, 15, 1 do
   for y = 0, 255, 1 do
      for z = 0, 15, 1 do
         if (
            (GalleryTemplate:GetBlockType(x, y, z) ~= GalleryArea:GetBlockType(x, y, z))
            (GalleryTemplate:GetBlockMeta(x, y, z) ~= GalleryArea:GetBlockMeta(x, y, z))
         ) then
            NumChanges = NumChanges + 1
         end
      end
   end
end

if (NumChanges > AllowedChanges) then
   -- Do something
else
   -- Do something else
end

@madmaxoft
Copy link
Member Author

It'd be much easier to count the number of placed / broken blocks inside an area (and store that in the DB). Also that would disqualify WE edits (which in my opinion is a good thing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants