1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

bytes

Discussion in 'Development' started by #A6543, Jun 18, 2017.

  1. #A6543

    #A6543 Zombie

    Messages:
    267
    I save a players skin data in a config. But there is a problem.

    PHP:
    //Config is $conf
    $conf->set("data"$player->getSkinData());
    $conf->save();

    /*
    But it puts something in front of the real data. 
    This: !!binary |- and some spaces

    Does someone know why this happens? If I remove it manually the SkinData works. 

    If you need more information please ask me
    */
     
  2. Kenn Fatt

    Kenn Fatt Slime

    Messages:
    82
    GitHub:
    kennfatt
    can i see your $conf variable declaration?
     
  3. #A6543

    #A6543 Zombie

    Messages:
    267
    PHP:
    $conf = new Config($this->getDataFolder() . "data.yml"Config::YAML);
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Encode the skin data with base64 or bin2hex to avoid storing binary bytes to YAML directly.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.