-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d37e37
commit 2549b84
Showing
11 changed files
with
113 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Net.Http.Headers; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace BeatSaviorData | ||
{ | ||
class HTTPManager | ||
{ | ||
public static readonly HttpClient client = new HttpClient(); | ||
|
||
public static bool uploadJson(string json) | ||
public async static void uploadJson(string json) | ||
{ | ||
//client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); | ||
|
||
StringContent content = new StringContent(json, Encoding.UTF8, "application/json"); | ||
HttpResponseMessage success = await client.PostAsync(PrivateKeys.BeatSaviorUploadUrl, content); | ||
|
||
if (client.PostAsync(PrivateKeys.BeatSaviorUploadUrl, content).Result.IsSuccessStatusCode) | ||
return true; | ||
return false; | ||
if (success.IsSuccessStatusCode) | ||
Logger.log.Info("BSD : Upload succeeded !"); | ||
else | ||
Logger.log.Info("BSD : Upload failed."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using BeatSaberMarkupLanguage.Attributes; | ||
using BS_Utils.Utilities; | ||
|
||
namespace BeatSaviorData | ||
{ | ||
class SettingsMenu : PersistentSingleton<SettingsMenu> | ||
{ | ||
private static readonly Config config = new Config("BeatSaviorData"); | ||
|
||
[UIValue("DisablePass")] | ||
public bool DisablePass | ||
{ | ||
get => config.GetBool("BeatSaviorData", "DisablePass", false, true); | ||
set => config.SetBool("BeatSaviorData", "DisablePass", value); | ||
} | ||
|
||
[UIValue("DisableFail")] | ||
public bool DisableFails | ||
{ | ||
get => config.GetBool("BeatSaviorData", "DisableFails", false, true); | ||
set => config.SetBool("BeatSaviorData", "DisableFails", value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<settings-container> | ||
<horizontal pad="2" preferred-height="8"> | ||
<text text="Disabling passes upload will prevent you from participating in events." font-size="3.5"/> | ||
</horizontal> | ||
<checkbox text="Disable Pass Upload" value="DisablePass" /> | ||
<checkbox text="Disable Fail Upload" value="DisableFail" /> | ||
</settings-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/nike4613/ModSaber-MetadataFileSchema/master/Schema.json", | ||
"id": null, | ||
"id": "BeatSaviorData", | ||
"name": "BeatSaviorData", | ||
"author": "Mystogan", | ||
"version": "0.0.1", | ||
"description": "Streams data such as map completion to Beat Savior", | ||
"version": "1.0.0", | ||
"description": "Uploads data on map completion, such as per saber accuracy, to Beat Savior", | ||
"gameVersion": "1.7.0", | ||
"dependsOn": { | ||
"BS Utils": "^1.3.5", | ||
"BeatSaberMarkupLanguage": "^1.1.5" | ||
}, | ||
"loadAfter": [ "BS Utils" ], | ||
"loadAfter": [ "BS Utils", "BeatSaberMarkupLanguage" ], | ||
"features": [], | ||
"misc": { | ||
"plugin-hint": "BeatSaviorData.Plugin" | ||
} | ||
}, | ||
"links": { | ||
"project-home": "https://github.com/Mystogan98/BeatSaviorData" | ||
} | ||
} |