Forum

Results 1 to 5 of 5
  1. #1
    Join Date
    March 2015
    Posts
    6

    How to set avatar through ClientQuery

    As title says, I need help doing that, found nothing when searching in documentation.
    clientupdate client_flag_avatar tried to use but failed. Need help.

  2. #2
    Join Date
    March 2009
    Location
    Germany
    Posts
    41
    Well that is not so easy, but I'll try to give you a short guide:

    First of, avatars are transfered via FileTransfer protocol, as are files in general.

    These steps are required:
    1.) Initialize Filetransfer to internal Storage with filename 'avatar'.
    To achieve this, you need to first register the ftstartuploadevent. (this is undocumented!)
    Code:
    clientnotifyregister schandlerid=0 event=notifyftstartupload
    > error id=0 msg=ok
    Then you need to do ftinitupload with the correct parameters. Filesize has to be correct!
    Code:
    ftinitupload clientftfid=1 name=\/avatar cid=0 cpw= size=133852 overwrite=0 resume=0
    > notifystartupload schandlerid=1 clientftfid=1 serverftfid=744 ftkey=yss7Ht2Vxb3X4JyCR3wx0dDezxoHyeTj port=30033 ip=0.0.0.0, seekpos=0
    error id=0 msg=ok
    You'll then receive a ftkey and port and ip address. The ip address might be incorrect, as seen above (this is the listen address. Here 0.0.0.0 which means listen on all available interfaces. This won't help much. But port and ftkey are important.
    2.) Send the file thru ft-port (here 30033). Open a socket to port 30033 on the server ip. Send the ftkey first without newlines or separator append file content (size bytes). Then close port and file transfer is done.

    E.g. in bash one could do:
    Code:
    cat <(echo -n "yss7Ht2Vxb3X4JyCR3wx0dDezxoHyeTj") Obbi.png | nc u5b.de 30033
    The string in "" is the ftkey which is send first, then the file Obbi.png is appended. Be ware that Obbi.png has the correct format and is size bytes in size.
    3.) Set clientvariable client_flag_avatar to the md5-sum of the file content.

    Next you need to calculate the md5sum of your avatar.
    In Bash one could use:
    Code:
    md5sum Obbi.png
    > dfac7bf00a13651b534e9b017f21cc56  Obbi.png
    You'll receive the hash and specified filename. The hash has to be set as value for client_flag_avatar
    Code:
    clientupdate client_flag_avatar=dfac7bf00a13651b534e9b017f21cc56
    After that, client will download your avatar and display it. See client log for errors! (like wrong md5sum etc.)
    Very important with all this is time. Every operation has a timeout. So if you test this by hand you should not waste to much time on entering commands.

  3. #3
    Join Date
    March 2015
    Location
    South coast, England, UK
    Posts
    26
    Not possible I think, where are you going to select the avatar in the query terminal?

  4. #4
    Join Date
    December 2009
    Location
    SOUTH EARtH
    Posts
    39

    Angry

    Is there a way to do this with the latest version ?
    I can upload icons,
    But I get invalid size when I try to upload avatars.
    I just want to restore a backup with all the files
    Last edited by dante696; November 29th, 2018 at 08:25 AM. Reason: giant quote removed

  5. #5
    Join Date
    June 2011
    Location
    Germany
    Posts
    4,368
    There are no file transfer functions in client query. Obbi's post was incorrect even at the time of writing, as there weren't file transfer functions back in 2014 either.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Resolved] Absturz beim Beenden mit zwei ClientQuery Sockets / Crash on exit using ClientQuery
    By upstreamfacingport in forum Bug Reports [EN/DE]
    Replies: 2
    Last Post: March 27th, 2017, 11:29 AM
  2. Retrieve Avatar through ClientQuery - Possible?
    By tanktarta in forum Tools / Web Based
    Replies: 6
    Last Post: June 3rd, 2012, 05:50 PM
  3. ClientQuery plugin
    By florian_fr40 in forum Client Plugins / Lua Scripts
    Replies: 16
    Last Post: October 14th, 2010, 06:33 PM
  4. Avatar: can't delete local avatar copy
    By DaleB in forum Client Support
    Replies: 2
    Last Post: August 2nd, 2010, 02:34 PM
  5. Avatar: can't delete local avatar copy
    By DaleB in forum Bug Reports [EN/DE]
    Replies: 2
    Last Post: August 2nd, 2010, 02:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •