Skip to content

Commit

Permalink
Update v0.5.0 (#10)
Browse files Browse the repository at this point in the history
# Features
- Implemented multi-language support (english and italian at the moment).
- Implemented database auto-patcher (when the database need some changes now it will be automatically patched without deleting your schema).
- Implemented BlockSniper linking (from now you can rollback/restore selected areas and you can log all changes made with it).
- Implemented UI (accessible through the command **/bcp menu** or **/bcp ui**).

# Improvements
- Rollback/restore operations are now made asynchronously (that means performance and time are boosted).
- Big query are now built asynchronously (e.g. TNT explosions).
- Database requests are now correctly made asynchronously without blocking main thread.
- Some minor micro-optimizations.

# Bug fixes
- Fixed plugin reloading.
- Fixed "blocks" and "exclusions" parameters not correctly working.
- Fixed "rollback-items" config parameter that always rollback/restore when it's set on false.
- Some minor issues fixed.
  • Loading branch information
matcracker authored Aug 29, 2019
1 parent 6af8d24 commit af14df7
Show file tree
Hide file tree
Showing 44 changed files with 2,616 additions and 1,149 deletions.
8 changes: 6 additions & 2 deletions .poggit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ projects:
icon: resources/bedcoreprotect_logo.png
libs:
- src: poggit/libasynql/libasynql
version: ^3.2.0
version: 3.2.0
- src: JackMD/UpdateNotifier/UpdateNotifier
version: ^1.0.0
version: 1.0.0
- src: matcracker/FormLib/FormLib
version: 1.1.0
- src: SOF3/await-generator/await-generator
version: 2.2.0
...
7 changes: 5 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: BedcoreProtect
main: matcracker\BedcoreProtect\Main
version: 0.4.2
version: 0.5.0
api: [3.4.0]
mcpe-protcol:
- 354
- 361

softdepend: BlockSniper
load: POSTWORLD
author: matcracker
description: "BedcoreProtect is a fast, efficient, data logging and anti-griefing tool for PocketMine server. Rollback and restore any amount of damage"
Expand All @@ -32,4 +33,6 @@ permissions:
bcp.subcommand.restore:
description: "Allows the user to run the sub-command /bedcoreprotect restore"
bcp.subcommand.purge:
description: "Allows the user to run the sub-command /bedcoreprotect purge"
description: "Allows the user to run the sub-command /bedcoreprotect purge"
bcp.subcommand.menu:
description: "Allows the user to run the sub-command /bedcoreprotect menu"
19 changes: 14 additions & 5 deletions resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#BedcoreProtect Config
# Plugin language
language: eng

# Database settings
database:
# The database type. "sqlite" and "mysql" are supported.
type: sqlite
Expand All @@ -16,6 +19,9 @@ database:
password: ""
# The database name where plugin stores data.
schema:
# The maximum number of simultaneous SQL queries
# Recommended: 1 for sqlite, 2 for MySQL. You may want to further increase this value if your MySQL connection is very slow.
worker-limit: 1

# The timezone where you are located. This is necessary to correctly log the time of events.
# To find your timezone, check here: https://www.php.net/manual/en/timezones.php
Expand Down Expand Up @@ -64,7 +70,7 @@ block-ignite: true
# Logs explosions, such as TNT and Creepers.
explosions: true

# Track when an entity changes a block, such as an Enderman destroying blocks. (NOT FULLY IMPLEMENTED BY POCKETMINE YET)
# Track when an entity changes a block, such as an Enderman destroying blocks. (NOT FULLY IMPLEMENTED IN POCKETMINE YET)
entity-change: true

# Logs killed entities, such as killed cows and enderman.
Expand All @@ -79,13 +85,13 @@ buckets: true
# Logs natural tree leaves decay.
leaves-decay: true

# Logs tree growth. Trees are linked to the player who planted the sappling. (NOT IMPLEMENTED BY POCKETMINE YET)
# Logs tree growth. Trees are linked to the player who planted the sappling. (NOT IMPLEMENTED IN POCKETMINE YET)
tree-growth: true

# Logs mushroom growth. (NOT IMPLEMENTED BY POCKETMINE YET)
# Logs mushroom growth. (NOT IMPLEMENTED IN POCKETMINE YET)
mushroom-growth: true

# Logs natural vine growth. (NOT IMPLEMENTED BY POCKETMINE YET)
# Logs natural vine growth. (NOT IMPLEMENTED IN POCKETMINE YET)
vine-growth: true

# Logs water flow. If water destroys other blocks, such as torches,
Expand All @@ -108,3 +114,6 @@ item-transactions: true
# Track player interactions, such as when a player opens a door, presses
# a button, or opens a chest. Player interactions can't be rolled back.
player-interactions: true

# Logs changes made via the plugin "BlockSniper" if it's in use on your server.
blocksniper-hook: true
119 changes: 119 additions & 0 deletions resources/languages/eng.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
action.place = placed
action.break = broke
action.click = clicked
action.kill = killed
action.add = added
action.remove = removed
blocksniper.hook.success = BlockSniper properly hooked!
blocksniper.hook.no-hook = Unable to hook BlockSniper. Check if the plugin has been properly enabled.
command.description = It runs the BedcoreProtect commands.
command.usage = Usage: /bcp help to display commands list
command.no-permission = You don't have permission to run this command.
command.reload.success = Plugin configuration reloaded.
command.reload.no-success = Plugin configuration not reloaded due to some errors. Check your console to see the errors. Until you fix them, it will be used the old configuration.
command.status.version = Version: §f{%0}
command.status.database-connection = Database connection: §f{%0}
command.status.database-version = Database version: §f{%0}
command.status.blocksniper-hook = BlockSniper hook: §f{%0}
command.status.author = Author: §f{%0}
command.status.website = Website: §f{%0}
command.error.no-numeric-value = You need to insert a numeric value.
command.error.one-parameter = You must add at least one parameter.
command.error.no-console = You can't run this command from console.
command.purge.started = Data purge started. This may take some time.
command.purge.no-restart = Do not restart your server until completed.
command.purge.success = Data purge successful.
command.purge.deleted-rows = {%0} rows of data deleted.
command.inspect.enabled = Enabled inspector mode.
command.inspect.disabled = Disabled inspector mode.
command.near.range-value = The near value must be between 1 and {%0}!
command.rollback.started = Rollback started on "{%0}".
command.restore.started = Restore started on "{%0}".
command.help.title = Help Page
command.help.help = Display more info for that command.
command.help.help2 = Displays a list of all commands.
command.help.menu = Allows to use commands with a graphic interface.
command.help.inspect = Turns the blocks inspector on or off.
command.help.inspect1 = With the inspector enabled, you can do the following:
command.help.inspect2 = Left-click a block to see who placed that block.
command.help.inspect3 = Right-click a block to see what adjacent block was removed.
command.help.inspect4 = Place a block to see what block was removed at the location.
command.help.inspect5 = Place a block in liquid (etc) to see who placed it.
command.help.inspect6 = Right-click on a door, chest, etc, to see who last used it.
command.help.inspect7 = Tip: You can use just §3"/bcp i"§7 for quicker access.
command.help.parameters1 = Perform the command {%0}.
command.help.parameters2 = Specify the user(s) to {%0}.
command.help.parameters3 = Specify the amount of time to {%0}.
command.help.parameters4 = Specify a radius area to limit the {%0} to.
command.help.parameters5 = Restrict the {%0} to a certain action.
command.help.parameters6 = Restrict the {%0} to certain block types.
command.help.parameters7 = Exclude blocks/users from the {%0}.
command.help.parameters8 = Please see §3"/bcp help <param>"§7 for detailed parameter info.
command.help.radius-example = Only make changes within 10 blocks of you
command.help.rollback = Rollback block data.
command.help.restore = Restore block data.
command.help.lookup = Advanced block data lookup.
command.help.lookup1 = Use after inspecting a block to view different logs pages.
command.help.lookup2 = Use after inspecting a block to view more lines of logs in a page.
command.help.lookup3 = Please see "/bcp help params" for detailed parameters.
command.help.purge = Delete old block data.
command.help.purge1 = Delete data older than specified time.
command.help.purge2 = For example, "/bcp purge t:30d" will delete all data older than one month, and only keep the last 30 days of data.
command.help.reload = Reloads the configuration file.
command.help.status = Displays the plugin status.
command.help.examples = Examples
command.help.shortcut = Command shortcut.
command.help.block-names = Block names
command.help.info-not-found = Information for command "/bcp help {%0}" not found.
database.version.higher = Your database is running a higher version than BedcoreProtect. Please update the plugin if you want to use it.
database.version.updated = Your database is now updated from v{%0} to v{%1}.
database.connection.fail = Could not connect to the database! Check your connection, database settings or plugin configuration file.
form.menu.title = Main Menu
form.menu.option = Select an option:
form.menu.inspector = Enable/Disable inspector mode
form.menu.lookup = Lookup data
form.menu.purge = Purge data
form.menu.reload = Reload plugin
form.menu.status = Show plugin status
form.purge-menu.time = Delete data older than
form.input-menu.required-fields = Required fields:
form.input-menu.optional-fields = Optional fields:
form.input-menu.time = Time
form.input-menu.radius = Radius
form.input-menu.user-entity = User/Entity name
form.input-menu.user-entity-placeholder = Insert player name or #entity
form.input-menu.restrict-blocks = Restrict blocks (accepts ID:meta)
form.input-menu.exclude-blocks = Exclude blocks (accepts ID:meta)
general.action = Action
general.rollback = Rollback
general.restore = Restore
general.lookup = Lookup
generic.yes = Yes
generic.no = No
inspector.no-data = No block data found for this location.
inspector.more-lines = The lines number must be greater than 1.
inspector.page-not-exist = The page §6{%0}§c does not exist!
inspector.page = Page {%0}/{%1}
inspector.view-old-data = View older data by typing
language.name = English
parser.few-many-parameters = You are using too few or too many parameters (Max: {%0})
parser.invalid-parameter = Please specify a valid parameter. ({%0}).
parser.no-entity = The entity "{%0}" does not exist. (The name is case-sensitive)
parser.no-player = The player "{%0}" does not exist.
parser.invalid-amount-time = Please specify the amount of time.
parser.invalid-amount-radius = Please specify the amount of radius.
parser.invalid-radius = Please specify a valid radius.
parser.invalid-action = Please specify a valid action.
parser.invalid-block-include = Invalid block "{%0}" to include.
parser.invalid-block-exclude = Invalid block "{%0}" to exclude.
parser.missing-parameters = You are missing one of the following parameters: {%0}
rollback.completed = Rollback completed for {%0}.
rollback.date = Rolled back {%0}.
rollback.radius = Radius: {%0} block(s).
rollback.blocks = Approx. {%0} block(s) changed.
rollback.items = Approx. {%0} item(s) changed.
rollback.entities = Approx. {%0} entities(s) changed.
rollback.modified-chunks = Modified {%0} chunk(s).
rollback.time-taken = Time taken: {%0} second(s).
restore.completed = Restore completed for {%0}.
restore.date = Restored {%0}.
119 changes: 119 additions & 0 deletions resources/languages/ita.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
action.place = ha piazzato
action.break = ha rotto
action.click = ha cliccato
action.kill = ha ucciso
action.add = ha aggiunto
action.remove = ha rimosso
blocksniper.hook.success = BlockSniper agganciato correttamente!
blocksniper.hook.no-hook = Non è possibile aggangiare BlockSniper. Controlla se il plugin è abilitato.
command.description = Esegue i comandi di BedcoreProtect.
command.usage = Usa: /bcp help per mostrare la lista di comandi
command.no-permission = Non hai il permesso di eseguire questo comando.
command.reload.success = Configurazione del plugin ricaricate.
command.reload.no-success = Configurazione del plugin non ricaricata a causa di alcuni errori. Controlla la console per vederli. Finchè non li sistemerai, verrà usata la vecchia configurazione.
command.status.version = Versione: §f{%0}
command.status.database-connection = Connessione database: §f{%0}
command.status.database-version = Versione database: §f{%0}
command.status.blocksniper-hook = BlockSniper agganciato: §f{%0}
command.status.author = Autore: §f{%0}
command.status.website = Sito web: §f{%0}
command.error.no-numeric-value = Devi inserire un valore numerico.
command.error.one-parameter = Devi almeno aggiungere un parametro.
command.error.no-console = Non puoi eseguire questo comando dalla console.
command.purge.started = Eliminazione dei dati iniziata. Potrebbe richiedere del tempo.
command.purge.no-restart = Non riavviare il server finchè non sarà completato.
command.purge.success = Eliminazione dei dati eseguita con successo.
command.purge.deleted-rows = {%0} righe di dati eliminati.
command.inspect.enabled = Abilitata modalià ispettore.
command.inspect.disabled = Disabilitata modalità ispettore.
command.near.range-value = IL valore del raggio deve essere compreso tra 1 e {%0}!
command.rollback.started = Rollback iniziato in "{%0}".
command.restore.started = Ripristino iniziato in "{%0}".
command.help.title = Pagina d'aiuto
command.help.help = Mostra più informazioni per questo comando.
command.help.help2 = Mostra una lista di tutti i comandi.
command.help.menu = Permette di usare i comandi con una interfaccia grafica.
command.help.inspect = Attiva/Disattiva l'ispettore dei blocchi.
command.help.inspect1 = Con l'ispettore abilitato, puoi fare le seguenti cose:
command.help.inspect2 = Click sinistro su un blocco per vedere chi ha piazzato quel blocco.
command.help.inspect3 = Click destro su un blocco per vedere il blocco adiacente rimosso.
command.help.inspect4 = Piazza un blocco per vedere quale blocco è stato rimosso in quella posizione.
command.help.inspect5 = Piazza un blocco in un liquido (etc) per vedere chi l'ha piazzato.
command.help.inspect6 = Click destro su una porta, cassa, etc, per vedere chi l'ha usata per ultimo.
command.help.inspect7 = Suggerimento: puoi usare §3"/bcp i"§7 per un accesso rapido.
command.help.parameters1 = Esegue il comando {%0}.
command.help.parameters2 = Specifica l'utente/i da {%0}.
command.help.parameters3 = Specifica la quantità di tempo da {%0}.
command.help.parameters4 = Specifica un raggio per limitare la {%0}.
command.help.parameters5 = Restringe il {%0} in una certa azione.
command.help.parameters6 = Restringe il {%0} in alcuni tipi di blocco.
command.help.parameters7 = Esclude blocchi/utenti dal {%0}.
command.help.parameters8 = Per favore vedi §3"/bcp help <parametro>"§7 per informazioni dettagliate.
command.help.radius-example = Esegue cambiamenti solo nei 10 blocchi vicini a te
command.help.rollback = Rollback dati dei blocchi.
command.help.restore = Ripristina dati dei blocchi.
command.help.lookup = Consultazione avanzata dei dati dei blocchi.
command.help.lookup1 = Usa dopo aver ispezionato un blocco per vedere pagine di log differenti.
command.help.lookup2 = Usa dopo aver ispezionato un blocco per vedere più righe di log in una pagina.
command.help.lookup3 = Per favore vedi "/bcp help params" per il dettaglio dei parametri.
command.help.purge = Cancella vecchi dati dei blocchi.
command.help.purge1 = Cancella dati più vecchi del tempo specificato.
command.help.purge2 = Per esempio, "/bcp purge t:30d" cancellerà tutti i dati pù vecchi di un mese, e manterrà sono gli ultimi 30 giorni di dati.
command.help.reload = Ricarica la configurazione del plugin.
command.help.status = Mostra lo stato del plugin.
command.help.examples = Esempi
command.help.shortcut = Scorciatoia del comando.
command.help.block-names = Nomi dei blocchi
command.help.info-not-found = Informazioni per il comando "/bcp help {%0}" non trovate.
database.version.higher = Il tuo database sta eseguendo una versione più aggiornata di BedcoreProtect. Per favore aggiorna il tuo plugin se vuoi usarlo.
database.version.updated = Il tuo database è stato aggiornato dalla versione v{%0} alla v{%1}.
database.connection.fail = Impossibile connettersi al database! Controlla la tua connessione, impostazioni del database o la configurazione del plugin.
form.menu.title = Menu principale
form.menu.option = Seleziona un'opzione:
form.menu.inspector = Attiva/Disattiva modalità ispettore
form.menu.lookup = Consulta i dati
form.menu.purge = Elimina dati
form.menu.reload = Ricarica il plugin
form.menu.status = Mostra stato del plugin
form.purge-menu.time = Elimina dati più vecchi di
form.input-menu.required-fields = Campi richiesti:
form.input-menu.optional-fields = Campi opzionali:
form.input-menu.time = Tempo
form.input-menu.radius = Raggio
form.input-menu.user-entity = Nome dell'utente/entità
form.input-menu.user-entity-placeholder = Inserisci nome del giocatore o #entità
form.input-menu.restrict-blocks = Restringi blocks (accetta ID:meta)
form.input-menu.exclude-blocks = Escludi blocchi (accetta ID:meta)
general.action = Azione
general.rollback = Rollback
general.restore = Ripristino
general.lookup = Consulta
generic.yes = Si
generic.no = No
inspector.no-data = Nessun dato trovato in questa posizione.
inspector.more-lines = Il numero di linee deve essere più grande di 1.
inspector.page-not-exist = La pagina §6{%0}§c non esiste!
inspector.page = Pagina {%0}/{%1}
inspector.view-old-data = Vedi i dati vecchi scrivendo
language.name = Italiano
parser.few-many-parameters = You are using too few or too many parameters (Max: {%0})
parser.invalid-parameter = Per favore specifica un parametro valido. ({%0}).
parser.no-entity = L'entità "{%0}" non esiste (il nome è case-sensitive)
parser.no-player = Il giocatore "{%0}" non esiste.
parser.invalid-amount-time = Per favore specifica la quantità del tempo.
parser.invalid-amount-radius = Per favore specifica la quantità del raggio.
parser.invalid-radius = Per favore specifica un raggio valido.
parser.invalid-action = Per favore specifica un'azione valida.
parser.invalid-block-include = Blocco "{%0}" invalido da includere.
parser.invalid-block-exclude = Blocco "{%0}" invalido da escludere.
parser.missing-parameters = Stai dimenticando uno dei seguenti paramentri: {%0}
rollback.completed = Rollback completato per {%0}.
rollback.date = Rolled back {%0}.
rollback.radius = Raggio: {%0} block(s).
rollback.blocks = Circa {%0} blocco/hi cambiato/i.
rollback.items = Circa. {%0} oggetto/i cambiato/i.
rollback.entities = Circa {%0} entità cambiate.
rollback.modified-chunks = Modificato/i {%0} chunk.
rollback.time-taken = Tempo impiegato: {%0} secondo/i.
restore.completed = Ripristino completato per {%0}.
restore.date = Ripristinato {%0}.
Loading

5 comments on commit af14df7

@SOF3
Copy link

@SOF3 SOF3 commented on af14df7 Oct 1, 2019

Choose a reason for hiding this comment

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

Dear @matcracker,

I regret to inform you that your plugin "BedcoreProtect" (v0.5.0 submitted on 2019-08-29T10:09:45.000Z) has been rejected.

Use Level->getFolderName() instead of Level->getName() to identify worlds.

Please resolve these issues and submit the plugin again.

This comment is posted here because this is the last commit when the released build was created.

@matcracker
Copy link
Owner Author

Choose a reason for hiding this comment

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

Can you explain me why?
Then, why is it in the API if we can't use it...

@SOF3
Copy link

@SOF3 SOF3 commented on af14df7 Oct 1, 2019

Choose a reason for hiding this comment

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

Level->getName() is the name in the level NBT, and is only used for cosmetic purposes. To identify a level by name uniquely (which is used in getLevelByName), use folder name.

@matcracker
Copy link
Owner Author

Choose a reason for hiding this comment

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

I always thought the opposite. getFolderName() used for cosmetic and getName() for the name uniquely

@SOF3
Copy link

@SOF3 SOF3 commented on af14df7 Oct 1, 2019

Choose a reason for hiding this comment

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

No. That's why we're removing getName() in 4.0.0

Please sign in to comment.