mirror of
https://github.com/MaciejkaG/statki.git
synced 2024-11-30 07:22:55 +01:00
Compare commits
No commits in common. "282c713ead1cf5c77851212b5711c42d62a00fb7" and "b1a822f39e7dabe541dab9cc4a2b42d1cc6eebfe" have entirely different histories.
282c713ead
...
b1a822f39e
2
index.js
2
index.js
@ -632,8 +632,8 @@ function endGame(gameId) {
|
||||
for (let i = 0; i < members.length; i++) {
|
||||
const sid = members[i][0];
|
||||
const socket = io.sockets.sockets.get(sid);
|
||||
socket.leave(gameId);
|
||||
resetUserGame(socket.request);
|
||||
socket.leave(gameId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ export class MailAuth {
|
||||
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) => {
|
||||
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);
|
||||
else resolve();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user