question

entelicon avatar image
entelicon asked

ENABLE_PLAYFABSERVER_API

On my server build, I can't access the server API because ENABLE_PLAYFABSERVER_API is not true, and I'm not sure where to set it to true. Where do I set this to true so I can use the server API?

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.

1807605288 avatar image 1807605288 ♦ commented ·

For this question, please indicate which SDK and platform you are using.

Based on your question, I assume you're using Unity or Windows-VisualStudio.

If you are using Unity, are you also using our Editor Extensions package?

I need to know which of these options are relevant to you to give you the best answer.

0 Likes 0 ·
1807605288 avatar image
1807605288 answered

entelicon, you already found this, but I'm going to re-share it for posterity:
In Unity Editor extensions, there is a checkbox to enable/disable all APIs.
If it's not already visible, you can open the PlayFab EdEx panel with [dropdowns]->Window->PlayFab->Editor Extensions
From this window, you can choose [panel-tabs]->SETTINGS->API
This gives you some checkboxes to enable and disable APIs and features.

Without Editor extensions: The EdEx panel provides a convenient GUI which wraps the "Scripting Define Symbols" in Unity, specifically adding and removing our custom defines. The Unity documentation describing the Unity portion of this feature is here. The options (at time of writing) are as follows: ENABLE_PLAYFABSERVER_API, ENABLE_PLAYFABADMIN_API, DISABLE_PLAYFABCLIENT_API, and another debug option that most people should leave disabled. Adding these to your Unity Scripting Define Symbols will activate (or deactivate) that portion of the PlayFab UnitySdk code.

Please note that these define symbols are defined separately per-platform, and so you may need to set/reset them when you change between iOS and Android (for example).

10 |1200

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

entelicon avatar image
entelicon answered

Yeah I'm using Unity,

and at the time of posting I was not using the Editor Extension, so my question was with the default Unity SDK.

After posting this, I got the Editor Extension which gave me the option, but I would still like to know how to do this with the SDK. Thanks!

10 |1200

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

James McGhee avatar image
James McGhee answered

In Unity you can adjust the Scripting Define Symbols in your Project Settings > Player > Other Settings

This is simply a string of 'defines' seperated by ';'

So for example

MYCUSTOMDEFIN;MIRROR_1726_OR_NEWER;ENABLE_PLAYFABSERVER_API

that is 3 defines

my custom define

mirror 1726 or newer

and

enable playfab server api

You can set these on your local machine or if you use Unity cloud build you can set your build up to use specific defines (which is what we recomend)

So for example in Unity Cloud Build we configure a server build which is set up to build headless and uses the following defines

<some mirror ones>;ENABLE_PLAYFABSERVER_API;DISABLE_PLAYFABCLIENT_API

for our client builds we use

<some mirror ones>

note that for a client we dont need to define any PlayFab options since disbale server API and enable client API is by default apparently

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.