question

Matt avatar image
Matt asked

Can't connect to legacy server!

Hi folks,

I've got a legacy server running but I can't seem to connect to it. I haven't tested this in months, but the connection code, both on the client-side and server-side, have not changed. It looks like PlayFabClientAPI.Matchmake returns successfully, but perhaps the ip and/or port are incorrect? I don't seem to receive the OnConnect message on the server at all, and that netcode is the same as it's always been.

I'd really appreciate any help on this, as this is all that stands between testing and publicly releasing the game! My game is AC50.

Thanks so much!

-Matt

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.

Sarah Zhang avatar image Sarah Zhang commented ·

We are looking for the possible reasons.

0 Likes 0 ·
Sarah Zhang avatar image
Sarah Zhang answered

@Matthew Orlando

After researching, we guess the possible reason that causes the “disconnection” is failed authentication. Have you set the correct Titled and secret key in the server project’s PlayFabSharedSettings?

About the log file's question, if you followed the sample to write the server code, you could add this command to your build's Command-line arguments to fix the log files' output.

-logFile <log_file_path>
6 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.

Matt avatar image Matt commented ·

Thanks for the suggestion.

1. Connection Problem

I double checked and both the TitleId and Secret Key are set. I took a screenshot to show the settings. I haven't changed this at all since it used to work prior to legacy being deprecated. I added "Arena" to the Game Mode entry in the settings, but that doesn't seem to have helped. Also, when I attempt to connect and get disconnected, it looked as though the Instance made was also sent to Archived immediately, but I have a co-routine that is only run when someone disconnects with a 20min wait so idk why the instance was shutdown so fast.

2. Logging Problem

I noticed this build that the -logFile is different than the one that's defaulted in the command lines, -log_file_path. I added the entry you suggested, as seen in this screenshot, but I still get a 404 error when I go to archived games and click on the 'Log File' link for the instance that I tested today. I think maybe it's possible I'm not getting any debug calls hit with the connection problem I'm having above, so once that's fixed I'll know better if this works or not.

Thanks for the help, I truly appreciate it, especially being ready to release once this is fixed!

-Matt

0 Likes 0 ·
screenshot-1.png (36.8 KiB)
screenshot-2.png (42.1 KiB)
Sarah Zhang avatar image Sarah Zhang Matt commented ·

Could you please tell us is your build uploaded recently? I noticed you use the default path "gameserver.exe", is it the real name of your server executable?

0 Likes 0 ·
Matt avatar image Matt Sarah Zhang commented ·

Yes, when I make the build in Unity the executable is named 'gameserver.exe' and the data folder alongside it is 'gameserver_Data'. I wrap those both up into a zip file called 'Build.zip' and upload that. I name the build Id 'Arena' and I activate it in the 'US East' region.

From what I can remember, this is exactly how I've always done it, although I may have named the Build ID differently once uploaded - I'm not sure if I did and I'm not sure if that'd cause any problems.

The build up there now was uploaded 2 days ago. It's not my official server, but the test server I made that removes a tremendous amount of superfluous code to try to simplify my test case (I attached the server and client in an above comment). The result is identical in that I can't connect.

0 Likes 0 ·
Show more comments
Matt avatar image
Matt answered

Thank you so much. If there's anything I can provide to help figure this out, like any of my network code, I'd be happy to share!

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.

Sarah Zhang avatar image Sarah Zhang commented ·

We tried to test the network connection using our example project -- https://github.com/PlayFab/PlayFabGameServer. The client can connect to the legacy server successfully. The IP address and port that returned by MatchMake should be correct. We also tried to connect to the legacy server that is running on your title (A21AE5DCBCA85363 and 8155CBF65DFC292A are our testing accounts). The client can’t connect to it, and OnClientDisconnect function is called. It seems the issue is in the server project. Could you please provide the network code?Please notice hiding the private info.

0 Likes 0 ·
Matt avatar image Matt Sarah Zhang commented ·

I've attached my client-side network manager and the server-side mediator. I've removed a ton of code that I think is unnecessary to avoid clutter. If you think having the entire file, or even the project, would be more helpful (or necessary), perhaps I can send it outside of this public forum.

arenamanager.txt is the client-side file. The flow is pretty simple:

1. Via interface in the game, the player would start with an initial call to StartConnection

2. A successful return from PlayFabClientAPI.MatchMake would lead to calling ConnectClient, passing in the IP, port, and authentication data.

3. A network object is created, assigned the various handlers, and then attempts to connect to the IP and port provided.

4. The OnConnected handler never gets hit. It used to, several months ago when I was last working on and testing the multiplayer functionality.

arenamediator.txt is the server-side file. It's derived from the github example.

1. OnConnect handler would be hit when a client attempts to connect (not happening, not sure why). As mentioned in a comment in that function in the file, I made a test call to set some title data if that callback was hit, and the title data was never set.

0 Likes 0 ·
arenamanager.txt (11.9 KiB)
arenamediator.txt (11.8 KiB)
Matt avatar image Matt Sarah Zhang commented ·

So I've made a much simpler server and client to test connections. I cannot seem to connect to the server, and I also can't figure out how to successfully write the logfile.

If you could possibly provide me with some help on both my connection issue, as well as how to log output to the logfile on custom game servers, that'd be amazing.

0 Likes 0 ·
arenamediator.txt (10.8 KiB)
testclient.txt (8.1 KiB)
Sarah Zhang avatar image Sarah Zhang Matt commented ·

Apologies for the delayed reply, we will try to do the testing using the code.

0 Likes 0 ·
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.