steamUtils
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Dannyps\Steam\SteamID Class Reference

Useful functions to convert SteamIDs. More...

Inheritance diagram for Dannyps\Steam\SteamID:
[legend]

Public Member Functions

 __construct ($id)
 
 isUser ()
 
 isGroup ()
 
 getSteamID64 ()
 
 getSteamID3 ()
 
 getSteamID ()
 

Protected Attributes

 $steamID
 The internal representation is the SteamID64. More...
 

Private Member Functions

 isUserBySteamID64 ($w)
 determines whether the passed steamID64 belongs to a user or a group. More...
 

Private Attributes

 $user
 true if the SteamID represents a user, false otherwise (a group). More...
 

Detailed Description

Useful functions to convert SteamIDs.

There are several representations for steam IDs.

They are the following:

Name Example Regex Supports clans
steamID STEAM_1:1:31739929 ^STEAM_(\d):(\d):(\d*)$ no (individual user by default)
steamID3(2)[U:1:63479859] ^\[(U\|g):1:(\d*)\]$ yes
steamID64 76561198023745587 ^\d{17,18}$ yes

Reference: https://developer.valvesoftware.com/wiki/SteamID

Author
Daniel Silva mail@.nosp@m.dann.nosp@m.yps.n.nosp@m.et

Constructor & Destructor Documentation

◆ __construct()

Dannyps\Steam\SteamID::__construct (   $id)
Parameters
$ida steamID in any of the three formats supported.
Exceptions
-1on invalid SteamID.
Here is the call graph for this function:

Member Function Documentation

◆ getSteamID()

Dannyps\Steam\SteamID::getSteamID ( )
Returns
the steamID for the current steamID.
Warning
If the current steamID belongs to a group, this will fail.
Exceptions
-2the current steamID belongs to a group, as it cannot be represented in this format.

◆ getSteamID3()

Dannyps\Steam\SteamID::getSteamID3 ( )
Returns
the steamID3 for the current steamID.
Here is the call graph for this function:

◆ getSteamID64()

Dannyps\Steam\SteamID::getSteamID64 ( )
Returns
the steamID64 for the current steamID.

◆ isGroup()

Dannyps\Steam\SteamID::isGroup ( )
Returns
true if the SteamID represents a group, false otherwise (a user).

◆ isUser()

Dannyps\Steam\SteamID::isUser ( )
Returns
true if the SteamID represents a user, false otherwise (a group).

◆ isUserBySteamID64()

Dannyps\Steam\SteamID::isUserBySteamID64 (   $w)
private

determines whether the passed steamID64 belongs to a user or a group.

Returns
true if user, false otherwise.
Here is the caller graph for this function:

Member Data Documentation

◆ $steamID

Dannyps\Steam\SteamID::$steamID
protected

The internal representation is the SteamID64.

◆ $user

Dannyps\Steam\SteamID::$user
private

true if the SteamID represents a user, false otherwise (a group).


The documentation for this class was generated from the following file: