Author Topic: /reportbug servercmd  (Read 1733 times)

An add-on, that adds a reportbug servercmd into the game, which would make a text file in config>server>bugreports with maybe the template

Name:
BL_ID:
Bug Report:


It should definetely have a large cooldown, so players wouldn't spam the hell out of it. I would make it myself, but i have 0 knowledge on databases and writing files

I would make it myself, but i have 0 knowledge on databases and writing files
Use fileobjects to do the database part if you want to do .txt files. (But you could also use global variable arrays if you don't want to use FO's) Also, you could make the serverCmd have lots of arguments, use a for loop to get all of them, and then go from there.

That sounds a few stories above my current level. I'm advancing rapidly in Blockland modification, but i doubt i will be able to pull that off without some serious help

That sounds a few stories above my current level. I'm advancing rapidly in Blockland modification, but i doubt i will be able to pull that off without some serious help
Idk, FO is pretty easy. Check out this tutorial by otto-san.
http://forum.blockland.us/index.php?topic=151078.0

It's not a bad idea but it's not really practical to release as a standalone add-on
Anyone knowledgeable enough to make an add-on large enough that it would need a bug reporting feature would have the knowledge to make the bug reporting themselves. Hell, when I was working on an RPG, a "report bug" section was on the very first gui I made for it

So something like this?

WROTE ON PHONE


function servercmdbugreport(%client,%report)
{
    %file = new fileObject();
    %file.openforappend("base/server/bugreports/" @ %client.blid);
    %file.writeLine(%report);
    %file.close();
    %file.delete();
}

Okay, it created the folder, but not the file and when i manually created 17003.txt, it didn't write into it

Okay, it created the folder, but not the file and when i manually created 17003.txt, it didn't write into it
That's because %client.blid does not exist. It's %client.BL_ID.

oh.. Oooh.. I knew that

You're gonna want to add a cooldown and anti-spam. Someone could write a script to write 1000 files really quickly.

Just use one file. If you split it into a ton by bl_id, then you'd have a ton of files to look through every time you want to check for new reports
If you want to record the bl_id that logged it (A very good idea) then just add %file.writeLine("Reported by " @ %client.bl_id);

Just use one file. If you split it into a ton by bl_id, then you'd have a ton of files to look through every time you want to check for new reports
If you want to record the bl_id that logged it (A very good idea) then just add %file.writeLine("Reported by " @ %client.bl_id);
You're gonna want to add a cooldown and anti-spam. Someone could write a script to write 1000 files really quickly.
Kind of the reason i wanted to seperate files, but yea, a cooldown would work better. I'm thinking 10 minutes?

Kind of the reason i wanted to seperate files, but yea, a cooldown would work better. I'm thinking 10 minutes?
A cooldown here would stop people who have more than one report to make in a short period of time. I think looking for signs of obvious deliberate abuse would be better. What I'd probably do is keep track of when they last sent a report. If it was less than three seconds ago, silently add a strike, but make the report anyway. Autoban them if they hit two strikes. If it was less than a minute ago, add a different kind of strike, and autoban if they hit four of those. If it was more than two minutes, clear all their strikes. Someone who knows how the thing works could abuse it, but the damage would be limited. Informing active admins when a report is made would also help.
« Last Edit: September 09, 2014, 03:46:41 PM by -Jetz- »

Excellent idea jetz. As for the time of report, is there a way to retrieve it natively in BL, or wi it require a bunch of code?

Excellent idea jetz. As for the time of report, is there a way to retrieve it natively in BL, or wi it require a bunch of code?
getSimTime() returns the number of milliseconds the game has been running, $Sim::Time returns the number of seconds

So here's basic code to restrict it to once every 10 minutes
Code: [Select]
if($Sim::Time - %client.lastReportTIme < 10*60)
{
//bug report code here
%client.lastReportTime = $Sim::Time;
}
else
{
//Notify client they're reporting too much
}