private static void InstallTeamspeakFiles(IContentEngineContent content, InstallTeamspeakPluginCommand c) {
     var s = new TeamspeakService();
     foreach (var f in c.Files) {
         switch (f.Type) {
         case TsType.Any: {
             foreach (var f2 in f.Source) {
                 var p = Path.Combine(content.PathInternal.ToString(), f2);
                 if (Directory.Exists(p)) {
                     if (s.IsX86Installed())
                         s.InstallX86PluginFolder(content, p, c.Options.Force);
                     if (s.IsX64Installed())
                         s.InstallX64PluginFolder(content, p, c.Options.Force);
                 } else {
                     if (s.IsX86Installed())
                         s.InstallX86Plugin(content, p, c.Options.Force);
                     if (s.IsX64Installed())
                         s.InstallX64Plugin(content, p, c.Options.Force);
                 }
             }
             break;
         }
         case TsType.x86: {
             if (!s.IsX86Installed())
                 return;
             foreach (var f2 in f.Source) {
                 var p = Path.Combine(content.PathInternal.ToString(), f2);
                 if (Directory.Exists(p)) {
                     s.InstallX86PluginFolder(content, p, c.Options.Force);
                 } else {
                     s.InstallX86Plugin(content, p, c.Options.Force);
                 }
             }
             break;
         }
         case TsType.x64: {
             if (!s.IsX64Installed())
                 return;
             foreach (var f2 in f.Source) {
                 var p = Path.Combine(content.PathInternal.ToString(), f2);
                 if (Directory.Exists(p)) {
                     s.InstallX64PluginFolder(content, p, c.Options.Force);
                 } else {
                     s.InstallX64Plugin(content, p, c.Options.Force);
                 }
             }
             break;
         }
         }
     }
 }
Example #2
0
        private static void InstallTeamspeakFiles(IContentEngineContent content, InstallTeamspeakPluginCommand c)
        {
            var s = new TeamspeakService();

            foreach (var f in c.Files)
            {
                switch (f.Type)
                {
                case TsType.Any: {
                    foreach (var f2 in f.Source)
                    {
                        var p = Path.Combine(content.PathInternal.ToString(), f2);
                        if (Directory.Exists(p))
                        {
                            if (s.IsX86Installed())
                            {
                                s.InstallX86PluginFolder(content, p, c.Options.Force);
                            }
                            if (s.IsX64Installed())
                            {
                                s.InstallX64PluginFolder(content, p, c.Options.Force);
                            }
                        }
                        else
                        {
                            if (s.IsX86Installed())
                            {
                                s.InstallX86Plugin(content, p, c.Options.Force);
                            }
                            if (s.IsX64Installed())
                            {
                                s.InstallX64Plugin(content, p, c.Options.Force);
                            }
                        }
                    }
                    break;
                }

                case TsType.x86: {
                    if (!s.IsX86Installed())
                    {
                        return;
                    }
                    foreach (var f2 in f.Source)
                    {
                        var p = Path.Combine(content.PathInternal.ToString(), f2);
                        if (Directory.Exists(p))
                        {
                            s.InstallX86PluginFolder(content, p, c.Options.Force);
                        }
                        else
                        {
                            s.InstallX86Plugin(content, p, c.Options.Force);
                        }
                    }
                    break;
                }

                case TsType.x64: {
                    if (!s.IsX64Installed())
                    {
                        return;
                    }
                    foreach (var f2 in f.Source)
                    {
                        var p = Path.Combine(content.PathInternal.ToString(), f2);
                        if (Directory.Exists(p))
                        {
                            s.InstallX64PluginFolder(content, p, c.Options.Force);
                        }
                        else
                        {
                            s.InstallX64Plugin(content, p, c.Options.Force);
                        }
                    }
                    break;
                }
                }
            }
        }