package net.minecraft.client;

import net.minecraft.client.multiplayer.PlayerInfo;
import net.minecraft.client.multiplayer.ClientPacketListener;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.multiplayer.ClientLevel;
import java.util.UUID;
import com.mojang.bridge.game.GameSession;

public class Session implements GameSession {
    private final int players;
    private final boolean isRemoteServer;
    private final String difficulty;
    private final String gameMode;
    private final UUID id;
    
    public Session(final ClientLevel dno, final LocalPlayer dqb, final ClientPacketListener dnp) {
        this.players = dnp.getOnlinePlayers().size();
        this.isRemoteServer = !dnp.getConnection().isMemoryConnection();
        this.difficulty = dno.getDifficulty().getKey();
        final PlayerInfo dns5 = dnp.getPlayerInfo(dqb.getUUID());
        if (dns5 != null) {
            this.gameMode = dns5.getGameMode().getName();
        }
        else {
            this.gameMode = "unknown";
        }
        this.id = dnp.getId();
    }
    
    public int getPlayerCount() {
        return this.players;
    }
    
    public boolean isRemoteServer() {
        return this.isRemoteServer;
    }
    
    public String getDifficulty() {
        return this.difficulty;
    }
    
    public String getGameMode() {
        return this.gameMode;
    }
    
    public UUID getSessionId() {
        return this.id;
    }
}
