Jump to content
McKay Development

personaState being partly ignored by steam.


Recommended Posts

Recently (In the last few months) the function setPersona state partly broke.
The persona still changes and updates if you set the persona to be Online, but setting it to Away, Busy or Snooze will not have any effect.

the setPersona function is called using a value from `EPersonaState.js` (https://github.com/DoctorMcKay/node-steam-user/blob/master/enums/EPersonaState.js).
When setting the persona to a value of 2, 3, 4, 7 or 8, steam will not update the persona. It is worth noting that persona state 5 and 6 (LookingToTrade/Play) still work perfectly fine.

I have added a code snippet of how I set my persona state below.

this._steam = new SteamUser({ dataDirectory: dataDir });

// Login to steam, and wait for the 'loggedOn' event.

// The following is tried with a number of states defined in the EPersonaState.js
this._steam.setPersona(
  SteamUser.EPersonaState["Busy"]
);

I then used the official steam client to check the effective personaState, which was only updated if it was set to offline, LookingToTrade or LookingToPlay. Setting the persona to another value such as Away still worked a few months ago.

Another notable effect is that node-steam-user still receives a correct persona update event if the persona is being set to invisible,  but the persona is NOT updated in other steam clients. states such as Away and Busy don't receive any steam persona update event.

Edited by iron
added some tags
Link to post
Share on other sites

It seems to work properly for me. I wrote a bot to do this:

user.chat.on('friendMessage', async (msg) => {
	console.log(msg.message);

	user.chat.ackFriendMessage(msg.steamid_friend, msg.server_timestamp);

	if (msg.message.match(/^personastate \d+$/)) {
		let state = parseInt(msg.message.split(' ')[1], 10);
		user.setPersona(state);
	}
});

It did what was expected.

Link to post
Share on other sites
Posted (edited)

Today I found out that having a mobile phone with the steam chat app (running in the background) connected to the same account will override the personaState set in node-steam user. There are two exceptions to this however, LookingToTrade and LookingToPlay are not overridden by the phone.
(force) Closing the app will resolve the issue and make node-steam-user work correctly.

It is worth noting that the Away and Snooze personaState for some reason produce a phone icon behind ones name, even if there is no phone connected at that moment. (setUIMode is not used.)

Thanks for your effort and time.

Edited by iron
added away and snooze phone icon quirk
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...