Jump to content
Sign in to follow this  
Dranolix

Loading last mission played from rotation?

Recommended Posts

I'm currently running a server with a rotation of several antistasi missions. I have the missions set up in the mission rotation in the server config, and they are working correctly.

 

Occasionally the server has to come down to play a weekly Zeus operation, and when the server is reset back to the antistasi mission rotation, it starts from the first mission in the rotation rather than the last mission that was played. This also happens when the server restarts on its own, which happens every so often. Is there any way to set up the server config so that it loads the last played mission in the rotation after a server restart rather than the mission that is first in the rotation listing?

Share this post


Link to post
Share on other sites

Not within the engine itself

You could write a powershell script that is run as part of your start up procedure. It could search for an entry in your server.rpt file for a diag_log entry  which defines the mission name or some token string that you could use to work from.

 

For example, the first entry in  a pre init function

  diag_log text "!!**!!";
  diag_log text format["|=========================  %1. %2 =========================|", missionName, worldName]; // stamp mission name to .rpt
  diag_log text "";

 

So reading from the end of the file backwards until it finds the token searchable string eg "!!**!!"  and then read the line after to compare with a list you have or something like a label "MISSION_A"  which you can then replace the old config file with a newly created one with  the correct cycle list you need

and then start the server.

 

You would have to take into consideration things like dealing with older rpt files, mission filename changes etc

 

 

Code something like a switch

string = switch(Tokenname)
{
     "MISSION_A":
     {
          "class Missions 
           { 
               class Mission01 { template = Mymission1.Altis; difficulty = "veteran"; class Params {}; }; 
               class Mission02 { template = Mymission2.Altis; difficulty = "veteran"; class Params {}; };
          };"
     }

     "MISSION_B":
     {
          "class Missions 
           { 
               class Mission02 { template = Mymission2.Altis; difficulty = "veteran"; class Params {}; }; 
               class Mission01 { template = Mymission1.Altis; difficulty = "veteran"; class Params {}; };
          };"
     }
};

New-Item D:\somepath\server.cfg

or have a set of configs already written but with .txt  extension and rename the extension or copy and rename the required .txt file as the new server.cfg

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×