Start implementation of DivaBotGuardian

pull/5/head
sigonasr2 4 years ago
parent da8576d287
commit ea5add10f9
  1. 1
      divabotguardian/.gitignore
  2. 1
      divabotguardian/DivaBotGuardian
  3. 1
      divabotguardian/processes/3.divabotguardian
  4. 1
      divabotguardian/processes/3.ffmpeg
  5. 5
      divabotguardian/stream_monitor.sh
  6. BIN
      divabotguardian/streams/tempoutput0_3.png
  7. BIN
      divabotguardian/streams/tempoutput1_3.png
  8. BIN
      divabotguardian/streams/tempoutput2_3.png
  9. BIN
      divabotguardian/streams/tempoutput3.png
  10. BIN
      divabotguardian/streams/tempoutput3_3.png
  11. BIN
      divabotguardian/streams/tempoutput4_3.png
  12. BIN
      divabotguardian/streams/tempoutput5_3.png
  13. BIN
      divabotguardian/streams/tempoutput6_3.png
  14. BIN
      divabotguardian/streams/tempoutput7_3.png
  15. BIN
      divabotguardian/streams/tempoutput8_3.png
  16. BIN
      divabotguardian/streams/tempoutput9_3.png
  17. 14
      frontend/src/App.js
  18. 9
      frontend/src/setupProxy.js
  19. 2
      imgparser/projectDivaImgParser
  20. 49
      server/app.js
  21. BIN
      server/files/releases/DivaBot05C2.zip

@ -0,0 +1 @@
.guardian_env

@ -0,0 +1 @@
Subproject commit e9b45b34b72f559faf87ea51d9746da802fd0aff

@ -0,0 +1,5 @@
cd /home/sigonasr2/divar/divabotguardian
ffmpeg -y -ss 00:00:16 -i `curl http://projectdivar.com/streamdata/$1` -vf fps=10,setpts=N/FRAME_RATE/TB -updatefirst 1 streams/output$1.png &
echo $! > processes/$1.ffmpeg
java -jar DivaBotGuardian/DivaBotGuardian/DivaBotGuardian.jar $1 &
echo $! > processes/$1.divabotguardian

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

