Session增加clientId注册

master
剑器近 2020-11-18 17:04:10 +08:00
parent 5925b146cf
commit 3064ac86e3
1 changed files with 12 additions and 1 deletions

View File

@ -1,10 +1,10 @@
package io.github.yezhihao.netmc.session;
import io.github.yezhihao.netmc.core.model.Header;
import io.netty.channel.Channel;
import io.netty.util.AttributeKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.yezhihao.netmc.core.model.Header;
import java.util.Collection;
import java.util.Map;
@ -81,6 +81,17 @@ public class Session {
sessionManager.put(clientId, this);
}
public void register(Object clientId) {
this.register(clientId, null);
}
public void register(Object clientId, Object subject) {
this.clientId = clientId;
this.registered = true;
this.subject = subject;
sessionManager.put(clientId, this);
}
public Object getClientId() {
return clientId;
}