question

abdulmunim2005 avatar image
abdulmunim2005 asked

500 on Registering Server

My code

DontDestroyOnLoad(gameObject);
        clients = new List<ServerClient>();
        disconnectList = new List<ServerClient>();


        try
        {
            server = new TcpListener(IPAddress.Any, port);
            server.Start();
            StartListening();


            RegisterGameRequest req = new RegisterGameRequest { Build = "1.0", GameMode = "Classic", Region = Region.Japan,ServerHost = GetIP(),ServerPort = port.ToString() };
            PlayFabServerAPI.RegisterGame(req, ServerRegisterCallBack, Error);
        }
        catch (Exception e)
        {
            Debug.Log("Socket Eroor : " + e.Message);
        }

and My error is just debug.log(obj.ErrorMessage)

I am passing all the necessary things and opening the port and the external IP also.Socket does not return an error in catch but still the server gives an error callback.

unity3dCustom Game Servers
5 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.

abdulmunim2005 avatar image abdulmunim2005 commented ·

The game is working without Playfab , so you know there is nothing wrong before or with anything in my script

0 Likes 0 ·
abdulmunim2005 avatar image abdulmunim2005 commented ·

@Brendan help

0 Likes 0 ·
abdulmunim2005 avatar image abdulmunim2005 commented ·

[Image removed it contained my IP and the problem is solved]

Here are the values in "req" that are being passed. I hope I would get a workaround now.

0 Likes 0 ·
untitled.png (31.2 KiB)
abdulmunim2005 avatar image abdulmunim2005 abdulmunim2005 commented ·

Can you come on teamviewer because I have not continued since days now and I am about to ditch my plan, start a new Game

0 Likes 0 ·
abdulmunim2005 avatar image abdulmunim2005 commented ·

Very Very good news I disabled API Compression which I think was causing the issue now.

But new error comes in the same api call i.e. Game Mode not found : Classic

[Image removed it contained my IP and the problem is solved]

0 Likes 0 ·
untitled.png (23.5 KiB)
brendan avatar image
brendan answered

What is your Title ID, so that we can have a look at your configuration?

14 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.

abdulmunim2005 avatar image abdulmunim2005 commented ·

B96F is my title ID

0 Likes 0 ·
brendan avatar image brendan abdulmunim2005 commented ·

Looking at the title, the most immediate issue is that you haven't turned on external game server hosting. Check the "Setting up External Hosting" section of the tutorial for more info on that (https://api.playfab.com/docs/tutorials/external-game-servers). Next, you do need to upload a build, so that you have a matching Build ID, and then set up your Game Mode, so that it also exists (since that tells the service how many slots you have free at any given time). The tutorial incorrectly stated that you didn't need to upload a build, but since it's not possible to set up the Game Mode without a Build ID, I've corrected that in the write-up. We'll make the change to allow you to have Game Modes that don't require a build when using external game server hosting in a future update.

0 Likes 0 ·
abdulmunim2005 avatar image abdulmunim2005 brendan commented ·

Hey! it did not work

It gave me error 500 again

I turned on Setting up External Hosting then uploaded the build with version 1.0 and created a GameMode of name Classic

@Brendan Help Please!

0 Likes 0 ·
Show more comments
abdulmunim2005 avatar image abdulmunim2005 commented ·

@Brendan C'Mon answer Please

0 Likes 0 ·
brendan avatar image brendan abdulmunim2005 commented ·

While we have realtime 24/7 monitoring of the service which alerts our engineering team if there's ever a problem, we do not have 24/7 response to the forums. We do make an effort to get an answer to all questions as quickly as possible, but please be aware that it can take up to two business days to get a response (though historically, it's usually much faster, as in this case).

0 Likes 0 ·
abdulmunim2005 avatar image abdulmunim2005 brendan commented ·
@Brendan

Thank You !

Now I can Carry on my Work.

0 Likes 0 ·
abdulmunim2005 avatar image abdulmunim2005 commented ·

@Brendan

How is it working for you.

My Code

 //Similar to start but called on demand
    public void Init()
    {
        DontDestroyOnLoad(gameObject);
        clients = new List<ServerClient>();
        disconnectList = new List<ServerClient>();


        try
        {
            server = new TcpListener(IPAddress.Any, port);
            server.Start();
            StartListening();


            RegisterGameRequest req = new RegisterGameRequest() { Build = "1.0", GameMode = "Classic", Region = Region.Japan,ServerHost = GetIP(),ServerPort = port.ToString() };
            PlayFabServerAPI.RegisterGame(req, ServerRegisterCallBack, (result) => Debug.LogError(result.ErrorMessage));
        }
        catch (Exception e)
        {
            Debug.Log("Socket Eroor : " + e.Message);
        }
    }
0 Likes 0 ·
untitled.png (34.3 KiB)
brendan avatar image brendan abdulmunim2005 commented ·

Testing in Postman, I'm seeing it work fine:

POST /Server/RegisterGame HTTP/1.1
Host: B96F.playfabapi.com
Content-Type: application/json
X-SecretKey: {
                    {SecretKey}}
{
  "ServerHost": "118.129.31.244",
  "ServerPort": "9984",
  "Build": "1.0",
  "Region": "Japan",
  "GameMode": "Classic"
}

Response:

{
    "code": 200,
    "status": "OK",
    "data": {
        "LobbyId": "16688263396913404856"
    }
}

Can you please log all the actual string values you are passing into the call, so that we can check those details?

0 Likes 0 ·
abdulmunim2005 avatar image abdulmunim2005 brendan commented ·

I do not understand which values are you talking about exactly. I have already given my full code.

0 Likes 0 ·
Show more comments
abdulmunim2005 avatar image abdulmunim2005 commented ·

WHAT THE WHAT!

How is IT EVEN POSSIBLE

And I am still getting error 500 Please even give me a work around at least

0 Likes 0 ·
untitled.png (14.9 KiB)
untitled.png (2.5 KiB)
brendan avatar image brendan abdulmunim2005 commented ·

We really need to see the specific parameters you're passing in. Without that, it's not really possible to reproduce the error on our side and so get you a solution. Please see above.

0 Likes 0 ·
abdulmunim2005 avatar image
abdulmunim2005 answered

@Brendan Thank You very Much and just fix the bugs I found. So for anyone having the same problem Here is how you first it.

First turn OFF Compress API data :

Next:

Remove any decimal points from your Build ID:

My first build was "1.0" and changing it to "1" got me successful.

I hope this helps someone having the same problem.


untitled.png (20.5 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.

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.