@ -1386,13 +1386,13 @@ function Submit(p) {
Detailed Detailed
</Route> </Route>
<Route path="/submitplay/switch"> <Route path="/submitplay/switch">
<h2>Nintendo Switch/Twitter Upload</h2> <h2>Playstation/Nintendo Switch/Twitter Upload</h2>
Want to upload your scores to the website conveniently? Go to <Link to="/usersettings">Edit Profile Settings</Link> and enter your Twitter username, then follow the steps below! Want to upload your scores to the website conveniently? Go to <Link to="/usersettings">Edit Profile Settings</Link> and enter your Twitter username, then follow the steps below!
<hr/> <hr/>
<div className="row mb-4"> <div className="row mb-4">
<div className="col-4 m-6"> <div className="col-4 m-6">
<h4>Step 1</h4> <h4>Step 1</h4>
From your Nintendo Switch Album, select up to 4 results screenshots that you want the DivaRBot to parse. From your Nintendo Switch Album or Playstation Gallery, select up to 4 results screenshots that you want the DivaRBot to parse.
</div> </div>
<div className="col-8 m-6"> <div className="col-8 m-6">
<img width="100%" className="border rounded shadow" src="http://projectdivar.com/files/switch1.png"/> <img width="100%" className="border rounded shadow" src="http://projectdivar.com/files/switch1.png"/>
@ -1427,8 +1427,8 @@ function Submit(p) {
<Link to="/submitplay/image" className="nostyle"> <Link to="/submitplay/image" className="nostyle">
<div className="card-body"> <div className="card-body">
<h5 className="card-title">Image Upload</h5> <h5 className="card-title">Image Upload</h5>
<p className="card-text">Upload images from your Nintendo Switch for automatic processing/scoring!</p> <p className="card-text">Upload images from your Playstation/Nintendo Switch for automatic processing/scoring!</p>
<p className="card-text"><small className="text-muted">Put up to 50 images in a zip file to mass-upload your screenshotted plays to your profile. You will need to extract them from your microSD card from your Nintendo Switch.</small></p> <p className="card-text"><small className="text-muted">Put up to 50 images in a zip file to mass-upload your screenshotted plays to your profile. You will need to extract them from your microSD card from your Nintendo Switch or using a USB for your Playstation.</small></p>
</div> </div>
</Link> </Link>
</div> </div>
@ -1436,8 +1436,8 @@ function Submit(p) {
<div className="card"> <div className="card">
<Link to="/submitplay/switch" className="nostyle"> <Link to="/submitplay/switch" className="nostyle">
<div className="card-body"> <div className="card-body">
<h5 className="card-title">Nintendo Switch/Twitter Upload</h5> <h5 className="card-title">Playstation/Nintendo Switch/Twitter Upload</h5>
<p className="card-text">Setup your account for uploading through Twitter using your Nintendo Switch!</p> <p className="card-text">Setup your account for uploading through Twitter using your Playstation or Nintendo Switch!</p>
<p className="card-text"><small className="text-muted">You can select up to 4 images to post to Twitter at one time.</small></p> <p className="card-text"><small className="text-muted">You can select up to 4 images to post to Twitter at one time.</small></p>
</div> </div>
</Link> </Link>
@ -1800,7 +1800,7 @@ function ReleaseList(p) {
function DivaBot() { function DivaBot() {
const releases=[ const releases=[
["05C","http://projectdivar.com/files/releases/DivaBot05C1.zip","23 Sep 2020",<> <Badge variant="info" pill>Recommended</Badge> <i>Fixed bug with Finder not being submitted, and fix 1000+ note counts for FT submissions.</i></>], ["05C","http://projectdivar.com/files/releases/DivaBot05C2.zip","24 Sep 2020",<> <Badge variant="info" pill>Recommended</Badge> <i>Fixed bug with Finder not being submitted, and fix 1000+ note counts for FT submissions. Improve difficulty detection.</i></>],
["05B","http://projectdivar.com/files/releases/DivaBot05B.zip","22 Sep 2020",<> <IMAGE_BUG/> <i>Improved song select recognition speed.</i></>], ["05B","http://projectdivar.com/files/releases/DivaBot05B.zip","22 Sep 2020",<> <IMAGE_BUG/> <i>Improved song select recognition speed.</i></>],
["05A","http://projectdivar.com/files/releases/DivaBot05A.zip","21 Sep 2020",<> <i>Added multi-monitor support. Use calibration to switch monitors.</i></>], ["05A","http://projectdivar.com/files/releases/DivaBot05A.zip","21 Sep 2020",<> <i>Added multi-monitor support. Use calibration to switch monitors.</i></>],
["05","http://projectdivar.com/files/releases/DivaBot05.zip","21 Sep 2020",<> <i>Added Miku FC. Huge optimizations to result screen capture, improve menu detection algorithms.</i></>], ["05","http://projectdivar.com/files/releases/DivaBot05.zip","21 Sep 2020",<> <i>Added Miku FC. Huge optimizations to result screen capture, improve menu detection algorithms.</i></>],

@ -2,7 +2,14 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function(app) { module.exports = function(app) {
app.use( app.use(
"/streamdata", "/getUserAuthData",
createProxyMiddleware({
target: 'http://server:4501',
changeOrigin: true,
})
);
app.use(
"/streamdata/:id",
createProxyMiddleware({ createProxyMiddleware({
target: 'http://server:4501', target: 'http://server:4501',
changeOrigin: true, changeOrigin: true,

@ -1 +1 @@
Subproject commit 3c10a63ac967128e56c333106fbc4e5edea21dcf Subproject commit 457bbb6fa840d8a36b2f6b935bb2fc4066891a5f

@ -988,11 +988,50 @@ app.post('/updateuser', function(req, res) {
} }
}) })
app.post('/getUserAuthData', function(req, res) {
if (req.body&&req.body.password&&req.body.userId) {
if (req.body.password===process.env.GUARDIANPASSWORD) {
db.query("select username,authentication_token from users where id=$1",[req.body.userId])
.then((data)=>{
if (data.rows.length>0) {
res.status(400).json(data.rows[0])
} else {
res.status(400).send("No user found!")
}
}
)
.catch((err)=>{
res.status(500).send(err.message)
})
} else {
res.status(400).send("Authentication failed!")
}
} else {
res.status(400).send("Invalid credentials!");
}
})
app.get('/streamdata',function (req,res){ app.get('/streamdata/:id',function (req,res){
db.query("select * from streams where id=1") db.query("select twitch_name from users where id=$1",[req.params.id])
.then((data)=>{ .then((data)=>{
res.status(200).send(data.rows[0].stream) return twitchStreams.get(data.rows[0].twitch_name)
})
.then(function(streams) {
if (streams.length>0) {
var streamchoice = undefined
for (var i=0;i<streams.length;i++) {
if (streams[i].quality.includes("720p")) {
streamchoice = streams[i]
break;
}
}
if (streamchoice===undefined) {
streamchoice = streams[0];
}
res.status(200).send(streamchoice.url)
} else {
res.status(400).send("Not online!")
}
}) })
.catch((err)=>{ .catch((err)=>{
res.status(500).send(err.message) res.status(500).send(err.message)
@ -1050,7 +1089,7 @@ axios.get('https://api.twitter.com/1.1/search/tweets.json?q=@divarbot', {
return Process(data); return Process(data);
}) })
.then((data)=>{process_images.forEach((image)=>{console.log(image)})})*/ .then((data)=>{process_images.forEach((image)=>{console.log(image)})})*/
setInterval( /*setInterval(
()=>{ ()=>{
twitchStreams.get('smallant') twitchStreams.get('smallant')
.then(function(streams) { .then(function(streams) {
@ -1062,7 +1101,7 @@ setInterval(
.catch((err)=>{ .catch((err)=>{
console.log(err.message) console.log(err.message)
}) })
},5000) },5000)*/
setInterval( setInterval(
()=>{ ()=>{

Loading…
Cancel
Save