Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. * Tell Steam that you're "playing" zero or more games.
  2. * @param {array} apps - Array of integers (AppIDs) or strings (non-Steam game names) for the games you're playing. Empty to play nothing.
  3. * @param {boolean} [force=false] If true, kick any other sessions logged into this account and playing games from Steam
  4. */
  5. SteamUser.prototype.gamesPlayed = function(apps, force) {
  6. if (!(apps instanceof Array)) {
  7. apps = [apps];
  8. }
  9.  
  10. var self = this;
  11. if (this._playingBlocked && force) {
  12. this.kickPlayingSession(doTheThing);
  13. } else {
  14. doTheThing();
  15. }
  16.  
  17. function doTheThing() {
  18. self._send(SteamUser.EMsg.ClientGamesPlayed, apps.map(function(app) {
  19. if (typeof app === 'string') {
  20. return {
  21. "game_id": "15190414816125648896",
  22. "game_extra_info": app
  23. };
  24. }
  25.  
  26. if (typeof app === 'object') {
  27. return app;
  28. }
  29.  
  30. return {"game_id": app};
  31. }));
  32. }
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement