Compare commits

..

No commits in common. "282c713ead1cf5c77851212b5711c42d62a00fb7" and "b1a822f39e7dabe541dab9cc4a2b42d1cc6eebfe" have entirely different histories.

2 changed files with 2 additions and 2 deletions

View File

@ -632,8 +632,8 @@ function endGame(gameId) {
for (let i = 0; i < members.length; i++) { for (let i = 0; i < members.length; i++) {
const sid = members[i][0]; const sid = members[i][0];
const socket = io.sockets.sockets.get(sid); const socket = io.sockets.sockets.get(sid);
socket.leave(gameId);
resetUserGame(socket.request); resetUserGame(socket.request);
socket.leave(gameId);
} }
} }

View File

@ -202,7 +202,7 @@ export class MailAuth {
const conn = mysql.createConnection(this.mysqlOptions); const conn = mysql.createConnection(this.mysqlOptions);
conn.query(`INSERT INTO matches(match_id, match_type, host_id, guest_id, duration) VALUES (${conn.escape(matchId)}, ${conn.escape(type)}, ${conn.escape(hostId)}, ${conn.escape(guestId)}, ${conn.escape(duration)})`, async (error) => { conn.query(`INSERT INTO matches(match_id, match_type, host_id, guest_id, duration) VALUES (${conn.escape(matchId)}, ${conn.escape(type)}, ${conn.escape(hostId)}, ${conn.escape(guestId)}, ${conn.escape(duration)})`, async (error) => {
if (error) reject(error); if (error) reject(error);
else conn.query(`INSERT INTO statistics(match_id, user_id, board, won) VALUES (${conn.escape(matchId)}, ${conn.escape(hostId)}, ${conn.escape(JSON.stringify(boards[0]))}, ${conn.escape(!winnerIdx ? 1 : 0)}), (${conn.escape(matchId)}, ${conn.escape(guestId)}, ${conn.escape(JSON.stringify(boards[1]))}, ${conn.escape(winnerIdx ? 1 : 0)})`, async (error, response) => { else conn.query(`INSERT INTO statistics(match_id, user_id, board, won) VALUES (${conn.escape(matchId)}, ${conn.escape(hostId)}, ${conn.escape(JSON.stringify(boards[0]))}, ${conn.escape(winnerIdx == 0 ? 1 : 0)}), (${conn.escape(matchId)}, ${conn.escape(guestId)}, ${conn.escape(JSON.stringify(boards[1]))}, ${conn.escape(winnerIdx == 1 ? 1 : 0)})`, async (error, response) => {
if (error) reject(error); if (error) reject(error);
else resolve(); else resolve();