[FEATURE] connectUUID

This commit is contained in:
Gravit 2019-11-30 03:12:00 +07:00
parent 977f8dfaec
commit b93848055b
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
2 changed files with 8 additions and 2 deletions

View file

@ -31,9 +31,9 @@ public void invoke(String... args) {
Client client = frameHandler.getClient(); Client client = frameHandler.getClient();
String ip = IOHelper.getIP(channel.remoteAddress()); String ip = IOHelper.getIP(channel.remoteAddress());
if (!client.isAuth) if (!client.isAuth)
LogHelper.info("Channel %s | checkSign %s", ip, client.checkSign ? "true" : "false"); LogHelper.info("Channel %s | connectUUID %s | checkSign %s", ip, frameHandler.getConnectUUID(), client.checkSign ? "true" : "false");
else { else {
LogHelper.info("Client name %s | ip %s", client.username == null ? "null" : client.username, ip); LogHelper.info("Client name %s | ip %s | connectUUID %s", client.username == null ? "null" : client.username, ip, frameHandler.getConnectUUID());
LogHelper.subInfo("Data: checkSign %s | isSecure %s | auth_id %s", client.checkSign ? "true" : "false", client.isSecure ? "true" : "false", LogHelper.subInfo("Data: checkSign %s | isSecure %s | auth_id %s", client.checkSign ? "true" : "false", client.isSecure ? "true" : "false",
client.auth_id); client.auth_id);
LogHelper.subInfo("Permissions: %s (long %d)", client.permissions == null ? "null" : client.permissions.toString(), client.permissions == null ? 0 : client.permissions.toLong()); LogHelper.subInfo("Permissions: %s (long %d)", client.permissions == null ? "null" : client.permissions.toString(), client.permissions == null ? 0 : client.permissions.toLong());

View file

@ -11,6 +11,7 @@
import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.IOHelper;
import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.LogHelper;
import java.util.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class WebSocketFrameHandler extends SimpleChannelInboundHandler<WebSocketFrame> { public class WebSocketFrameHandler extends SimpleChannelInboundHandler<WebSocketFrame> {
@ -25,6 +26,7 @@ public WebSocketFrameHandler(NettyConnectContext context, LaunchServer srv, WebS
} }
private Client client; private Client client;
private final UUID connectUUID = UUID.randomUUID();
static { static {
} }
@ -37,6 +39,10 @@ public Client getClient() {
return client; return client;
} }
public final UUID getConnectUUID() {
return connectUUID;
}
@Override @Override
public void channelActive(ChannelHandlerContext ctx) { public void channelActive(ChannelHandlerContext ctx) {
if (LogHelper.isDevEnabled()) { if (LogHelper.isDevEnabled()) {