-
Notifications
You must be signed in to change notification settings - Fork 2
Profiles (Session Users)
Please note that this section is meant for the user that is bound to the session (the logged-in authenticated user). Functions covered in this article are usually accessed through the AuthenticatedSession<TUser>.Profile
property. If you wish to access the corresponding User
object, use the AuthenticatedSession<TUser>.User
property which is a simple quick access reference to the AuthenticatedSession<TUser>.Profile.User
property.
You may update your avatar using the Profile.SetAvatar
function as follows:
session.Profile.SetAvatar(session, Image.FromWeb(new Uri("http://i.epvpimg.com/mdDHb.jpg")));
This code downloads the image that is located at the specified Uri
and uploads it as your avatar on elitepvpers.
And if you want to use an image located somewhere in the local filesystem, you'd want to go with this one:
session.Profile.SetAvatar(session, Image.FromFileSystem(@"my/path/to/my/img.jpg"));
Some people tend to remove their avatars instead of changing them to a new image, this is also supported and only requires one simple call:
session.Profile.RemoveAvatar(session);
In case you want to update your signature, you can easily specify the new signature Content
by passing it to the SetSignature
function:
session.Profile.SetSignature(session, new Content("Test"));
See the Content
wiki page for further information on how to style your signature with the content framework using certain BB style codes.
By using the GetTreasures
function, retrieving the currently listed, sold and bought treasures associated to your user account is as easy as it gets:
var treasures = session.Profile.GetTreasures(session, Treasure.Query.SoldListed);
This will get you all treasures that your user account has listed or sold. You may also omit the query status in this case, since Treasure.Query.SoldListed
is the default value for this parameter.
And if you just want the treasures you've bought, replace the Treasure.Query.SoldListed
constant with the Treasure.Query.Bought
constant and you should be good to go.
The function is declared as follows:
public List<Treasure> GetTreasures(session, Treasure.Query queryStatus = Treasure.Query.SoldListed, uint pageCount = 1, uint startIndex = 1)
- queryStatus is the treasure status to query. Possible values are
Treasure.Query.SoldListed
for all listed and sold treasures as well asTreasure.Query.Bought
for all bought treasures - pageCount stands for the amount of pages to get treasures from. The higher this count, the more data will be generated and received
- startIndex is the index of the first page to parse. By default, this value is set to 1 representing the first treasure page
Please note that not all properties will be updated, it really depends on which status you query. The treasure content for instance, is never updated since it is simply not given in the requested page. To update all properties, you should call the Treasure.Update
function.
The following Treasure
properties are affected:
- ID as
uint
- Title as
string
- Cost as
uint
- Buyer as
User
(ifTreasure.Query.SoldListed
was passed) - Seller as
User
(ifTreasure.Query.Bought
was passed) - Available as
bool