Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Steam Unified #217

Merged
merged 23 commits into from
Jan 24, 2023
Merged

Implement Steam Unified #217

merged 23 commits into from
Jan 24, 2023

Conversation

LossyDragon
Copy link
Collaborator

@LossyDragon LossyDragon commented Jan 4, 2023

Description

Throwing this here as an initial start to see if any eyes looking at this can maybe help improve this.

I managed to tinker around and get a working implementation of Steam Unified Messages.

It seems Java lacks some features compared to C# (SteamKit) to do some reflection magic to get the calling method within lambda, among other things possibly (or that I lack skillset wise), to cut down on some boilerplate.

Example, Steamkit can extract the a method call from a lamba, in which sendmessage passes down to be extracted, then uses reflection to build it all neatly in one method.

// C#
var playerService = steamUnifiedMessages.CreateService<IPlayer>();
playerService.SendMessage( x => x.GetGameBadgeLevels( req ) );

vs

// Java
Player playerService = new Player(steamUnifiedMessages);
playerService.GetGameBadgeLevels(badgeLevelsRequest.build());

After a few weeks of trying anything that I've learned, it appears Java cannot do it, so we have to make an adapter class to implement IPlayer, and pass everything though there.

However; building the Unified Message directly is on par with Steamkit, so thats a plus! :)

steamUnifiedMessages.sendMessage("Player.GetGameBadgeLevels#1", badgeLevelsRequest);

The interfaces need to be changed to return JobID, which is no biggie, while the "adapter" classes need to be built manually or generated with a groovy script

Checks off Steam Unified in #181 as the functionality is implemented.

Checklist

  • Code compiles correctly
  • All tests passing
  • Samples run successfully
  • Extended the README / documentation, if necessary

@LossyDragon LossyDragon added the enhancement New feature or request label Jan 4, 2023
@LossyDragon LossyDragon marked this pull request as draft January 4, 2023 07:03
@LossyDragon LossyDragon added the help wanted Extra attention is needed label Jan 4, 2023
@LossyDragon LossyDragon changed the title [Draft] Implement Steam Unified Implement Steam Unified Jan 9, 2023
@LossyDragon LossyDragon marked this pull request as ready for review January 9, 2023 20:32
@LossyDragon LossyDragon merged commit e7c260b into Longi94:master Jan 24, 2023
@LossyDragon LossyDragon deleted the unified branch January 24, 2023 01:55
@LossyDragon LossyDragon mentioned this pull request Jan 28, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant