iron Posted April 14, 2020 Report Posted April 14, 2020 (edited) 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 April 14, 2020 by iron added some tags Quote
Dr. McKay Posted April 14, 2020 Report Posted April 14, 2020 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. Quote
iron Posted April 15, 2020 Author Report Posted April 15, 2020 (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 April 15, 2020 by iron added away and snooze phone icon quirk Quote
Recommended Posts
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.