File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 11import { Server , Socket } from "socket.io" ;
2- import errorWrapper from "../middlewares/errorWrapper" ;
3- import { Request , Response } from "express" ;
42import { PrismaClient } from "@prisma/client" ;
53
64//
@@ -24,11 +22,31 @@ const track = (io: Server) => {
2422} ;
2523
2624const handleSts = ( socket : Socket ) => {
27- // to be implemented
25+ const id = socket . handshake . query . id ;
26+
27+ socket . on ( "join_rooms" , async ( data ) => {
28+ if ( id == undefined ) {
29+ return ;
30+ }
31+ console . log ( "sts" , id , "has joined" ) ;
32+
33+ socket . join ( id ) ;
34+ console . log ( "joined sts room" ) ;
35+ } ) ;
2836} ;
2937
3038const handleLandfill = ( socket : Socket ) => {
31- // to be implemented
39+ const id = socket . handshake . query . id ;
40+
41+ socket . on ( "join_rooms" , async ( data ) => {
42+ if ( id == undefined ) {
43+ return ;
44+ }
45+ console . log ( "landfill" , id , "has joined" ) ;
46+
47+ socket . join ( id ) ;
48+ console . log ( "joined landfill room" ) ;
49+ } ) ;
3250} ;
3351
3452const handleVehicle = ( socket : Socket ) => {
You can’t perform that action at this time.
0 commit comments