Absolute beginners guide to _pext_infoblobs (draft)

This is a way to get users up upload their own image/avatar, and have it shown to everyone else.

[code]Spoike: "the menuqc’s setlocaluserinfoblob just updates the userinfo. the client will automatically transmit its userinfo to the server, and the server will ‘bounce’ userinfo to all other users like it does with names/colours/etc
hence why you can set your local userinfo and then query it in csqc on some other fte client on the same server….

The displaying csqc can then just grab the blob and throw a copy of it to the engine’s textures subsystem for use with drawpic.
this stuff allows you to use infoblobs for anything you want
from avatars to country indicators to user settings (parsed serverside – use a _ prefix to stop other clients seeing it) to crypto certificates that uniquely identify the user.
or whatever." [/code]

The ‘STEP BY STEP’:
// CLIENT let’s call him “Jimmy”
1. Jimmy makes a 128 * 128 pic, calls it ‘mugshot.png’
2. He puts it in Quake/fortress/mypics (?)

Spoike: “make some menuqc that calls setlocaluserinfoblob. (or be lame and require the user to use the setinfoblob mugshot "filename" console command)

(Since I haven’t figured out to make menuqc work yet, lets be lame:)

3. Jimmy types at his client console: “setinfoblob myavatar “fortress/mypics/mugshot.png”

4. He types “save_cfg”.

// CSQC
// Credit Spoike:

Spike says: “you should then be able to drawpic it. But do note that you should cache it instead of constantly spamming the same get+upload calls every single frame because that’s inefficient. Shoving it inside the CSQC_PlayerInfoChanged entrypoint is a very good idea (or at least invalidate their old mugshot there)”

NOTES:
Q: How do we stop ppl uploading massive files?

A: use sv_userinfo_bytelimit.

int size_of_pic = getlocalinfo(imagename, Jimmy.myavatar, MAX_PIC_SIZE);

if(size_of_pic > sv_userinfo_bytelimit)

dprint(“avatar too big\n”);

 

// notes
OMC: How do I get to see their pics on my screen next to their names?
Spoike: playernum…
kinda expects that you’re making your own scoreboard code.
if you’re still depending on the engine to sort players (thus you’re using negative player numbers) then use playernum = getplayerkeyfloat(negativeplayernum, “viewentity”)-1;

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>