Commit 98cab0b1 authored by nanahira's avatar nanahira

use latest ws

parent a2b4f873
Pipeline #17317 passed with stages
in 10 minutes and 20 seconds
...@@ -31,12 +31,13 @@ ...@@ -31,12 +31,13 @@
"typeorm": "^0.2.29", "typeorm": "^0.2.29",
"underscore": "^1.11.0", "underscore": "^1.11.0",
"underscore.string": "^3.3.6", "underscore.string": "^3.3.6",
"ws": "^1.1.1" "ws": "^8.9.0"
}, },
"devDependencies": { "devDependencies": {
"@types/bunyan": "^1.8.8", "@types/bunyan": "^1.8.8",
"@types/node": "^17.0.19", "@types/node": "^17.0.19",
"@types/underscore": "^1.11.4", "@types/underscore": "^1.11.4",
"@types/ws": "^8.5.3",
"coffeescript": "^2.6.1", "coffeescript": "^2.6.1",
"typescript": "^4.5.5" "typescript": "^4.5.5"
} }
...@@ -90,6 +91,15 @@ ...@@ -90,6 +91,15 @@
"integrity": "sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg==", "integrity": "sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg==",
"dev": true "dev": true
}, },
"node_modules/@types/ws": {
"version": "8.5.3",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz",
"integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/abbrev": { "node_modules/abbrev": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
...@@ -1744,14 +1754,6 @@ ...@@ -1744,14 +1754,6 @@
"wrappy": "1" "wrappy": "1"
} }
}, },
"node_modules/options": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz",
"integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/os-homedir": { "node_modules/os-homedir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
...@@ -2656,11 +2658,6 @@ ...@@ -2656,11 +2658,6 @@
"node": ">=4.2.0" "node": ">=4.2.0"
} }
}, },
"node_modules/ultron": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz",
"integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po="
},
"node_modules/underscore": { "node_modules/underscore": {
"version": "1.11.0", "version": "1.11.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.11.0.tgz", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.11.0.tgz",
...@@ -2837,12 +2834,23 @@ ...@@ -2837,12 +2834,23 @@
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "1.1.5", "version": "8.9.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz",
"integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", "integrity": "sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==",
"dependencies": { "engines": {
"options": ">=0.0.5", "node": ">=10.0.0"
"ultron": "1.0.x" },
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
} }
}, },
"node_modules/xml2js": { "node_modules/xml2js": {
...@@ -3116,6 +3124,15 @@ ...@@ -3116,6 +3124,15 @@
"integrity": "sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg==", "integrity": "sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg==",
"dev": true "dev": true
}, },
"@types/ws": {
"version": "8.5.3",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz",
"integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"abbrev": { "abbrev": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
...@@ -4411,11 +4428,6 @@ ...@@ -4411,11 +4428,6 @@
"wrappy": "1" "wrappy": "1"
} }
}, },
"options": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz",
"integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8="
},
"os-homedir": { "os-homedir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
...@@ -5093,11 +5105,6 @@ ...@@ -5093,11 +5105,6 @@
"integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==",
"dev": true "dev": true
}, },
"ultron": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz",
"integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po="
},
"underscore": { "underscore": {
"version": "1.11.0", "version": "1.11.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.11.0.tgz", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.11.0.tgz",
...@@ -5239,13 +5246,10 @@ ...@@ -5239,13 +5246,10 @@
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}, },
"ws": { "ws": {
"version": "1.1.5", "version": "8.9.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz",
"integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", "integrity": "sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==",
"requires": { "requires": {}
"options": ">=0.0.5",
"ultron": "1.0.x"
}
}, },
"xml2js": { "xml2js": {
"version": "0.4.23", "version": "0.4.23",
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
"typeorm": "^0.2.29", "typeorm": "^0.2.29",
"underscore": "^1.11.0", "underscore": "^1.11.0",
"underscore.string": "^3.3.6", "underscore.string": "^3.3.6",
"ws": "^1.1.1" "ws": "^8.9.0"
}, },
"license": "AGPL-3.0", "license": "AGPL-3.0",
"scripts": { "scripts": {
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
"@types/bunyan": "^1.8.8", "@types/bunyan": "^1.8.8",
"@types/node": "^17.0.19", "@types/node": "^17.0.19",
"@types/underscore": "^1.11.4", "@types/underscore": "^1.11.4",
"@types/ws": "^8.5.3",
"coffeescript": "^2.6.1", "coffeescript": "^2.6.1",
"typescript": "^4.5.5" "typescript": "^4.5.5"
} }
......
...@@ -16,8 +16,8 @@ init = (http_server, ROOM_all)-> ...@@ -16,8 +16,8 @@ init = (http_server, ROOM_all)->
server = new WebSocketServer server = new WebSocketServer
server: http_server server: http_server
server.on 'connection', (connection) -> server.on 'connection', (connection, upgradeReq) ->
connection.filter = url.parse(connection.upgradeReq.url, true).query.filter || 'waiting' connection.filter = url.parse(upgradeReq.url, true).query.filter || 'waiting'
connection.send JSON.stringify connection.send JSON.stringify
event: 'init' event: 'init'
data: room_data(room) for room in ROOM_all when room and room.established and (connection.filter == 'started' or !room.private) and ((room.duel_stage != 0) == (connection.filter == 'started')) data: room_data(room) for room in ROOM_all when room and room.established and (connection.filter == 'started' or !room.private) and ((room.duel_stage != 0) == (connection.filter == 'started'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment