LogUpload
Description
Automatically uploads logs to logs.tf via cURL (Socket is planned and written, except it doesn't currently work). This is like
LogUploader, however with a developer API, response parsing and way more options.
It works by hooking the game end events and flushing the log with 'log on' which resets logging. It then scans for files edited in the last 5 seconds and finds the one with the lowest 'sub id', which is what it uploads. After uploading, it will show the log url based on the sm_logupload_display cvar.
Cvars
Code:
sm_logupload_version - Shows version
sm_logupload_enabled - Enables/Disables LogUpload (Default: Enabled)
sm_logupload_updater - Enables/Disables Auto Updating (Default: Enabled)
sm_logupload_key - Your logs.tf API key
sm_logupload_title - Title to use on logs.tf (Use {BLUENAME}, {REDNAME} and {MAP} to customize)
sm_logupload_delay - Delay in seconds that a log may not be uploaded for, recommended at least 60 to prevent log upload spamming, though it should never happen.
sm_logupload_mode - Determines when LogUpload should upload logs
Combine these values for more than 1 (default, more to come! I need ideas!):
1: mp_tournament == 1
2: No bots (Excludes STV/Replay)
sm_logupload_display - Determines how LogUpload displays uploaded log urls
Combine these values for more than 1:
1: Show log URL in chat
2: Show log URL in hint box
4: Show log URL in center message
Dependencies
Requires the
cURL extension and
colors, along with the modified json include.
Generating a key- Log in to http://logs.tf through steam
- Click 'Upload Logs' in the top right (http://logs.tf/uploader)
- Click on "File upload API Key Generation"
- If you have a key, copy it. If not, click "Generate new API key"
- Follow the instructions below to use it.
Installation instructions- Install the cURL extension or verify it is installed via "sm exts list"
- Download the zip file (End of the thread)
- Extract it into <server directory>/orangebox/tf/addons/sourcemod
- Run 'sm plugins load logupload'
- Edit <server directory>/orangebox/tf/cfg/sourcemod/plugin.logupload.cfg and add in your logs.tf api key (See 'Generating a key')
- Run 'sm plugins reload logupload' to reload settings
- Play a round and try it out! Settings can be customized in <server directory>/orangebox/tf/cfg/sourcemod/plugin.logupload.cfg
Developer information
View
https://github.com/nikkiii/logupload.../logupload.inc for functions which may be accessed by other plugins and forwards.
Changelog
Quote:
4/14/2013 (v0.1.1)
Initial release.
6/4/2013 (v0.1.3)
Display is now a flag consisting of options added together, sv_logsdir for directory, time limits to prevent mass uploading, force upload native, updater support
6/28/2013 (v0.1.4)
Small fix to library registration, setting the convar bound for display mode in case it is a direct upgrade/reload from 0.1.1
7/4/2013 (v0.1.5)
Include SMJansson support, change updater to pull from github, auto compiler.
|
Plans- Fix the 'Socket' upload method!
- Add more replacements for title
- Improve Plugin API
Current Problems- Socket extension uploading broken due to either code problem or extension problem. If anybody wishes to attempt to fix I suggest redirecting the request to a remote server with "nc -l -p 5000 > req.txt" and looking at what it does, it simply skips blocks.
Download
The project is currently hosted on Github.
Regular users may wish to download the entire zip file from here:
https://github.com/nikkiii/logupload/archive/master.zip
Developers may wish to view the source of this
here
Addons/Modules
LogUpload In-Game Viewer
__________________