Fixed Server Thread Crash $2
This commit is contained in:
@@ -113,6 +113,7 @@
|
||||
<workItem from="1675011774462" duration="1723000" />
|
||||
<workItem from="1675112930043" duration="1858000" />
|
||||
<workItem from="1675193746966" duration="5298000" />
|
||||
<workItem from="1675280447181" duration="22000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
@@ -9,10 +9,10 @@ EditorUserSettings:
|
||||
value: 5604555501510a0955590d74437008441216412e7578276829704a6bb0b66c3a
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-1:
|
||||
value: 0000025f04075d0f0c0a5c7149205a4417154f782e7923357e7a4560e3b4653b
|
||||
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
||||
flags: 0
|
||||
RecentlyUsedSceneGuid-2:
|
||||
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
|
||||
value: 0000025f04075d0f0c0a5c7149205a4417154f782e7923357e7a4560e3b4653b
|
||||
flags: 0
|
||||
UnityRemoteDevice:
|
||||
value: 225f4d46245b0d4902070862342649191512
|
||||
|
||||
Generated
+1
@@ -79,6 +79,7 @@
|
||||
<workItem from="1675011672827" duration="777000" />
|
||||
<workItem from="1675111963945" duration="610000" />
|
||||
<workItem from="1675193290788" duration="3495000" />
|
||||
<workItem from="1675279163903" duration="1178000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+18
-6
@@ -60,8 +60,7 @@ public class Room
|
||||
players[p].output.write(new byte[]{126, 0, 0, 0, 0, 0, 0, 0, 0, 0});
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
} catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -75,7 +74,9 @@ public class Room
|
||||
};
|
||||
|
||||
t.scheduleAtFixedRate(tt, 0, 10000);
|
||||
}catch(Exception e){}
|
||||
} catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void addClient(Client client)
|
||||
@@ -156,9 +157,6 @@ public class Room
|
||||
players[i].output.write(new byte[]{2, (byte) currentPlayer, 0, 0, 0, 0, 0, 0, 0, 0});
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
server.deleteRoom(roomCode);
|
||||
break;
|
||||
case 126:
|
||||
players[player].lastTimeSendTimeOutCheck = System.currentTimeMillis();
|
||||
break;
|
||||
@@ -171,6 +169,7 @@ public class Room
|
||||
}
|
||||
}
|
||||
});
|
||||
t.setName("Thread Player: " + (playerCount - 1));
|
||||
t.start();
|
||||
threads.add(t);
|
||||
break;
|
||||
@@ -295,9 +294,22 @@ public class Room
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < threads.size(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
threads.get(i).interrupt();
|
||||
} catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
t.cancel();
|
||||
} catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user