question

joehot200 avatar image
joehot200 asked

Enable #if ENABLE_PLAYFABSERVER_API?

Hi,

In trying to combine the client and server examples into one project. In doing so, however, I notice that #if ENABLE_PLAYFABSERVER_API is not enabled, as I am using the client project and then attempting to copy the server over.

The only answers I can see on this forum point to things that don't exist. For example, there was an answer that claims there is a "PlayFab" dropdown under "Window", when there isn't, and another answer claimed that PlayFab Editor Extensions would fix it, and it doesn't.

How do I enable #if ENABLE_PLAYFABSERVER_API? How would I disable it for when I wish to build my game as a client?

I still haven't been able to find a solution after 2 days... I can't find a solution anywhere. Am I missing something obvious?



Thanks

Joe

apis
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

·
brendan avatar image
brendan answered

Please bear in mind that like any forum, answers that are very old might no longer be valid. If you see a case like that and need updated info, please reply to that specific thread and ask for updated info.

The #if is an example of a preprocessor directive. What you would do is use a #define to set the value in question, so that it enables the #if sections.

11 comments
10 |1200

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

joehot200 avatar image joehot200 commented ·

Could you show me a use case of #define? Googling "unity #define" tries to give me definitions of the word Unity ...

0 Likes 0 ·
joehot200 avatar image joehot200 commented ·

What I also don't understand is how on the client project the #if is true for the client API, and on the server the #if is true for the server API. How is this achieved, and where?

0 Likes 0 ·
brendan avatar image brendan joehot200 commented ·

This section of the Unity documentation talks about using preprocessor directives: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html

0 Likes 0 ·
joehot200 avatar image joehot200 brendan commented ·

Sorry, but the Unity documentation still doesn't answer my question. According to the documentation, it is either defined in the player settings, or defined by a file called mcs.rsp - However, there is no definition in the player settings, and there is no mcs.rsp file.

0 Likes 0 ·
Show more comments
Show more comments

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.