forked from OpenWF/SpaceNinjaServer
		
	ignore drop after logout
This commit is contained in:
		
							parent
							
								
									b23979855e
								
							
						
					
					
						commit
						8d54b2c043
					
				@ -179,17 +179,15 @@ const wsOnConnect = (ws: ws, req: http.IncomingMessage): void => {
 | 
				
			|||||||
            logError(e as Error, `processing websocket message`);
 | 
					            logError(e as Error, `processing websocket message`);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    ws.on("close", () => {
 | 
					    // eslint-disable-next-line @typescript-eslint/no-misused-promises
 | 
				
			||||||
 | 
					    ws.on("close", async () => {
 | 
				
			||||||
        if ((ws as IWsCustomData).isGame && (ws as IWsCustomData).accountId) {
 | 
					        if ((ws as IWsCustomData).isGame && (ws as IWsCustomData).accountId) {
 | 
				
			||||||
            logger.debug(`lost bootstrapper connection for ${(ws as IWsCustomData).accountId}`);
 | 
					            logger.debug(`lost bootstrapper connection for ${(ws as IWsCustomData).accountId}`);
 | 
				
			||||||
            void Account.updateOne(
 | 
					            const account = await Account.findOne({ _id: (ws as IWsCustomData).accountId });
 | 
				
			||||||
                {
 | 
					            if (account?.Nonce) {
 | 
				
			||||||
                    _id: (ws as IWsCustomData).accountId
 | 
					                account.Dropped = true;
 | 
				
			||||||
                },
 | 
					                await account.save();
 | 
				
			||||||
                {
 | 
					            }
 | 
				
			||||||
                    Dropped: true
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            ).then(() => {});
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user