question

brandon@uprootstudios.com avatar image
brandon@uprootstudios.com asked

Using the Server API in a build that is intended for Clients

Our server and client builds are nearly identical, except that our server builds are exported without textures and some other assets to keep memory usage low. However, I've realized that exposing calls to the Server API in builds intended for Client devices is not a good idea. If we're using the PlayFab Editor extension in Unity, is there a way to "Uncheck" Server API from a PreProcess script? Or is just wrapping every Server API call in #if UNITY_SERVER enough?

apisunity3d
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

As long as the developer key is not exposed to users, I don't think exposing server APIs will cause any trouble. Yes, wrapping every Server API is feasible but again, be aware that you should not add secret/developer key in your client build.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.