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

Stores whole image in the images folder and adds moderation commands #40

Closed
wants to merge 5 commits into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Nov 23, 2017

This pull req adds a few commands and removes a few unnecessary imports. Nothing too major; The new commands have permissions imageonmap.command.other, and simply allows administrative action. It's possible that merging could close Issue #30.

Update:
Config.yml is read now, and has lots of variables.
PluginConfiguration can init, which may or may not be necessary.
Full image saving works, so Issue #36 can close. The format for naming is "_<start MAPID>-<end MAPID>.png"

Closes #30
Closes #36

kirbykirby56 added 3 commits November 23, 2017 03:06
Added Delete/Get/List other commands, where the user can modify the maps of others. These commands require permissons imageonmap.list.other, imagonmap.delete.other, and imageonmap.get.other.
@ghost ghost changed the title Kirbykirby56 Close Issues #30 and #36, config.yml is read. Nov 23, 2017
Copy link
Member

@AmauryCarrade AmauryCarrade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for the pull request.

I don't precisely understand—why did you do that to the plugin configuration loader? The class was intended to work that way, using zLib to read it and make the configuration available. And if you want anyway to parse config.yml, you should use a YAML parser (one is even included right into Bukkit), not a line-per-line manual parsing.

I cannot accept this PR as-is, sorry. Rollback your changes regarding the configuration, at least, as it's fully working right now.

On another side, your indentation is a bit weird. Is that normal?

On another side (we've got plenty of sides), you should make one PR per subject instead of a global one for everything :) .

@@ -69,6 +63,11 @@ public File getImageFile(short mapID)
return new File(imagesDirectory, "map"+mapID+".png");
}

public File getFullImageFile(short mapIDstart, short mapIDend)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into the image.ImageMap class (and without parameters, using its attributes).

saveDefaultConfig();

loadComponents(I18n.class, Gui.class, Commands.class, PluginConfiguration.class, ImageIOExecutor.class, ImageRendererExecutor.class);

PluginConfiguration.initialize();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be removed (the configuration is working right now).

//Init all the things !
MetricsLite.startMetrics();
I18n.setPrimaryLocale(PluginConfiguration.LANG.get());
I18n.setPrimaryLocale(PluginConfiguration.LANG);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be rollbacked (the configuration is working right now).

@@ -57,7 +57,7 @@
*/
static public void startMetrics()
{
if(!PluginConfiguration.COLLECT_DATA.get()) return;
if(!PluginConfiguration.COLLECT_DATA) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be rollbacked (the configuration is working right now).

import fr.moribus.imageonmap.commands.maptool.ListCommand;
import fr.moribus.imageonmap.commands.maptool.MigrateCommand;
import fr.moribus.imageonmap.commands.maptool.NewCommand;
import fr.moribus.imageonmap.commands.maptool.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid star imports please :)


@CommandInfo (name = "deleteother", usageParameters = "<player name> <map name>")
@WithFlags ({"confirm"})
public class DeleteOtherCommand extends IoMCommand
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same command should be used, instead of another set for moderators. This being said, it poses the problem regarding multi-words map names.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we did make delete work for other players, shouldn't we also concatenate all of the commands to one? I feel it makes a little more sense as it is, and you're right- multi-word map names would pretty easily break it. (Especially if they had a playername in one)

int mapGlobalLimit = PluginConfiguration.MAP_GLOBAL_LIMIT.get();
int mapPersonalLimit = PluginConfiguration.MAP_PLAYER_LIMIT.get();
int mapGlobalLimit = PluginConfiguration.MAP_GLOBAL_LIMIT;
int mapPersonalLimit = PluginConfiguration.MAP_PLAYER_LIMIT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be rollbacked (the configuration is working right now).

@@ -154,7 +155,7 @@ public void checkMapLimit(ImageMap map) throws MapManagerException

public void checkMapLimit(int newMapsCount) throws MapManagerException
{
int limit = PluginConfiguration.MAP_PLAYER_LIMIT.get();
int limit = PluginConfiguration.MAP_PLAYER_LIMIT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be rollbacked (the configuration is working right now).

@@ -3,6 +3,7 @@ new: Creates a new ImageOnMap
delete: Deletes a map.
delete-noconfirm: Deletes a map. Deletion is permanent and made without confirmation
get: Gives you a map.
getother: Opens another's MapTool GUI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description is wrong, this does not open a GUI.

- get copies of maps you rendered;
- get parts of posters in case of need;
- delete or rename your maps (organization!);
- see their statistics (maps rendered, left...).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before: the description is wrong.

@AmauryCarrade AmauryCarrade changed the title Close Issues #30 and #36, config.yml is read. Stores whole image in the images folder and adds moderation commands Jan 24, 2018
@ghost
Copy link
Author

ghost commented Mar 18, 2018

After a forever lol, I'm gonna start working on this. Sorry about all of the configuration trash- I was having lots of difficulty with it XD. I'm hoping to get the changes fixed by the end of the week, if someone hasn't already done them.

@AmauryCarrade
Copy link
Member

AmauryCarrade commented Mar 19, 2018

While you're at it, prefer to open two separate pull requests, one for the images storage, and the other for the moderation commands & tools. Thanks!

@ghost
Copy link
Author

ghost commented Mar 19, 2018 via email

@ghost
Copy link
Author

ghost commented Mar 25, 2018

Closing for the next two pull requests: ImageRenderExecutor's save-full-image and limit-size-x/y, and the administrative commands.

@ghost ghost closed this Mar 25, 2018
@ghost ghost deleted the Kirbykirby56 branch March 25, 2018 01:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to store whole images in the image folder. Shared admin account
1 participant