Skip to content

Commit

Permalink
allow configuring dps.report generator to support EliteInsights
Browse files Browse the repository at this point in the history
Add a new configuration option, dps_report_generator, which is used to
configure the dps.report websites' generator. This enables users to
configure the script to upload and have the log parsed by EliteInsights
instead of the default RaidHeros.

Signed-off-by: Jacob Keller <[email protected]>
  • Loading branch information
jacob-keller committed Jun 24, 2018
1 parent 7cd6314 commit 2a1aac7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ Currently, because it is rather hard to dig up the dps.report links, as compared
to gw2raidar, the script defaults to only uploading successful logs to
dps.report.

dps.report supports multiple generators. By default RaidHeros is used, but the site
also supports using EliteInsights. You can configure this by setting a configuration
value

```
dps_report_generator: "ei",
```

### configure-gw2raidar-token.ps1

This script is provided to ease the generation of the GW2 Raidar API token. It
Expand Down
1 change: 1 addition & 0 deletions l0g-101086-config.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"restsharp_path": "%UserProfile%\\Documents\\Guild Wars 2\\addons\\arcdps\\RestSharp.dll",
"gw2raidar_token": "",
"dps_report_token": "",
"dps_report_generator": "ei",
"guilds": [
{
"name": "[guild]",
Expand Down
9 changes: 8 additions & 1 deletion l0g-101086.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,16 @@ $commonConfigurationFields =
name="dps_report_token"
type=[string]
}
@{
# dps.report allows using alternative generators besides raid heros. This parameter
# is used to configure the generator used by the site, and must match a valid value
# from their API. Currently "rh" means RaidHeros, "ei" means EliteInsights, and
# leaving it blank will use the current default generator.
name="dps_report_generator"
type=[string]
}
)


<#
.Description
Configuration fields which are valid for a v1 configuration file. Anything
Expand Down
11 changes: 11 additions & 0 deletions upload-logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ $extra_upload_data = $config.extra_upload_data
$gw2raidar_start_map = $config.gw2raidar_start_map
$simple_arc_parse = $config.simple_arc_parse_path

# Determine what generator to use
$valid_generators = @( "rh", "ei" )
$dps_report_generator = $config.dps_report_generator.Trim()
if ($dps_report_generator -and -not $valid_generators.Contains($dps_report_generator)) {
Read-Host -Prompt "The dps.report generator $dps_report_generator is unknown..."
exit
}

# Make sure RestSharp.dll exists
if (-not (X-Test-Path $config.restsharp_path)) {
Read-Host -Prompt "This script requires RestSharp to be installed. Press enter to exit"
Expand Down Expand Up @@ -313,6 +321,9 @@ ForEach($f in $files) {
# Include the dps.report user token
$req.AddParameter("userToken", $dpsreport_token)

# Set the generator if it was configured
$req.AddParameter("generator", $dps_report_generator)

$req.AddFile("file", $f) | Out-Null

$resp = $client.Execute($req)
Expand Down

0 comments on commit 2a1aac7

Please sign in to comment.