Description
This plugin automatically uploads your TF2 match log to logs.tf using your own logs.tf API key.
Source and compiled plugin can be
found on github
When a round ends, it starts looking for a log that has been edited in the last 60 seconds.
It uses cURL to do a POST request to logs.tf and prints the response in chat for everyone to see.
A response would look (if everything works properly) like this:
Code:
[LogUploader] Log Id: 33062
[LogUploader] Log link: http://logs.tf/33062
So in this example, the log has been uploaded successfully and can be found at "http://logs.tf/33062".
CVAR/Command list
Code:
sm_logup_apikey - Set your logs.tf API key to use for uploading of logs
sm_logup_title - Set the title for your logs on logs.tf
Changelog
Code:
2013-05-05 (v1.4)
* Removed error messages upon failing, they're not really of much use to the end user anyway
* Fixed the way of locating the log, plugin now flushes the log, waits 5 seconds for everything to be written to disk fully and then uploads the log. This should fix issues with logs not including the last round or logs not being located at all
* Also use sv_logsdir for log location
* Use Nikkii's fixed JSON include, now the plugin simply prints the log ID and link, huge huge thanks to Nikkii for his work on this
2013-03-16 (v1.3)
* Reformatted code - thanks for your example Nikkii! (Still need to fix a few things, though)
2013-03-13 (v1.2)
* Fixed a handle not being closed
2013-03-13 (v1.1)
* Using threaded cURL to avoid massive lag on round end
2013-03-13 (v1.0)
* Initial release.
Installation instructions
First and foremost, make sure the cURL extension is installed!
Install the plugin to the plugin directory and load it on the server once.
This will create the config file in tf/cfg/sourcemod called "LogUploader.cfg".
Enter your logs.tf API-Key in that config file and reload the plugin on the server.
Now you're all set and good to go.
NOTE! If upgrading from 1.2 to 1.3, you have to add the "sm_logup_title" cvar to the LogUploader.cfg file manually.
Dependencies
cURL extension
Nikkii's fixed JSON include <-- Only needed if you compile the plugin yourself
Known bugs/problems
Quote:
1. My first SourceMod plugin, code could probably be a bit neater
2. Haven't really had the chance to do any extensive testing on this, so there could be any number of weird things happen! By all means let me know and I can maybe try to fix it..
3. It doesn't compile on the website because it requires the cURL and JSON includes.
|
Download compiled plugin here:
https://github.com/remydb/LogUploade...log_upload.smx