Skip to content

Commit b01ccc4

Browse files
authored
Merge pull request #20 from USTakAssociation/dev
Dev to Main
2 parents 5f4ec7d + b856ec7 commit b01ccc4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
playtakdb/
1+
playtakdb/
2+
3+
run
4+
run/**

server/src/main/java/tak/Client.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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");

0 commit comments

Comments
 (0)