C# Class SteamWebAPI.SteamAPISession

Class allowing you to use the Steam Web API to log in and use Steam Friends functionality.
ファイルを表示 Open project: Overv/SteamWebAPI Class Usage Examples

Public Methods

Method Description
Authenticate ( String accessToken ) : LoginStatus

Authenticate with an access token previously retrieved with a username and password (and SteamGuard code).

Authenticate ( String username, String password, String emailauthcode = "" ) : LoginStatus

Authenticate with a username and password. Sends the SteamGuard e-mail if it has been set up.

GetFriends ( String steamid = null ) : List

Fetch all friends of a given user.

This function does not provide detailed information.

GetGroupAvatar ( GroupInfo group, AvatarSize size = AvatarSize.Small ) : Bitmap

Retrieve the avatar of the specified group in the specified format.

GetGroupInfo ( String steamid ) : GroupInfo
GetGroupInfo ( List groups ) : List
GetGroupInfo ( List steamids ) : List

Retrieve information about the specified groups.

GetGroups ( String steamid = null ) : List

Fetch all groups of a given user.

GetServerInfo ( ) : ServerInfo

Retrieves information about the server.

GetUserAvatar ( User user, AvatarSize size = AvatarSize.Small ) : Bitmap

Retrieve the avatar of the specified user in the specified format.

GetUserInfo ( List friends ) : List
GetUserInfo ( List steamids ) : List

Retrieve information about the specified users.

This function doesn't have the 100 users limit the original API has.

GetUserInfo ( String steamid = null ) : User
Poll ( ) : List

Check for updates and new messages.

SendMessage ( String steamid, String message ) : bool
SendMessage ( User user, String message ) : bool

Send a text message to the specified user.

SendTypingNotification ( User user ) : bool

Let a user know you're typing a message. Should be called periodically.

Private Methods

Method Description
login ( ) : bool

Helper function to complete the login procedure and check the credentials.

steamRequest ( String get, String post = null ) : String

Helper function to perform Steam API requests.

unixTimestamp ( long timestamp ) : System.DateTime

Method Details

Authenticate() public method

Authenticate with an access token previously retrieved with a username and password (and SteamGuard code).
public Authenticate ( String accessToken ) : LoginStatus
accessToken String Access token retrieved with credentials
return LoginStatus

Authenticate() public method

Authenticate with a username and password. Sends the SteamGuard e-mail if it has been set up.
public Authenticate ( String username, String password, String emailauthcode = "" ) : LoginStatus
username String Username
password String Password
emailauthcode String SteamGuard code sent by e-mail
return LoginStatus

GetFriends() public method

Fetch all friends of a given user.
This function does not provide detailed information.
public GetFriends ( String steamid = null ) : List
steamid String steamid of target user or self
return List

GetGroupAvatar() public method

Retrieve the avatar of the specified group in the specified format.
public GetGroupAvatar ( GroupInfo group, AvatarSize size = AvatarSize.Small ) : Bitmap
group GroupInfo Group
size AvatarSize Requested avatar size
return System.Drawing.Bitmap

GetGroupInfo() public method

public GetGroupInfo ( String steamid ) : GroupInfo
steamid String
return GroupInfo

GetGroupInfo() public method

public GetGroupInfo ( List groups ) : List
groups List
return List

GetGroupInfo() public method

Retrieve information about the specified groups.
public GetGroupInfo ( List steamids ) : List
steamids List 64-bit SteamIDs of groups
return List

GetGroups() public method

Fetch all groups of a given user.
public GetGroups ( String steamid = null ) : List
steamid String SteamID
return List

GetServerInfo() public method

Retrieves information about the server.
public GetServerInfo ( ) : ServerInfo
return ServerInfo

GetUserAvatar() public method

Retrieve the avatar of the specified user in the specified format.
public GetUserAvatar ( User user, AvatarSize size = AvatarSize.Small ) : Bitmap
user User User
size AvatarSize Requested avatar size
return System.Drawing.Bitmap

GetUserInfo() public method

public GetUserInfo ( List friends ) : List
friends List
return List

GetUserInfo() public method

Retrieve information about the specified users.
This function doesn't have the 100 users limit the original API has.
public GetUserInfo ( List steamids ) : List
steamids List 64-bit SteamIDs of users
return List

GetUserInfo() public method

public GetUserInfo ( String steamid = null ) : User
steamid String
return User

Poll() public method

Check for updates and new messages.
public Poll ( ) : List
return List

SendMessage() public method

public SendMessage ( String steamid, String message ) : bool
steamid String
message String
return bool

SendMessage() public method

Send a text message to the specified user.
public SendMessage ( User user, String message ) : bool
user User
message String Message contents
return bool

SendTypingNotification() public method

Let a user know you're typing a message. Should be called periodically.
public SendTypingNotification ( User user ) : bool
user User
return bool