question

Dan Wilson avatar image
Dan Wilson asked

Custom Server exe doesn't seem to be launching?

Hey there,

So I tried uploading and testing my custom server, and so far I am not able to make a socket connection with it.

After I upload the zip, and the instance is marked as running, in my client I call MatchMake, and and active game gets created that I can see under active games with a lobby ID, all the data from the matchmake call gets returned to the client, and I then try to connect to the provided IP/Port and I get a socket connection refused.

At first I thought it was some kind of connection issue, but I am not getting any logs at all, and I have the app setup to save it's logs where the command line param 'log_file_path' specifies, and I even name them with '.log' (saw that somewhere here in the forums). The other thing that the app does, once it's up and running it changes a value in my title data, via SetTitleData in the Server API.

(I am only doing this ATM to verify the app is running)

If i run the exe on my PC with all the command line params, everything works as expected, but I don't believe the exe is actually running on the playfab instance, and since I am not getting any logs at all when I terminate a 'lobby session' in the playfab config site, it seems to confirm that suspicion perhaps?

I don't know if you are able to look into anyting on your end at the moment, since there are currently no servers running for my title, but if you could that would be fantastic.

Title ID : AA2E

Custom Game Servers
10 |1200

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

brendan avatar image
brendan answered

I'm not seeing any builds in your title: https://developer.playfab.com/en-us/AA2E/servers/builds. Without that, it's hard to say what the issue was. The most common cause is that the exe is not in the right place in the Zip file uploaded, or it's not named correctly. The Path set in the configured build must be the relative path, including filename to the exe. So for example, if your exe is in the Zip file in a subfolder named "builds", and it's named "mygame.exe" the Path would be "builds\mygame.exe".

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

Dan Wilson avatar image Dan Wilson commented ·

I didn't want to leave a build running eating through my allotted 20 hrs.

I just put the build back up.

Still running into the same issue, lobby gets created and it says the game is running, but the title data entry isn't being update and I can't connect to the specified IP/Port.

0 Likes 0 ·
Dan Wilson avatar image Dan Wilson Dan Wilson commented ·

Just realized I could leave the build up there if I removed the region from the settings so its there but not actually running a server, so you can look at it when you have the time.

The build is "Default"

0 Likes 0 ·
Dan Wilson avatar image Dan Wilson commented ·

I wrote a different EXE that simply writes all the command line args passed to it to a file in the output files directory and then launches my other exe.

My main exe must be crashing, because this time I got the log file from the new exe.

0 Likes 0 ·
brendan avatar image brendan Dan Wilson commented ·

That could well be the problem, then. The way our auto-scaling works is that we add/remove servers automatically, as needed. Part of that process is knowing when a server instance is done, so that we can clean it up. We monitor the exe that you specify as the game server exe for us to launch for that. When it's done, the instance is considered done, and so gets cleaned up.

0 Likes 0 ·
Dan Wilson avatar image Dan Wilson brendan commented ·

The strange thing is the lobby/active game persists until I manually terminate it from the website

0 Likes 0 ·
Show more comments
Show more comments
Dan Wilson avatar image Dan Wilson Dan Wilson commented ·

i am downloading win server 2012 r2, i''l run it in a VM and see if I can figure out what is up, "it works on my box", but i am running win 10

0 Likes 0 ·
Dan Wilson avatar image Dan Wilson Dan Wilson commented ·

I posted an error i was getting, but i put it in as an answer, so its awaiting moderation, doh...

Suffice to say, JSON serialization issue.

If I remove the playfab call that uses the JSON serializer, the exe runs on my VM with Win server 2012, but I am still in the same spot running on the cloud, no logs or output files, and can't create a socket connection...

0 Likes 0 ·
Show more comments
Dan Wilson avatar image
Dan Wilson answered

I know what is happening, but I am unsure how to fix it....

There is something happening with JSON serialization/deserialization....

I spun up a Win server 2012 instance in a VM, if run the exact same command on the exact same files

gameserver.exe -title_secret_key=secretkeyhere -title_id=titlehere -server_host_port=9000 -log_file_path=Logs -batchmode

On Win10 it executes correctly

On WinServer2012 i get an exception

"Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ----> System.AggregateException: One or more errors occurred. ----> System.MissingMethodException: Method not found: '!!0[] System.Array.Empty'. at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject(Object value, Type type) at PlayFab.Json.SimpleJsonInstance.PlayFabJsonSerializerStrategy.DeserializeObject(Object value, Type type) at PlayFab.Json.PlayFabSimpleJson.DeserializeObject(Object value, Type type, IJsonSerializerStrategy jsonSerializerStrategy) at PlayFab.Json.PlayFabSimpleJson.DeserializeObject[T](String json, IJsonSerializerStrategy jsonSerializerStrategy) at PlayFab.Json.SimpleJsonInstance.DeserializeObject[T](String json) at PlayFab.Json.JsonWrapper.DeserializeObject[T](String json) at PlayFab.PlayFabServerAPI.<SetTitleDataAsync>d__87.MoveNext()"

Is there some reason why server 2012 would have issues with the JSON serializer?

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

brendan avatar image brendan commented ·

No, none. The next time you upload a build, can you please leave it there, so that we can look at the configuration? As long as you don't have any active regions, it won't turn on any servers.

0 Likes 0 ·
Dan Wilson avatar image Dan Wilson brendan commented ·

I have been trying to isolate what's going on, I am out of server time now though.

0 Likes 0 ·
Dan Wilson avatar image Dan Wilson brendan commented ·

how exactly is the exe launched by the playfab software?

If i push up an exe that only has a main function that writes a log that works, but for some reason my actual exe, I get nothing, and the first thing it does once it is up and running is write out some logs.

My guess is that it's throwing some kind of exception, but I have no way of knowing what it is.

0 Likes 0 ·
brendan avatar image brendan Dan Wilson commented ·

The executable is run as if you entered the Path followed by the Custom Parameters on a command line - no difference. The next time you have a build uploaded, let us know the ID, and we can have a look.

0 Likes 0 ·
Show more comments
Dan Wilson avatar image
Dan Wilson answered

I finally go this working.

Basically the executable that was provided by dark rift was looking for a config file that it couldn't find, in addition to that, it was also assuming some command line params were in a specific order.

I was able to write my own exe using their SDK to fix all of this.

I do have a question, I want to post a write up about how to get the Dark Rift server working with Playfab for others in the future, where would be the best place for that?

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.

brendan avatar image brendan commented ·

Good catch! If you want to do a write-up for our blog or a tutorial, I can work with the team to get that posted for you.

0 Likes 0 ·

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.