Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by jooglier4 · May 13 at 04:55 AM ·

My network scene in Unity only loads when server is on standby

Hey, I'm using Unity, ApathyTransport and Playfab for server stuff. I have an offline scene that automatically tries to connect clients to the server. When the server is startet it loads a network scene for all clients, that means, every client which connects to the server should automatically load the server scene. BUT, when I try to connect as client to my server and the server is active, I connect but my server scene is not loaded. My server scene is only loaded when the server is on standby. This is the first weird thing. The second weird thing is, that when the server is on standby and I connect with a client (Server scene is loaded), my client gets shutted down after a certain amount of time... don't know why... what am I missing? Any help?

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Made Wang · May 13 at 08:16 AM

>>when I try to connect as client to my server and the server is active, I connect but my server scene is not loaded. My server scene is only loaded when the server is on standby.

It's up to you to check the order in which the code runs when you connect to the server, and whether the code to load the scene is executed correctly. But first make sure you're connected to the server.

>>The second weird thing is, that when the server is on standby and I connect with a client (Server scene is loaded), my client gets shutted down after a certain amount of time

If you didn't exit the server application yourself, then you can add an event in GameserverSDK.RegisterShutdownCallback to output the log when the server shuts down, refer to Integrating game servers with the PlayFab Game Server SDK (GSDK) - PlayFab | Microsoft Docs. You can view log files in Multiplayer->Servers->[Build]->Servers->Archived Servers.

Another thing to clarify is that the Standby server should become Active when you request the server, and then allow players to connect to the server. And you can see the specific status of the server and the players in it in Multiplayer->Servers->[Build]->Servers.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by jooglier4 · May 16 at 01:33 AM

>> Another thing to clarify is that the Standby server should become Active when you request the server, and then allow players to connect to the server. And you can see the specific status of the server and the players in it in Multiplayer->Servers->[Build]->Servers.

I mean the client only requests the server when I want to get the port and ip. Then I use port and ip to connect to the server without requesting it. Or is this approach wrong? And should the server stay active forever? So if I try to connect to a standby server with port and ip the server is not going to be active. What about this? (I'm completely new to playfab as you can see and thanks for your answer)

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Made Wang · May 18 at 08:12 AM 0
Share

There is no need to request every time, the request to the server is to assign the server IP and port and convert the server to Active. So, if the server is already Active, you can just use the corresponding IP and port to connect. But for a standby server, you should first request the server to convert the server to Active and then use the returned IP and port to connect.

The server doesn't stay Active forever and shouldn't be, usually the server is shut down when the server application process exits.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges