function ChangeName($char_id,$new_char_name)

Discussion in 'Discussions & Suggestions' started by redfox, Aug 21, 2020.

  1. redfox

    redfox New Member

    function ChangeName($char_id,$new_char_name)
    {
    global $cached_errors;
    global $cached_ip,$cached_port;
    kick_char($char_id);
    $buf=pack("cV",4,$char_id).tounicode($new_char_name);
    $cachedsocket=@fsockopen($cached_ip,$cached_port,$errno,$errstr,1) or die($notconnected);
    fwrite($cachedsocket,pack("s",(strlen($buf)+2)).$buf);
    $len=unpack("v",fread($cachedsocket,2));
    $rid=unpack("c",fread($cachedsocket,1));
    for($i=0;$i<(($len[1]-4)/4);$i++){
    $read=unpack("i",fread($cachedsocket,4));
    $rs.=$read[1];
    }
    fclose($cachedsocket);
    return $rs;
    }

    Do not change to Korean name.
    please help.