Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arsoniv committed Feb 5, 2025
1 parent fa3b04c commit 21af399
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
2 changes: 1 addition & 1 deletion public/game/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ const handleMessage = async (message) => {

const connectToWebsocket = (id) => {
if (token && queueId) {
socket = new WebSocket(`ws://34.27.94.66:4000?queueId=${id}&token=${token}`);
socket = new WebSocket(`ws://34.27.94.66:8080?queueId=${id}&token=${token}`);

socket.onopen = () => {
chInfo('Connected');
Expand Down
23 changes: 1 addition & 22 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ app.listen(PORT, () => {
console.log(`Api is now running on port: ${PORT}`);
});

const wss = new WebSocketServer({ port: 4000 });
const wss = new WebSocketServer({ port: 8080 });

wss.on("connection", async (ws: WebSocket, req: IncomingMessage) => {
const queryString = req.url?.split("?")[1];
Expand Down Expand Up @@ -835,27 +835,6 @@ wss.on("connection", async (ws: WebSocket, req: IncomingMessage) => {
client.release();
});

const wss2 = new WebSocketServer({port: 5000 })

let subList: WebSocket[] = [];

wss2.on("connection", async (ws2: WebSocket, req: IncomingMessage) => {
subList.push(ws2)
})

setInterval(() => {
subList.forEach((ws, index) => {
if (ws.readyState === WebSocket.CLOSED) {
subList.splice(index, 1);
} else {
ws.send(JSON.stringify({
type: 15,

}))
}
})
}, 1500)

addQueue(1, 'Easy Ranked', true, 13, 10, 10, 12, false);
addQueue(2, 'Medium Ranked', true, 25, 15, 15, 16, false);
addQueue(3, 'Hard Ranked', true, 55, 20, 20, 20, false);
Expand Down

0 comments on commit 21af399

Please sign in to comment.