question

panayiotismilios avatar image
panayiotismilios asked

#if ENABLE_PLAYFABSERVER_API

I was using playfab along with unity and i tried to use a function from PlayFabServerAPI and it didn't recognize the class or the namespace using PlayFab.ServerModels. I went inside the server file and all cs files are like the one in the picture below (disabled). If i turn the #if statement to !DISABLE_PLAYFABSERVER_API it works but i didn't really wanna use it without asking first. What should i do?

screenshot-6.png (91.1 KiB)
screenshot-1.png (60.1 KiB)
10 |1200

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

Andy avatar image
Andy answered

I wouldn't recommend making that change. You'll want to be very careful about enabling the server API in Unity. Server API calls authenticate through a secret key which you NEVER want to make available to your game's client. If you did, players would gain access to your backend in ways that would severely compromise your game.

If you understand the implications, and still need to enable the server API, there's actually a setting in the Unity Plugin for it:


unityserverapi.png (20.5 KiB)
1 comment
10 |1200

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

panayiotismilios avatar image panayiotismilios commented ·

Ok, i see. Thanks a lot

0 Likes 0 ·
Muhammad Hassan avatar image
Muhammad Hassan answered

For me it just does not work even after enabling it from the PlayFabEdEx. The code is still disabled :/

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.