Пример #1
0
        private static void NewNode()
        {
            //all nodes have quite a few games, let's spin up another
            //this is a bit more tricky, we need to figure out which node folder has the latest version...
            var baseDirectory = Path.Combine(Bot.RootDirectory, ".."); //go up one directory
            var currentChoice = new NodeChoice();

            var file = Directory.GetFiles(@"C:\Users\skyji\Desktop\ww-new\Werewolf\Werewolf for Telegram\Werewolf Node\bin\Debug", "Werewolf Node.exe").First();

            /*foreach (var dir in Directory.GetDirectories(baseDirectory, "*Node*"))
             * {
             *  //get the node exe in this directory
             *  var file = Directory.GetFiles(dir, "Werewolf Node.exe").First();
             *  Version fvi = Version.Parse(FileVersionInfo.GetVersionInfo(file).FileVersion);
             *  if (fvi > currentChoice.Version)
             *  {
             *      currentChoice.Path = file;
             *      currentChoice.Version = fvi;
             *  }
             * }*/
            //var path = Directory.GetFiles(Directory.GetDirectories(baseDirectory, "*Node*").Last(), "Werewolf Node.exe").First();

            //now we have the most recent version, launch one
            //Process.Start(currentChoice.Path);
            Process.Start(file);
        }
Пример #2
0
        internal static void NewNode()
        {
            //all nodes have quite a few games, let's spin up another
            //this is a bit more tricky, we need to figure out which node folder has the latest version...
            var baseDirectory = Path.Combine(Bot.RootDirectory, ".."); //go up one directory
            var currentChoice = new NodeChoice();
            foreach (var dir in Directory.GetDirectories(baseDirectory, "*Node*"))
            {
                //get the node exe in this directory
                var file = Directory.GetFiles(dir, "Werewolf Node.exe").First();
                Version fvi = Version.Parse(FileVersionInfo.GetVersionInfo(file).FileVersion);
                if (fvi > currentChoice.Version)
                {
                    currentChoice.Path = file;
                    currentChoice.Version = fvi;
                }
            }

            //now we have the most recent version, launch one
            Process.Start(currentChoice.Path);
        }
Пример #3
0
        public static void ReplaceNodes(Update update, string[] args)
        {
            foreach(var n in Bot.Nodes)
                n.ShutDown();
            //get version
            var baseDirectory = Path.Combine(Bot.RootDirectory, ".."); //go up one directory
            var currentChoice = new NodeChoice();
            foreach (var dir in Directory.GetDirectories(baseDirectory, "*Node*"))
            {
                //get the node exe in this directory
                var file = Directory.GetFiles(dir, "Werewolf Node.exe").First();
                Version fvi = System.Version.Parse(FileVersionInfo.GetVersionInfo(file).FileVersion);
                if (fvi > currentChoice.Version)
                {
                    currentChoice.Path = file;
                    currentChoice.Version = fvi;
                }
            }

            Bot.Send($"Replacing nodes with latest version: {currentChoice.Version}", update.Message.Chat.Id);
        }
Пример #4
0
        public static void ReplaceNodes(Update update, string[] args)
        {
            foreach (var n in Bot.Nodes)
            {
                n.ShutDown();
            }
            //get version
            var baseDirectory = Path.Combine(Bot.RootDirectory, ".."); //go up one directory
            var currentChoice = new NodeChoice();

            foreach (var dir in Directory.GetDirectories(baseDirectory, "*Node*"))
            {
                //get the node exe in this directory
                var     file = Directory.GetFiles(dir, "Werewolf Node.exe").First();
                Version fvi  = System.Version.Parse(FileVersionInfo.GetVersionInfo(file).FileVersion);
                if (fvi > currentChoice.Version)
                {
                    currentChoice.Path    = file;
                    currentChoice.Version = fvi;
                }
            }

            Bot.Send($"Replacing nodes with latest version: {currentChoice.Version}", update.Message.Chat.Id);
        }
Пример #5
0
        private static void NewNode()
        {
            //all nodes have quite a few games, let's spin up another
            //this is a bit more tricky, we need to figure out which node folder has the latest version...
            var baseDirectory = Path.Combine(Bot.RootDirectory, ".."); //go up one directory
            var currentChoice = new NodeChoice();
            foreach (var dir in Directory.GetDirectories(baseDirectory, "*Node*"))
            {
                //get the node exe in this directory
                var file = Directory.GetFiles(dir, "Werewolf Node.exe").First();
                Version fvi = Version.Parse(FileVersionInfo.GetVersionInfo(file).FileVersion);
                if (fvi > currentChoice.Version)
                {
                    currentChoice.Path = file;
                    currentChoice.Version = fvi;
                }
            }

            //now we have the most recent version, launch one
            Process.Start(currentChoice.Path);
        }