Пример #1
0
 public MainWindow()
 {
     InitializeComponent();
     Uti     = new ClassUser();
     Manager = new ClassRegistry();
     Affichage("Connexion");
     // plus rapide pour les tests
     Login.Text        = "Admin";
     Password.Password = "******";
 }
Пример #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ErrorRenderer" /> class.
        /// </summary>
        public ErrorRenderer()
        {
            this.EnableOnPort443 = true;
            this.EnableOnPort80  = true;
            this.EnableOnHttp    = true;

            if (ClassRegistry.GetClass <CertManager>().CreateAuthority("PeaRoxy Authority", "PeaRoxy.crt"))
            {
                ClassRegistry.GetClass <CertManager>().RegisterAuthority("PeaRoxy Authority", "PeaRoxy.crt");
            }
        }
Пример #3
0
        /// <summary>
        ///     Generating or locating a certification for the specified domain name
        /// </summary>
        /// <param name="domainName">
        ///     The domain name.
        /// </param>
        /// <returns>
        ///     File path of the certification file or NULL if any error occurred.
        /// </returns>
        public static string GetCertForDomain(string domainName)
        {
            domainName = domainName.ToLower().Trim();
            string md5 = Common.Md5(domainName);

            if (ClassRegistry.GetClass <CertManager>()
                .CreateCert(domainName, "PeaRoxy.crt", Path.Combine("Cache", md5 + ".crt")))
            {
                return(Path.Combine("HTTPSCerts", "Cache", md5 + ".crt"));
            }

            return(null);
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameWorld"/> class.
        /// </summary>
        /// <param name="classRegistry">
        /// </param>
        /// <param name="gameSubsystems">
        /// </param>
        public GameWorld(ClassRegistry classRegistry, IEnumerable <IGameSubsystem> gameSubsystems)
        {
            int size = 65535;

            this.classRegistry = classRegistry;

            this.gameSubsystems = gameSubsystems.ToArray();

            // Zero indexed slot is reserved as special "null" value.
            this.Objects = new GameObject[size + 1];
            for (int current = 1; current < this.Objects.Length; ++current)
            {
                this.InitGameObject(current, ref this.Objects[current]);
            }
        }
Пример #5
0
        /// <summary>
        ///     The get extended info method is used to query any information about the program that made the request.
        /// </summary>
        /// <returns>
        ///     The <see cref="ConnectionInfo" /> object.
        /// </returns>
        public ConnectionInfo GetExtendedInfo()
        {
            try
            {
                if (this.extendedInfo != null)
                {
                    return(this.extendedInfo);
                }

                if (this.UnderlyingSocket != null)
                {
                    if (ClassRegistry.GetClass <ConnectionInfo>().IsSupported())
                    {
                        if (this.RequestType == RequestTypes.Tcp)
                        {
                            this.extendedInfo =
                                ClassRegistry.GetClass <ConnectionInfo>()
                                .GetTcpConnectionByLocalAddress(
                                    ((IPEndPoint)this.UnderlyingSocket.RemoteEndPoint).Address,
                                    (ushort)((IPEndPoint)this.UnderlyingSocket.RemoteEndPoint).Port);
                        }
                        else if (this.RequestType == RequestTypes.Udp)
                        {
                            this.extendedInfo =
                                ClassRegistry.GetClass <ConnectionInfo>()
                                .GetUdpConnectionByLocalAddress(
                                    ((IPEndPoint)this.UnderlyingSocket.RemoteEndPoint).Address,
                                    (ushort)((IPEndPoint)this.UnderlyingSocket.RemoteEndPoint).Port);
                        }
                        if (this.extendedInfo != null)
                        {
                            return(this.extendedInfo);
                        }
                    }
                }
            }
            catch (Exception)
            {
            }

            return(null);
        }
Пример #6
0
 public void RegisterTypes(ClassRegistry registry)
 {
     registry.RegisterType<Camera>();
     registry.RegisterType<Level>();
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IwGraphics"/> class.
 /// </summary>
 /// <param name="classRegistry">
 /// The class Registry.
 /// </param>
 public IwGraphics(ClassRegistry classRegistry)
 {
     this.classRegistry = classRegistry;
     this.Init();
 }
Пример #8
0
        static void Main(string[] args)
        {
            string[] files =
            {
                @"E:\Projects\Modding\Drome Racers\ARENA_CAR_textures\ARENA CAR\COLOUR_4\ARENA_CAR.XBX TEXTURE",
                @"E:\Projects\Modding\Drome Racers\ARENA_CAR_textures\ARENA CAR\COLOUR_4\COPY OF COLOUR_4\ARENA_CAR.XBX TEXTURE",
                @"E:\Projects\Modding\Drome Racers\ARENA_CAR_textures\ARENA CAR\COLOUR_4\COPY (2) OF COLOUR_4\ARENA_CAR.XBX TEXTURE"
            };
            foreach (string p in files)
            {
                using (System.IO.FileStream s = new System.IO.FileStream(p, System.IO.FileMode.Open))
                    using (System.IO.BinaryReader reader = new System.IO.BinaryReader(s))
                    {
                        Texture t = new Texture(reader);
                        t.DumpTGA(p + ".tga");
                    }
            }

            System.Console.WriteLine("Done.");
            System.Console.ReadLine();

            return;

            System.IO.StreamWriter log = new System.IO.StreamWriter("log.txt", false);

            /*LR2ModelExport(log);
             * log.Dispose();
             * return;*/

            Filesystem fs = new Filesystem();

            fs.LoadArchive(BaseDir);

            /*foreach (FileEntry file in fs.Files.Values)
             * {
             *  log.WriteLine(file);
             * }
             * log.WriteLine();
             * foreach (BlockEntry block in fs.Blocks)
             * {
             *  log.WriteLine(block);
             * }*/

            //System.Console.WriteLine("Ready to parse MD2.");
            //System.Console.ReadKey();

            /*FileEntry entry = fs.GetFileEntry(texFile);
             *
             * using (System.IO.MemoryStream ms = new System.IO.MemoryStream(fs.GetFileData(entry)))
             * using (System.IO.BinaryReader reader = new System.IO.BinaryReader(ms))
             * {
             *  ///MD2File model = new MD2File(reader);
             *  //(model.Blocks["GEO2"] as GEO2Block).ExportOBJ("export.obj");
             *
             *
             *  Texture texture = new Texture(reader);
             *  string path = System.IO.Path.ChangeExtension("dump\\" + entry.Filename.ToLower(), ".tga");
             *  string directory = System.IO.Path.GetDirectoryName(path);
             *  System.IO.Directory.CreateDirectory(directory);
             *  if (texture.PCTFormat != Texture.ImageFormat.DXT3)
             *  {
             *      texture.DumpTGA(path);
             *      System.Console.WriteLine("Converted " + entry.Filename);
             *  }
             *  else
             *      System.Console.WriteLine("Skipping DXT3");
             *  //(model.Blocks["GEO2"] as GEO2Block).ExportOBJ(path);
             *
             *  //log.WriteLine(texture.ToString());
             * }*/

            ClassRegistry.Initialize();

            foreach (FileEntry e in fs.FileEntries)
            {
                /*if (System.IO.Path.GetExtension(e.Filename).ToLower() == ".md2")
                 * {
                 *  System.Console.WriteLine("Exporting model \"" + e.Filename + "\"");
                 *  using (System.IO.MemoryStream ms = new System.IO.MemoryStream(fs.GetFileData(e)))
                 *  using (System.IO.BinaryReader reader = new System.IO.BinaryReader(ms))
                 *  {
                 *      MD2File model = new MD2File(reader);
                 *      //string path = System.IO.Path.ChangeExtension("dump\\" + e.Filename.ToLower(), ".obj");
                 *      //string directory = System.IO.Path.GetDirectoryName(path);
                 *      //System.IO.Directory.CreateDirectory(directory);
                 *      //(model.Blocks["GEO2"] as GEO2Block).ExportOBJ(path);
                 *
                 *      //log.WriteLine(e.Filename);
                 *      //if (model.Blocks.ContainsKey(BlockHeader.MAGIC_ANCHOR))
                 *      //{
                 *      //    AnchorBlock ab = model.Blocks[BlockHeader.MAGIC_ANCHOR] as AnchorBlock;
                 *      //    log.WriteLine("  " + ab.Anchors.Count + " anchors:");
                 *      //    foreach (Anchor a in ab.Anchors)
                 *      //    {
                 *      //        log.WriteLine("    " + a.MaterialIndex.ToString("X8") + ": " + a.Name + " (" + a.LinkedFilename + ")");
                 *      //    }
                 *      //}
                 *  }
                 * }
                 * if (System.IO.Path.GetExtension(e.Filename).ToLower() == ".pc texture")
                 * {
                 *  try
                 *  {
                 *      //log.WriteLine("Exporting texture \"" + e.Filename + "\"");
                 *      //System.Console.WriteLine("Exporting texture \"" + e.Filename + "\"");
                 *      using (System.IO.MemoryStream ms = new System.IO.MemoryStream(fs.GetFileData(e)))
                 *      using (System.IO.BinaryReader reader = new System.IO.BinaryReader(ms))
                 *      {
                 *          Texture texture = new Texture(reader);
                 *          string path = System.IO.Path.ChangeExtension("dump\\" + e.Filename.ToLower(), ".tga");
                 *          string directory = System.IO.Path.GetDirectoryName(path);
                 *          log.WriteLine(texture.Unk08.ToString("X8") + " [GOOD]: " + e.Filename);
                 *          System.IO.Directory.CreateDirectory(directory);
                 *          if (texture.PCTFormat == Texture.ImageFormat.DXT3)
                 *          {
                 *              texture.DumpTGA(path);
                 *              System.Console.WriteLine("Converted " + e.Filename);
                 *          }
                 *          //else
                 *          //    System.Console.WriteLine("Skipping DXT3");
                 *
                 *
                 *          //(model.Blocks["GEO2"] as GEO2Block).ExportOBJ(path);
                 *
                 *          //log.WriteLine(texture.ToString());
                 *      }
                 *  }
                 *  catch
                 *  {
                 *      //System.Console.WriteLine("[ERROR]: other");
                 *      using (System.IO.MemoryStream ms = new System.IO.MemoryStream(fs.GetFileData(e)))
                 *      {
                 *          System.IO.Directory.CreateDirectory("error/" + System.IO.Path.GetDirectoryName(e.Filename));
                 *          System.IO.File.WriteAllBytes("error/" + e.Filename, ms.ToArray());
                 *      }
                 *  }
                 * }
                 * if (System.IO.Path.GetExtension(e.Filename).ToLower() == ".ifl")
                 * {
                 *  using (System.IO.MemoryStream ms = new System.IO.MemoryStream(fs.GetFileData(e)))
                 *  {
                 *      IFLFile ifl = new IFLFile(ms, e.Filename);
                 *      System.Console.WriteLine(e.Filename + " - " + ifl.Frames.Count + " frames");
                 *      foreach (IFLFile.IFLFrame frame in ifl.Frames)
                 *      {
                 *          System.Console.WriteLine("    " + frame.ToString());
                 *      }
                 *  }
                 * }*/
                if (System.IO.Path.GetExtension(e.Filename).ToLower() == ".wrl")
                {
                    using (System.IO.MemoryStream ms = new System.IO.MemoryStream(fs.GetFileData(e)))
                        using (System.IO.BinaryReader reader = new System.IO.BinaryReader(ms))
                        {
                            World w = new World(reader);
                            System.Console.WriteLine("World '" + e.Filename + "' - " + w.Objects.Count + " Objects:");
                            log.WriteLine("World '" + e.Filename + "' - " + w.Objects.Count + " Objects:");

                            foreach (Drome.Object o in w.Objects)
                            {
                                //log.WriteLine("[" + o.GetType().Name + "] " + o.Header.ClassName + " '" + o.InstanceName + (o.ParentInstanceName.Length > 0 ? "' (parent '" + o.ParentInstanceName + "')" : "'"));
                            }
                        }
                }

                /*if (System.IO.Path.GetExtension(e.Filename).ToLower() == ".oli")
                 * {
                 *  using (System.IO.MemoryStream ms = new System.IO.MemoryStream(fs.GetFileData(e)))
                 *  using (System.IO.BinaryReader reader = new System.IO.BinaryReader(ms))
                 *  {
                 *      OLIFile oli = new OLIFile(reader);
                 *      oli.DumpOBJ("olidump_" + System.IO.Path.GetFileNameWithoutExtension(e.Filename) + ".obj");
                 *  }
                 * }*/
            }

            System.Console.WriteLine("Done.");
            System.Console.ReadKey();

            fs.Dispose();
            log.Dispose();
        }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IwAnim"/> class.
 /// </summary>
 /// <param name="classRegistry">
 /// The class Registry.
 /// </param>
 public IwAnim(ClassRegistry classRegistry)
 {
     this.classRegistry = classRegistry;
     this.Init();
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IwResManager"/> class.
 /// </summary>
 /// <param name="classRegistry">
 /// The class Registry.
 /// </param>
 public IwResManager(ClassRegistry classRegistry)
 {
     this.classRegistry = classRegistry;
     this.Init();
 }
Пример #11
0
 public void RegisterTypes(ClassRegistry registry)
 {
     registry.RegisterType <Camera>();
     registry.RegisterType <Level>();
 }