DcSteamUser Posted March 20 Report Posted March 20 When using SteamUser, I noticed that certain variables are frequently set to null in specific situations within the instance created for the user (e.g., const session = new SteamUser() ). This occurs not only during brief disconnections but also in other scenarios. Why does this happen? How can it be prevented, especially considering that the values were correct before? Ideally, I would like to ensure that the values always remain valid, especially if they were already correct and are never simply reset to null. Is there a way to configure this? Quote
DcSteamUser Posted March 21 Author Report Posted March 21 (edited) 7 hours ago, Dr. McKay said: Values like what? @Dr. McKay I mean the values of the created SteamUser instance, such as the SteamID, balance, and limitations—essentially everything conveniently stored in the instance. These values are all reset to zero, for example, when the connection is briefly lost, making it difficult for me to work with them. If I then try to retrieve some of these values, like the SteamID, my program crashes immediately because they are no longer set. Edited March 21 by DcSteamUser Quote
Dr. McKay Posted March 21 Report Posted March 21 That's expected behavior. If it's no longer connected to Steam, the data may be stale. Cache it somewhere else yourself if you need it after disconnect. 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.