File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1- playtakdb /
1+ playtakdb /
2+
3+ run
4+ run /**
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ public class Client extends Thread implements Publisher<GameUpdate> {
3535 public int protocolVersion =0 ;
3636
3737 static AtomicInteger totalClients = new AtomicInteger (0 );
38- static AtomicInteger onlineClients = new AtomicInteger (0 );
3938
4039 static ConcurrentHashSet <Client > clientConnections = new ConcurrentHashSet <>();
4140 protected ConcurrentHashSet <Subscriber <? super GameUpdate >> subscribers = new ConcurrentHashSet <>();
@@ -304,7 +303,7 @@ void clientQuit() throws IOException {
304303 unspectateAll ();
305304
306305 player .loggedOut ();
307- sendAllOnline ("Online " +onlineClients . decrementAndGet ());
306+ sendAllOnline ("Online " +clientConnections . size ());
308307 }
309308
310309 websocket .kill (201 );
@@ -406,7 +405,7 @@ else if(player.isLoggedIn()){
406405 Seek .registerListener (this );
407406 Game .registerGameListListener (player );
408407
409- sendAllOnline ("Online " +onlineClients . incrementAndGet ());
408+ sendAllOnline ("Online " +clientConnections . size ());
410409 }
411410 finally {
412411 Player .loginLock .unlock ();
@@ -448,7 +447,7 @@ else if ((m = loginPattern.matcher(temp)).find()) {
448447 Seek .registerListener (this );
449448 Game .registerGameListListener (player );
450449
451- sendAllOnline ("Online " +onlineClients . incrementAndGet ());
450+ sendAllOnline ("Online " +clientConnections . size ());
452451 }
453452 } else
454453 send ("Authentication failure" );
You can’t perform that action at this time.
0 commit comments