beamable / BeamableProduct

The beamable product suite including com.beamable, com.beamable.server, microservice base image, portal, the installer, and build scripts
Other
5 stars 0 forks source link

Microservice Stats API should support increment/decrement behavior on game stats #3235

Open allister-beamable opened 5 months ago

allister-beamable commented 5 months ago

Is your feature request related to a problem? Please describe.

The Beamable API for Stats supports incrementing and decrementing player stats via the add field. However, the current C#MS implementation only supports using the set field which overwrites stats.

Describe the solution you'd like

Either update existing IMicroserviceStatsApi methods or create new ones to support doing incremental stat operations on game.private.player stats.

Describe alternatives you've considered

This can be worked around by using Requester to hit the stats API directly, but it would be slicker to have the functionality built into the SDK to get the benefit of intellisense and other conveniences.

cdhanna commented 5 months ago

There was work done previously on the client side to upgraded the auto-gen stats api to handle the polymorphic stats api, https://github.com/beamable/BeamableProduct/pull/2884/files#diff-515fa944d4cf55d19051a23bc26cfddc1fe9fbdbe6aa3c5dbeea4f3c94c6b274

but it was never merged. However, it may have insight for how to do this on the C#MS side.


If we support this in one place, we should support it in all known stat-sdk places (unity sdk, cli, and C#MS)

cdhanna commented 5 months ago

Peter and Ali discussed- but this would likely need a scala backend change?

allister-beamable commented 4 months ago

This would be considerably easier if the backend offered separate per-type endpoints instead of a single, polymorphic endpoint. https://disruptorbeam.atlassian.net/browse/PLAT-5495

cdhanna commented 1 week ago

If we don't wait for a backend fix, we'll adopt the responsibility to own this complex feature on every client; which is inefficient from an engineering perspective. We'll wait for the proper APIs to be in place, and implement against those when they arrive.