Skip to content

enimmy/steamworks-getprofileurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

steamworks-getprofileurl

central plugin for managing profile picture URLs. all URLs are cached, so don't recache them, just call this plugin to populate your string. Since grabbing profile pictures requires an API key, having one central plugin allows server owners to only need to type it one time(if this is used).

Cvar

Forward

The central plugin waits for OnClientAuthorized to get the profile picture, so to avoid plugins asking for a url too early, you can just listen for a forward. If you don't need the URL as soon as the player joins (idk too many situations you would honestly), then just don't listen for this, the function still returns false if the string is empty

/**
 * Called when a players Profile Url has been set. (Some time after OnAuthorized)
 * @param client    client whos url was cached
 */
  • forward void Sw_ProfileUrlFound(int client);

Native

Populates buffer with players profile picture URL. I'd recommend 1024 str length.
@param client    target client
@param buffer    buffer to populate
@param maxlen    sizeof(buffer)
@return          true on success, false if empty (no api key) or failure
  • native bool Sw_GetProfileUrl(int client, char[] buffer, int maxlen);

Example:

public void Sw_ProfileUrlFound(int client)
{
	char profileurl[1024];
	if(Sw_GetProfileUrl(client, profileurl, sizeof(profileurl)))
	{
		//do stuff
	}
}

About

central plugin for grabbing/url cache

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published