Skip to content
Snippets Groups Projects
Select Git revision
  • 9709d3a1a738dd8aa45b9d365b7ca80a1c7ec539
  • main default protected
  • (Gagafeee)
3 results

Seller.php

Blame
  • Seller.php 809 B
    <?php
    class Seller{
        private string $uuid;
        private string $username;
        private string $skin;
    
        public function __construct($uuid){
            $this->uuid = $uuid;
            $jsonProfileInfos = file_get_contents('https://sessionserver.mojang.com/session/minecraft/profile/'.$uuid);
            $profileInfos = json_decode($jsonProfileInfos, true);
            $this->username = $profileInfos['name'];
    
            $properties = json_decode(base64_decode($profileInfos['properties'][0]['value']), true);
            $this->skin = $properties['textures']['SKIN']['url'];
        }
    
        public function getUuid(): string
        {
            return $this->uuid;
        }
        public function getUsername(): string
        {
            return $this->username;
        }
        public function getSkin(): string
        {
            return $this->skin;
        }
    }