Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Commit

Permalink
1.4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Squirrelies committed Apr 5, 2020
1 parent 531cdd1 commit d8156d5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ To extract .7z archives, use [7-Zip](https://www.7-zip.org/)!

## [Click here](http://dudley.gg/squirrelies/re2/latest.7z) to download the latest release!

## [Download 1.4.1.0 Beta](http://dudley.gg/squirrelies/re2/RE2REmakeSRT-1410-Beta-Signed-Release.7z) (2020-01-02)
## [Download 1.4.2.0 Beta](http://dudley.gg/squirrelies/re2/RE2REmakeSRT-1420-Beta-Signed-Release.7z) (2020-04-05)
* Fix for JSON endpoint not listening on all interfaces. Listens on all IPv4 and IPv6 interfaces now.
* Moved some variables around in the Sample JSON HTML file. User configurable settings are near the top now.

### [Download 1.4.1.0 Beta](http://dudley.gg/squirrelies/re2/RE2REmakeSRT-1410-Beta-Signed-Release.7z) (2020-01-02)
* Added Microsoft.AspNetCore.Cors so I could allow cross-origin requests from any origin (such as the file server). Useful for local querying of the JSON data.
* Added a sample HTML page with javascript query code to display the JSON values similar to how the SRT lays it out. Useful for OBS Browser Source displaying.

Expand Down
2 changes: 1 addition & 1 deletion RE2REmakeSRT/JSONServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public JSONServer()

hostBuilder = new WebHostBuilder()
.UseKestrel()
.UseUrls("http://localhost:7190")
.UseUrls("http://::7190;http://0.0.0.0:7190")
.UseContentRoot(contentRoot)
.UseStartup<JSONServerStartup>()
.UseEnvironment("Development")
Expand Down
4 changes: 2 additions & 2 deletions RE2REmakeSRT/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyFileVersion("1.4.1.0")]
[assembly: AssemblyVersion("1.4.2.0")]
[assembly: AssemblyFileVersion("1.4.2.0")]
44 changes: 32 additions & 12 deletions RE2REmakeSRT/SampleJSONDisplayPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>RE2 REmake SRT JSON Display Page</title>
<title>RE3 REmake SRT JSON Display Page</title>
<script>
// USER CONFIGURABLE VARIABLES.
const JSON_ADDRESS = '127.0.0.1'; // IP OR HOSTNAME OF THE COMPUTER RUNNING THE SRT. USEFUL FOR MULTIPLE PC STREAMING SETUPS.
const JSON_PORT = 7190; // PORT OF THE JSON ENDPOINT. NOT LIKELY TO CHANGE UNLESS YOU COMPILED THE SRT YOURSELF FROM SOURCE CODE.
const POLLING_RATE = 333; // THE TIME IN MILLISECONDS WE'LL REQUEST UPDATED VALUES.
</script>
<style>
body {
background-color: #000000;
color: #FFFFFF;
font-family: Arial;
}

a {
Expand All @@ -30,14 +37,20 @@
a:active {
text-decoration: underline;
}

td {
text-align: right;
}
</style>
</head>
<body>
<div id="srtQueryData"></div>
<script>
const JSON_ENDPOINT = `http://${JSON_ADDRESS}:${JSON_PORT}/`;

window.onload = function () {
getData();
setInterval(getData, 333);
setInterval(getData, POLLING_RATE);
}

var Asc = function (a, b) {
Expand All @@ -53,7 +66,7 @@
}

function getData() {
fetch('http://localhost:7190/')
fetch(JSON_ENDPOINT)
.then(function (response) {
return response.json();
})
Expand All @@ -69,14 +82,16 @@
var mainContainer = document.getElementById("srtQueryData");
mainContainer.innerHTML = "";

if (data.PlayerCurrentHealth <= 1200 && data.PlayerCurrentHealth >= 801)
mainContainer.innerHTML += '<font size="6" color="#7cfc00"><b>' + data.PlayerCurrentHealth + '</b></font><br>';
if (data.PlayerPoisoned)
mainContainer.innerHTML += '<font size="6" color="#7851a9"><b>' + data.PlayerCurrentHealth + '</b></font><br>'; // Toxic
else if (data.PlayerCurrentHealth <= 1200 && data.PlayerCurrentHealth >= 801)
mainContainer.innerHTML += '<font size="6" color="#7cfc00"><b>' + data.PlayerCurrentHealth + '</b></font><br>'; // aFineBoi
else if (data.PlayerCurrentHealth <= 800 && data.PlayerCurrentHealth >= 361)
mainContainer.innerHTML += '<font size="6" color="#daa520"><b>' + data.PlayerCurrentHealth + '</b></font><br>';
mainContainer.innerHTML += '<font size="6" color="#daa520"><b>' + data.PlayerCurrentHealth + '</b></font><br>'; // Caution!
else if (data.PlayerCurrentHealth <= 360 && data.PlayerCurrentHealth >= 1)
mainContainer.innerHTML += '<font size="6" color="#ff0000"><b>' + data.PlayerCurrentHealth + '</b></font><br>';
mainContainer.innerHTML += '<font size="6" color="#ff0000"><b>' + data.PlayerCurrentHealth + '</b></font><br>'; // Dangerops!
else
mainContainer.innerHTML += '<font size="6" color="#ff0000"><b>' + data.PlayerCurrentHealth + '</b></font><br>';
mainContainer.innerHTML += '<font size="6" color="#ff0000"><b>' + data.PlayerCurrentHealth + '</b></font><br>'; // Deaded.

mainContainer.innerHTML += '<font size="6"><b>' + data.IGTFormattedString + '</b></font><br>';
//mainContainer.innerHTML += '<font size="4" color="#969696"><b>A:' + data.IGTRunningTimer + '</b></font><br>';
Expand All @@ -86,16 +101,21 @@
//mainContainer.innerHTML += '<br>';

mainContainer.innerHTML += '<font size="4" color="#969696"><b>DA&nbsp;Rank:&nbsp;' + data.Rank + '</b></font><br>';
mainContainer.innerHTML += '<font size="4" color="#969696"><b>DA&nbsp;Rank:&nbsp;' + data.RankScore + '</b></font><br>';
mainContainer.innerHTML += '<font size="4" color="#969696"><b>DA&nbsp;Score:&nbsp;' + data.RankScore + '</b></font><br>';

mainContainer.innerHTML += '<font size="4" color="#ff0000"><b>Enemy&nbsp;HP</b></font><br>';
var table = document.createElement("table");
data.EnemyHealth.sort(function (a, b) { return Asc(a.Percentage, b.Percentage) || Desc(a.CurrentHP, b.CurrentHP) }).forEach(function (item, index, arr) {
if (item.IsAlive) {
var div = document.createElement("div");
div.innerHTML = '<font size="3" color="#ff0000">' + item.CurrentHP + '&nbsp;&nbsp;&nbsp;' + parseFloat(item.Percentage * 100).toFixed(1) + '%</font><br>';
mainContainer.appendChild(div);
table.innerHTML += `<tr>
<td><font size="4" color="#ff0000"><b>${item.CurrentHP}</b></font></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><font size="4" color="#ff0000"><b>${parseFloat(item.Percentage * 100).toFixed(1)}%</b></font></td>
</tr>`;
}
});
mainContainer.appendChild(table);

//mainContainer.innerHTML += '<BR>Last Updated: ' + new Date().toLocaleDateString() + ' ' + new Date().toLocaleTimeString();
}
Expand Down

0 comments on commit d8156d5

Please sign in to comment.