Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ Request a list of current live tournament games.
This is the list you see in the client under Watch -> Live.
Listen for the `matchList` event to get your response.

### openContainer(containerid[, keyid])

- `containerid` - The asset ID of the container.
- `keyid` - The asset ID of the key, defaults to 0 if not provided as to unlock a keyless container.

Opens a container. Listen for the `itemAcquired` event to get the item unboxed (if open was successful)

### requestRecentGames(steamid)

Request a list of recent games (max. 8). This is the list you see in the client under Watch -> Your Matches.
Expand Down
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ GlobalOffensive.prototype._connect = function() {
this._helloTimer = setTimeout(sendHello, 500);
};

GlobalOffensive.prototype.openContainer = function(containerID, keyID) {
var buf = new ByteBuffer(16, ByteBuffer.LITTLE_ENDIAN);
buf.writeUint64(keyID || 0);
buf.writeUint64(containerID);
this._send(Language.UnlockCrate, null, buf);
};

GlobalOffensive.prototype._send = function(type, protobuf, body) {
if (!this._steam.steamID) {
return false;
Expand Down