Staartvin / Autorank-2

Autorank is a Spigot/Bukkit plugin for automatically ranking players based on requirements
Other
56 stars 62 forks source link

Error when you don't set the block data type #440

Closed TomLewis closed 7 years ago

TomLewis commented 7 years ago

Ahoy! Took me a while to figure out why I was getting internal errors; When you use blocks broken, and you don't set a data parameter then youll get an internal error, It was either one of these, I cant remember, I think it was block 17. blocks broken: 56;5;0 blocks broken2: 17;700;0 If you leave the 0 of one of those you'll get an internal server error when you do an /ar check You should default to 0 if none is put in.

Staartvin commented 7 years ago

Hmm, strange; I don't seem to get that error. I used this config:

Test:
  prerequisites:
    world: world_nether
    money: 1000
    blocks broken: 56;100
  requirements:
    money: 10000
    blocks broken: 50
  results:
    rank change: TestGroup2
    command: broadcast &p has just completed path 'Default'!
    command2: give &p 1 100
    message: Congratulations, you completed the 'Default' path!
  options:
    display name: Test path

Worked fine for me. Maybe something else was incorrectly formatted?

TomLewis commented 7 years ago

Try 17;700 instead of 56;100, I cant remeber what one flagged it.

Staartvin commented 7 years ago

Nope, those both seem to work fine. Well, if you encounter it again, make sure to report it!

TomLewis commented 7 years ago

I just want to make sure you are testing with stats3 and not statz, as thats what im using, I have statz installed just to hook into stats3.

Sailor:
  prerequisites:
    in group: 'Sailor'
    time: 3d
  requirements:
    time: 3d
    blocks placed: 10000
    exp: 60
    blocks broken: 56;5;0
    blocks broken2: 17;700;0
    players killed: 20
  results:
    rank change: Sailor;Carpenter
    command: 'broadcast &p has just been promoted to Carpenter!; give &p 383:50 32; give &p 368 32; give &p 279 1; give &p 17 64; give &p 17:1 64; give &p 17:2 64; give &p 17:3 64; tell &p Gifted some goodies!'
    message: 'Congratulations, you are now a Carpenter. See www.piratemc.com/ranks'
  options:
    display name: Carpenter

This is what I have.

Staartvin commented 7 years ago

I testing it with Statz. Please be advised that Autorank 4 will drop support for Stats 3 (as it is very buggy).

Staartvin commented 7 years ago

You can convert Stats 3 data to Statz data if you'd like.

TomLewis commented 7 years ago

There was a few UI issues with Statz that never got fixed (Im PirateCraft on Spigot), and I wasnt sold on the database, you said you may chance it, and I cant be messing around with the insane amount of data I have, It took 2 DAYS to convert my Stats2 to Stats3, I have 3/4 years of data from 80,000 players, thats a lot of data, I only (This Wednesday) managed to get stats2 to convert to stats3, and even if I got all stats3 & autorank working by tonight, I still would loose 3 days of stats data from all the players, but I hit a brick wall when Autorank doesn't convert old data, its just ridiculous. Please don't drop Stats3 just yet, there is absolutely no reason to drop it, at all and it gives us server owners time to figure it all out, Statz isnt ready, it hasn't got a solid database schema, and its UI needs a lot of work (I posted in detail what it needs). Keep Stats3, Its not going to change any time soon, and then we can migrate to Statz when its more stable/mature and has a database schema this is 100% perfect. I DO NOT want to have to go through this utter mess of moving between database schemas again.

Staartvin commented 7 years ago

Hmm, I think I wrote a converter from Stats 3 to Statz. Is there any particular reason you do not want to use? You're free to reject of course. I agree somewhat that Statz database is not fully optimized yet, but Stats is not being updated any more. In my honest opinion, it seems buggy. I don't blame the author per se, it's also a mess because of the rewriting to Stats 3.

Staartvin commented 7 years ago

I'm curious, what would you like to see sorted before considering Statz a more mature plugin. I'm interested in making Statz as stable as possible of course.

TomLewis commented 7 years ago

I will write you up exactly what needs to be updated and changed to make Statz production ready, I need to focus on getting my actual server updated from Stats2 and an ancient version of autorank to Stats3 and the latest autorank first, I need to complete this step Im stuck, I cant even update my permissions system as im stuck on stats2. I need you to just let me use Stats3 for a bit, so I can get it converted from Stats2. I will write you a massive list, but my time is limited to very small pockets of time.

ljacqu commented 7 years ago

I'm curious, what would you like to see sorted before considering Statz a more mature plugin

From a technical point of view, it's apparent that the code base grew "organically" and it could use some restructuring.

Staartvin commented 7 years ago

@ljacqu While developing, I tried to keep it as organized as possible, but I'll see what I can do!

TomLewis commented 7 years ago

@ljacqu Maybe you could give some pointers to how it could be better organized? I will create a massive list of what needs to be improved/added into Statz on the Statz Issue system once I have fully upgraded to Stats3 and a newer version of Autorank, Im very far behind and struggling with issues of Autorank working with Stats3 properly/Converting my Autorank data, im hoping V4 will fix all these.

ljacqu commented 7 years ago

Here we go!

Project setup

Nothing wrong with keeping them as backup if the repository is down but typically you want to avoid using local folders whenever possible.

General findings

Specific issues

Staartvin commented 7 years ago

Wow. I was blown away by your post! Many thanks for all the suggestions, you are so right about most of it. As you've said a few times in your post, making suggestions is hard when you're not 'too familiar' with the code, but you did a really good job; I certainly have some work to do.

You also mentioned something about unit tests. I know what they are, but have never written any nor tested with it. Maybe you could provide a few (as well as the infrastructure needed for it to be used)?

I claim to be no expert programmer, but it's good to get some proper feedback about my codebase, it doesn't happen that often ;-) You mentioned some new concepts that I'm currently not familiar with (for example Dependency Injection). Let's hope I can grasp these concepts properly and am able to implement them. If you feel like providing suggestions or contribute to the codebase, you are more than welcome to!

Thanks a bunch and I'll get coding!

PS. I've saved this post for offline reading (if you don't mind), so I can come back to it.

TomLewis commented 7 years ago

@ljacqu Holy crap that post! the detail is amazing! Seriously thank you for writing that in detail, it means a lot to me to get a solid statistics recording plugin that is awesome, I rely on it! having a backbone breakdown like you have just posted is utterly amazing.

Staartvin commented 7 years ago

@FrozenBeard I'm still eagerly awaiting your suggestions for new (and probably) better features :)

TomLewis commented 7 years ago

@Staartvin They will come! I need to still get myself off stats2, to stats3 and the new Autorank (Gotta find the time to test with V4!) Then once this is stable and in production, I will test a convert to Statz and run it through its paces! I already have a rough list of ideas, but I want to give you a solid list!

ljacqu commented 7 years ago

Thanks for the positive feedback, @Staartvin @FrozenBeard. I didn't know what reaction this would get since it's a touchy situation to pop out of the blue with a wall of text. :smile:

making suggestions is hard when you're not 'too familiar' with the code

Yeah, I don't think it's OK to be like "this is not good" and not to offer suggestions for improvement. You can ask me for clarifications or suggestions for any of the points I brought up. Might just take a while for some of the bigger stuff for me to get familiar more :3

unit tests. [...] Maybe you could provide a few (as well as the infrastructure needed for it to be used)?

Absolutely! Testing is my thing so you'll have a PR coming your way. I help maintain AuthMe and the project has 832 unit tests right now... :P

Dependency Injection). [...] If you feel like providing suggestions or contribute to the codebase, you are more than welcome to!

Thanks! Dependency injection is another thing that was introduced into AuthMe and the solution for it eventually became a separate project that is now used by AuthMe, PerWorldInventory & voxelwind. Guice is another option. I can give a detailed comparison, and just for the record I'm not trying to force "mine" onto this project (no matter how this looks lol). (In short: Guice is a standard framework people will be familiar with and has more features; the linked injector is smaller in file size, defaults to wiring up singletons and you can @ me anytime for support and feature requests.)

I've saved this post for offline reading (if you don't mind)

I'm just really happy that my post is noticed—please, do whatever you want with it.