SteamKit icon indicating copy to clipboard operation
SteamKit copied to clipboard

Steam2 Universes

Open strafe opened this issue 6 years ago • 12 comments

Couple of questions about the SteamID class.

  1. Why must you supply an EUniverse when using the SetFromString method? I was under the impression the ID always contains the universe? xPaw's PHP implementation currently pulls the universe from the string.
  2. Why does the RenderSteam2 method automatically convert accounts that are in universe 1 to universe 0? This logic seems backwards as universe 0 is invalid and is only thought to be correct due to a bug(?). Again xPaw's PHP implementation corrects this the other way.

Thank you.

strafe avatar Jul 17 '18 21:07 strafe

I believe (2) is for backwards compatibility, to match our old behaviour - and Steam's old behaviour, and Source's old behaviour...

I'm not sure about (1). I assume it was that way in the original C++ code that was ported, but I'd have to check.

yaakov-h avatar Jul 18 '18 00:07 yaakov-h

I believe (2) is for backwards compatibility, to match our old behaviour - and Steam's old behaviour, and Source's old behaviour...

I see, don't think you think it would make more sense to provide the correct behaviour? Supposedly according to some posts (which I won't treat as gospel) any game that incorrectly used 0 instead of 1 now uses SteamID 3 internally instead and any games that didn't (such as CS:GO) still use it.

I'm not sure about (1). I assume it was that way in the original C++ code that was ported, but I'd have to check.

I see, I'm not familiar with the history of SteamKit at all.


Is the project open to changing behaviour with these things in at least some way (parameters to select behaviour) or are they too large?

strafe avatar Jul 18 '18 08:07 strafe

We tend to make breaking changes fairly regularly. 😢

yaakov-h avatar Jul 18 '18 11:07 yaakov-h

We tend to make breaking changes fairly regularly. cry

Ah good, not sure if this is just stalled now then. Maybe @xPaw or @asherkin could chime in.

strafe avatar Jul 18 '18 11:07 strafe

I don't see why we can't deprecate existing function and code new one with one less argument.

As of 2: you could do the same by adding another function with one more argument such as EUniverse invalid = EUniverse.Public or something similar.

JustArchi avatar Jul 18 '18 11:07 JustArchi

My PHP implementation is based on inspecting multiple Valve's implementations (steamworks sdk, 2007 source leak, a recent private leak from the source engine for partners, and looking at steamclient in IDA).

All these implementations sadly have discrepancies on Valve's side, so what I have there I think is the most reasonable approach to handling it.

xPaw avatar Jul 18 '18 11:07 xPaw

any game that incorrectly used 0 instead of 1 now uses SteamID 3 internally instead and any games that didn't (such as CS:GO) still use it.

That's not 100% accurate, but it's close. Older third-party Source games and Valve's older SDK bases still use the 0.

psychonic avatar Jul 18 '18 11:07 psychonic

Gut tells me that parsing should take 0 or 1 as Public (and drop the override), and that rendering should default to emitting Public as 1 but allow overriding to 0 for only Steam2. It is a breaking change on rendering, but I doubt it'll actually break anyone's real code.

asherkin avatar Jul 18 '18 11:07 asherkin

I bet someone is using that as a DB key somewhere... but we did already break the default to render Steam3 instead of Steam2.

yaakov-h avatar Jul 18 '18 12:07 yaakov-h

Revisiting this.

We could just ignore it, or:

  • Remove EUniverse from SetFromString, and infer it from the first digit.
  • Drop the boolean parameter from Render(), only render Steam3.
  • Replace private RenderSteam2() with public RenderSteam2(SteamIDCompatibility) where SteamIDCompatibility is either a bool, or an enum with two values along the lines of Pre2009 and Post2009.

Thoughts?

yaakov-h avatar May 23 '19 10:05 yaakov-h

@yaakov-h I'm not qualified to comment on the best solution, however, it would be great if this was not ignored and SteamKit offered the objectively correct behaviour.

strafe avatar May 24 '19 13:05 strafe

I propose just closing this issue and leaving the behaviour as-is, you should not be using Steam2 ids.

xPaw avatar Oct 31 '23 11:10 xPaw