The question mainly is in the Read() method.
public static void Read(object source, ElapsedEventArgs e)
{
serverID = File.ReadAllText(sidname);
Console.WriteLine("Current ID: " + serverID);
if (serverID != oldserverID && serverID != "default" && serverID != "")
{
ProcessStartInfo servqueued = new ProcessStartInfo();
servqueued.Arguments = ramlimit + " " + spname + " " + sidname + " " + resourcetxt + " " + ramoutput + " " + rootpath + Path.DirectorySeparatorChar + " " + makeserverpath + " " + Logpath + " " + servqueuepath;
servqueued.FileName = fileservepath;
servqueued.WindowStyle = ProcessWindowStyle.Normal;
servqueued.CreateNoWindow = false;
Process queue;
queue = Process.Start(servqueued);
Console.WriteLine("Server process queued with server name: " + serverID);
File.AppendAllLines(logpath, new string[] { DateTime.Now.ToString("HH:mm:ss tt") + ": ", "Server process queued with server name " + serverID });
oldserverID = serverID;
}
}
Not sure why the Process.Start is ignored. The rest of the clause is fine, such as, if I put the oldserverID in the beginning.
EDIT
The arguments are global variables, and defined earlier in the script.
EDIT
Here are the global variables that are referenced. Mind the path hardcoding.
rootpath = "%USERPROFILE%" + Path.DirectorySeparatorChar +"desktop" + Path.DirectorySeparatorChar + "TerrariaServer" + Path.DirectorySeparatorChar + "filebin";
logpath = rootpath + Path.DirectorySeparatorChar + "fr_log.txt";
servqueuepath = rootpath + Path.DirectorySeparatorChar + "queuecheck.txt";
spname = "serverparams.cmd";
sidname = "serverid.cmd";
resourcetxt = rootpath + Path.DirectorySeparatorChar + "ramcheck.txt";
ramoutput = rootpath + Path.DirectorySeparatorChar + "sysresourceoutput.exe";
makeserverpath = rootpath + Path.DirectorySeparatorChar + "update.bat";
Logpath = rootpath + Path.DirectorySeparatorChar + "fsrv_log.txt";
fileservepath = rootpath + Path.DirectorySeparatorChar + "FileServe.exe";
UPDATE
Through the use of proper debugging methods (below), the problem source was.. solved, title edited.