Loading events.js +5 −3 Original line number Diff line number Diff line Loading @@ -164,7 +164,7 @@ function createRouter(db) { if (isgetMapInfoValid(req)) { const mapId = req.body.mapId; const userId = req.body.userId; const sql = 'SELECT vote FROM Vote v2 WHERE mapId LIKE \"'+ mapId + '\" AND userId LIKE \"' + userId + '\";'; const sql = 'SELECT vote FROM Vote WHERE mapId LIKE \"'+ mapId + '\" AND userId LIKE \"' + userId + '\";'; console.log('Update Vote: ', sql); db.query( sql, Loading @@ -178,13 +178,15 @@ function createRouter(db) { if (results.length === 1) { vote = results[0].vote; } if (vote) { if (!isNaN(vote)) { req.body.vote = vote; getMapInfo(req, res); return; } } res.header('Access-Control-Allow-Origin', "*").status(500).json({status: 'unexpected result in getVote'}); } else { res.header('Access-Control-Allow-Origin', "*").status(500).json({status: 'too many results in getVote'}); } } }); } else { Loading socket.js +2 −4 Original line number Diff line number Diff line Loading @@ -242,10 +242,8 @@ const testClient = net.connect({host: 'localhost', port: 3000}, () => { console.log('connected to server!'); //testClient.write('Hello World Client!\r\n'); testClient.write(JSON.stringify({ "mapId": "keineBekannteMap1", "name": "keinBekannterMapName1", "userId": "keinBekannterUser1", "vote": 80 "mapId":"7fsfRSUCQ7YwfBEdRk_GivW6qzj","userId":"aKBNg9fbReqLedLiz1KFfA","name":"Summer 2021 - 01" //"vote": 80 })); //test(testClient); }); Loading Loading
events.js +5 −3 Original line number Diff line number Diff line Loading @@ -164,7 +164,7 @@ function createRouter(db) { if (isgetMapInfoValid(req)) { const mapId = req.body.mapId; const userId = req.body.userId; const sql = 'SELECT vote FROM Vote v2 WHERE mapId LIKE \"'+ mapId + '\" AND userId LIKE \"' + userId + '\";'; const sql = 'SELECT vote FROM Vote WHERE mapId LIKE \"'+ mapId + '\" AND userId LIKE \"' + userId + '\";'; console.log('Update Vote: ', sql); db.query( sql, Loading @@ -178,13 +178,15 @@ function createRouter(db) { if (results.length === 1) { vote = results[0].vote; } if (vote) { if (!isNaN(vote)) { req.body.vote = vote; getMapInfo(req, res); return; } } res.header('Access-Control-Allow-Origin', "*").status(500).json({status: 'unexpected result in getVote'}); } else { res.header('Access-Control-Allow-Origin', "*").status(500).json({status: 'too many results in getVote'}); } } }); } else { Loading
socket.js +2 −4 Original line number Diff line number Diff line Loading @@ -242,10 +242,8 @@ const testClient = net.connect({host: 'localhost', port: 3000}, () => { console.log('connected to server!'); //testClient.write('Hello World Client!\r\n'); testClient.write(JSON.stringify({ "mapId": "keineBekannteMap1", "name": "keinBekannterMapName1", "userId": "keinBekannterUser1", "vote": 80 "mapId":"7fsfRSUCQ7YwfBEdRk_GivW6qzj","userId":"aKBNg9fbReqLedLiz1KFfA","name":"Summer 2021 - 01" //"vote": 80 })); //test(testClient); }); Loading