question

Dan Wilson avatar image
Dan Wilson asked

Gamesever Zip clarification

Can you clarify the directory structure of the zip file contents on the server.

When I upload a zip file for a custom game server, what happens to the files in that zip?

If I upload a zip that contains 2 items, gameserver.exe and extratext.txt, when the server runs the extratext.txt file isn't in the same directory as the exe and it can't find the file...

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

The only thing that matters with our server hosting is that the executable which is used to launch the server instance (and which must remain running as long as the server instance should be available) is in the exact path you specify in the build as the Path. So, if you have it as just "gameserver.exe" (with no additional path elements), then there must be a gameserver.exe in the root of the zip file.

We change nothing about the relative paths of the items in your zip file when we load it onto a server, so if your exe can find the txt file in your local testing, and you're not using any absolute paths (since the zip file will be decompressed into a sub-folder on a drive on the machine, but you cannot count on the sub-folder name or drive being the same every time), there shouldn't be any issues accessing it in our hosting.

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.

Dan Wilson avatar image Dan Wilson commented ·

I figured out what was going on here, the working directory of the executable was the parent folder.

If for example you do a System.IO.File.Directory.GetCurrentDirectory(), it returns the gameserver folder, but if you get an absolute path via System.IO.File.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) then it returns the gamefiles folder that everything is in....

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.