forked from External/mage
remove stale users after 10 minutes
This commit is contained in:
parent
b4b02d0f68
commit
bf2f4e3078
9 changed files with 135 additions and 33 deletions
|
|
@ -32,7 +32,6 @@ import java.text.DateFormat;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import mage.interfaces.callback.ClientCallback;
|
||||
|
|
@ -51,8 +50,6 @@ public class ChatSession {
|
|||
private UUID chatId;
|
||||
private DateFormat timeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.SHORT);
|
||||
|
||||
//TODO: use sessionId for chatting - prevents sending without being part of the chat
|
||||
|
||||
public ChatSession() {
|
||||
chatId = UUID.randomUUID();
|
||||
}
|
||||
|
|
@ -98,4 +95,8 @@ public class ChatSession {
|
|||
return chatId;
|
||||
}
|
||||
|
||||
public boolean hasUser(UUID userId) {
|
||||
return clients.containsKey(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue