Ulysses Stuff > Ulysses Release Archives
Report Module 1.3
Chironex:
I wrote this little module there is a few day for our server, so people can easily report bugs or spammers or anything else. I was thinking some of you could be interested by this script, so here it is.
The reports are sent to online admins, and written into a file, by default in "ulx_logs/reports.txt", with timestamp and reporter's name/steamid. If the option is enabled, it also logs into the daily log files.
There is an antispam (thanks JamminR for this idea)
-It limits the report length to 128 characters (only the console is affected as the chat is already 128 chars max)
-A player can only report once then he need to wait the interval before being able to report again (default is 120 seconds)
#Changelog:
1.3: [add] command help moved into "Utilities" Category (if using ULX 3.20 or greater)
[add] some comments
[change] minor and useless changes
1.2: [fix] some idiotic bugs, improved code a bit
1.1: [add] antispam
[add] log in daily files (as an option)
1.0: [initial release]
#Commands:
"!report <text>" in chat
"ulx report <text>" in console
#Admins Cvars:
"ulx_reports_enabled" <0-1>
"ulx_reports_in_logs" <0-1>
"ulx_reports_interval" <time>
"ulx_reports_folder" <folder>
#Installation for ULX svn:
- Put "reports.lua" file into "ulx/lua/ulx/modules"
- Restart your server.
#Installation for ULX 3.11:
- Put "reports.lua" file into "ulx/lua/ulx" folder
- In the same folder, open "init.lua", locate the line (line 27 or near):
--- Code: --- Msg( "// Load Complete! //\n" )
--- End code ---
- And add these lines just before:
--- Code: --- Msg( "// reports.lua //\n" )
include( "ulx/reports.lua" )
--- End code ---
- Save and restart your server.
Don't forget to open "reports.lua" and modify settings as you want, if you want.
Megiddo:
Very nice Kyzer! We've been talking about making something like this for ULX v3.2 (though a bit more complicated than simple file logging) but haven't gotten around to it yet/made a final decision about it. We'll be interested to see what people think about this.
Also, sorry about the not allowing the lua extension. It should be fixed now, so go ahead and change it. :)
Chironex:
Yes, attachment fixed :) Thanks
JamminR:
Nice Kyzer!
Few suggestions.
1) Anti-spam - Length and how many times in a period (1 minute?)
I could see some idiot minge realizing this was on the server, and going to console and just typing "ulx report blahblahblah..." as much as the input would take, as many times as he could. May not crash a server, but sure would fill useless text.
If no admin was on, and the host only checked his logs once a day or so, lots of wasted space.
2) How about setting a user editable variable at the top of the script, default off, whereby the report would also inject the report into normal logs.
Though the reports log file has a date stamp of course, it might also be handy while just reviewing logs to search for the same report near some event.
Seeing 50 exp barrels spawned by one user right above the report of "<time> blah spawned and exploded barrels, trying to break my stuff", I think, would be a nice 'extra'.
Chironex:
Thanks for suggestions, i liked them so i did it ;)
You forgot noobs that can bind a key to "ulx report a" :)
The max length in the console is 255 anyway, but i've limited to 128, like the chat.
Here is a new version (first post)
Edit: another new version
Navigation
[0] Message Index
[#] Next page
Go to full version