diff --git a/divabotguardian/.gitignore b/divabotguardian/.gitignore new file mode 100644 index 0000000..ff75df0 --- /dev/null +++ b/divabotguardian/.gitignore @@ -0,0 +1 @@ +.guardian_env \ No newline at end of file diff --git a/divabotguardian/DivaBotGuardian b/divabotguardian/DivaBotGuardian new file mode 160000 index 0000000..e9b45b3 --- /dev/null +++ b/divabotguardian/DivaBotGuardian @@ -0,0 +1 @@ +Subproject commit e9b45b34b72f559faf87ea51d9746da802fd0aff diff --git a/divabotguardian/processes/3.divabotguardian b/divabotguardian/processes/3.divabotguardian new file mode 100644 index 0000000..9d756fe --- /dev/null +++ b/divabotguardian/processes/3.divabotguardian @@ -0,0 +1 @@ +11401 diff --git a/divabotguardian/processes/3.ffmpeg b/divabotguardian/processes/3.ffmpeg new file mode 100644 index 0000000..9d6893f --- /dev/null +++ b/divabotguardian/processes/3.ffmpeg @@ -0,0 +1 @@ +11399 diff --git a/divabotguardian/stream_monitor.sh b/divabotguardian/stream_monitor.sh new file mode 100755 index 0000000..438dac2 --- /dev/null +++ b/divabotguardian/stream_monitor.sh @@ -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 \ No newline at end of file diff --git a/divabotguardian/streams/tempoutput0_3.png b/divabotguardian/streams/tempoutput0_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput0_3.png differ diff --git a/divabotguardian/streams/tempoutput1_3.png b/divabotguardian/streams/tempoutput1_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput1_3.png differ diff --git a/divabotguardian/streams/tempoutput2_3.png b/divabotguardian/streams/tempoutput2_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput2_3.png differ diff --git a/divabotguardian/streams/tempoutput3.png b/divabotguardian/streams/tempoutput3.png new file mode 100644 index 0000000..7c38005 Binary files /dev/null and b/divabotguardian/streams/tempoutput3.png differ diff --git a/divabotguardian/streams/tempoutput3_3.png b/divabotguardian/streams/tempoutput3_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput3_3.png differ diff --git a/divabotguardian/streams/tempoutput4_3.png b/divabotguardian/streams/tempoutput4_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput4_3.png differ diff --git a/divabotguardian/streams/tempoutput5_3.png b/divabotguardian/streams/tempoutput5_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput5_3.png differ diff --git a/divabotguardian/streams/tempoutput6_3.png b/divabotguardian/streams/tempoutput6_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput6_3.png differ diff --git a/divabotguardian/streams/tempoutput7_3.png b/divabotguardian/streams/tempoutput7_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput7_3.png differ diff --git a/divabotguardian/streams/tempoutput8_3.png b/divabotguardian/streams/tempoutput8_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput8_3.png differ diff --git a/divabotguardian/streams/tempoutput9_3.png b/divabotguardian/streams/tempoutput9_3.png new file mode 100644 index 0000000..ae959eb Binary files /dev/null and b/divabotguardian/streams/tempoutput9_3.png differ diff --git a/frontend/src/App.js b/frontend/src/App.js index c4e232e..e663a77 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1386,13 +1386,13 @@ function Submit(p) { Detailed -

Nintendo Switch/Twitter Upload

+

Playstation/Nintendo Switch/Twitter Upload

Want to upload your scores to the website conveniently? Go to Edit Profile Settings and enter your Twitter username, then follow the steps below!

Step 1

- 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.
@@ -1427,8 +1427,8 @@ function Submit(p) {
Image Upload
-

Upload images from your Nintendo Switch for automatic processing/scoring!

-

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.

+

Upload images from your Playstation/Nintendo Switch for automatic processing/scoring!

+

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.

@@ -1436,8 +1436,8 @@ function Submit(p) {
-
Nintendo Switch/Twitter Upload
-

Setup your account for uploading through Twitter using your Nintendo Switch!

+
Playstation/Nintendo Switch/Twitter Upload
+

Setup your account for uploading through Twitter using your Playstation or Nintendo Switch!

You can select up to 4 images to post to Twitter at one time.

@@ -1800,7 +1800,7 @@ function ReleaseList(p) { function DivaBot() { const releases=[ - ["05C","http://projectdivar.com/files/releases/DivaBot05C1.zip","23 Sep 2020",<> Recommended Fixed bug with Finder not being submitted, and fix 1000+ note counts for FT submissions.], + ["05C","http://projectdivar.com/files/releases/DivaBot05C2.zip","24 Sep 2020",<> Recommended Fixed bug with Finder not being submitted, and fix 1000+ note counts for FT submissions. Improve difficulty detection.], ["05B","http://projectdivar.com/files/releases/DivaBot05B.zip","22 Sep 2020",<> Improved song select recognition speed.], ["05A","http://projectdivar.com/files/releases/DivaBot05A.zip","21 Sep 2020",<> Added multi-monitor support. Use calibration to switch monitors.], ["05","http://projectdivar.com/files/releases/DivaBot05.zip","21 Sep 2020",<> Added Miku FC. Huge optimizations to result screen capture, improve menu detection algorithms.], diff --git a/frontend/src/setupProxy.js b/frontend/src/setupProxy.js index 7594f36..6c55da2 100644 --- a/frontend/src/setupProxy.js +++ b/frontend/src/setupProxy.js @@ -2,7 +2,14 @@ const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { app.use( - "/streamdata", + "/getUserAuthData", + createProxyMiddleware({ + target: 'http://server:4501', + changeOrigin: true, + }) + ); + app.use( + "/streamdata/:id", createProxyMiddleware({ target: 'http://server:4501', changeOrigin: true, diff --git a/imgparser/projectDivaImgParser b/imgparser/projectDivaImgParser index 3c10a63..457bbb6 160000 --- a/imgparser/projectDivaImgParser +++ b/imgparser/projectDivaImgParser @@ -1 +1 @@ -Subproject commit 3c10a63ac967128e56c333106fbc4e5edea21dcf +Subproject commit 457bbb6fa840d8a36b2f6b935bb2fc4066891a5f diff --git a/server/app.js b/server/app.js index 3dd960d..1035284 100644 --- a/server/app.js +++ b/server/app.js @@ -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){ - db.query("select * from streams where id=1") +app.get('/streamdata/:id',function (req,res){ + db.query("select twitch_name from users where id=$1",[req.params.id]) .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{ 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); }) .then((data)=>{process_images.forEach((image)=>{console.log(image)})})*/ -setInterval( +/*setInterval( ()=>{ twitchStreams.get('smallant') .then(function(streams) { @@ -1062,7 +1101,7 @@ setInterval( .catch((err)=>{ console.log(err.message) }) -},5000) +},5000)*/ setInterval( ()=>{ diff --git a/server/files/releases/DivaBot05C2.zip b/server/files/releases/DivaBot05C2.zip new file mode 100644 index 0000000..e3df2eb Binary files /dev/null and b/server/files/releases/DivaBot05C2.zip differ