Quote:
Originally Posted by Ataros
C# should be able to read file names from a given folder I think but I may be wrong.
There was a mission posted here called Mission Loader that can read mission filenames. Banks' COOP lobby can do this too IIRC.
|
Yes, reading files from a specified folder is quite easy. Just call System.IO.Directory.GetFiles(<user's IL-2 missions folder>, "*.mis") and you'll get a nice array of strings representing all missions found.
But since I don't know which file is the one containing the current main mission I don't have much use for it. Hard coding the name of the mission into every mission file is not the way I want it to work since that would force the server operator to open up the mission .cs files and fiddle with its content. That, in turn, requires coding skills and presents a big risk he/she will corrupt the mission.
Instead, I'm aiming for a solution where all "extensions" (like "Fighter Command") can be installed from installation packages using a graphical installer, just like we're used to install normal desktop applications.
I wrote the coding framework for this (and the installer) a few week back and "Fighter Command" will be the first extension for it followed by "Live Map" (which automatically populates the landscape with traffic, livestock etc as the player flies over the map). The "framework", which I call "IL2X" right now seems to be stable and allows the coder to write code like he/she is used to, splitting up all code into libraries which can be reused and distributes automatically. Also, you can use normal runtime debugging in Visual Studio, setting up breakpoints or tracepoints to figure out how the sim works and for hunting down bugs in the code if need be. It works fine right now but needs more testing before I present it to the forums (hopefully within a week or two

)
So (sorry for the digression), what I'm really looking for here would be something like: "myMission.GamePlay.gpCurentFileName()" or something similar to it. I have not been able to find it though...