Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Commit

Permalink
12.28.2020-prerelease.01
Browse files Browse the repository at this point in the history
+ Attempted fix for Server Crashing on Host Leaving
  • Loading branch information
200Tigersbloxed committed Dec 28, 2020
1 parent 5bb7814 commit bd99b0e
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions beep.js
Expand Up @@ -295,14 +295,41 @@ io.on('connection', (socket) => {
// make sure there was a player before continuing
if(!failedToFindPlayer){
if(inRound){
if(host.toLowerCase() == plrwholeft.toLowerCase()){
EndRound()
// thats it
try{
if(host.toLowerCase() == plrwholeft.toLowerCase()){
EndRound()
// thats it
}
}
catch{
try{
if(host == null || host == undefined){
EndRound()
}
}
catch{
// just end the round at this point
EndRound()
}
}
if(currentPlayer.toLowerCase() == plrwholeft.toLowerCase()){
// okay so we can just pick a new person
EndPlayerTurn()
// thats it

try{
if(currentPlayer.toLowerCase() == plrwholeft.toLowerCase()){
// okay so we can just pick a new person
EndPlayerTurn()
// thats it
}
}
catch{
try{
if(currentPlayer == null || currentPlayer == undefined){
EndPlayerTurn()
}
}
catch{
// just end the round at this point
EndRound()
}
}
}
// remove them from the list
Expand Down

1 comment on commit bd99b0e

@200Tigersbloxed
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attempted Fix for #1

Please sign in to comment.